/* Sorteo Asamblea - Estilos v1.2 */

#sa-container {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sa-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 25px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-radius: 16px;
    color: white;
}

.sa-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
}

.sa-info {
    margin: 0;
    font-size: 15px;
    opacity: 0.95;
}

.sa-info strong {
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 999px;
}

/* Alerta */
.sa-alerta {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    margin-bottom: 20px;
}

/* Panel de sorteo */
.sa-sorteo-panel {
    background: #0f172a;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
}

.sa-display {
    margin-bottom: 25px;
}

.sa-badge {
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 20px;
}

#sa-numero {
    font-family: 'Courier New', monospace;
    font-size: 100px;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 60px rgba(251, 191, 36, 0.5);
    letter-spacing: 12px;
    transition: all 0.3s ease;
}

#sa-numero.sa-ganador-num {
    animation: pulso 0.4s ease 3;
    color: #22c55e;
    text-shadow: 0 0 60px rgba(34, 197, 94, 0.5);
}

@keyframes pulso {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Ganador actual */
.sa-ganador-actual {
    margin: 20px 0;
}

.sa-ganador-card {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    padding: 25px;
    border-radius: 16px;
    animation: aparecer 0.4s ease;
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.sa-ganador-premio {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 10px;
}

.sa-ganador-nombre {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sa-ganador-rut {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: rgba(255,255,255,0.85);
}

.sa-mensaje-continuar {
    background: #fef3c7;
    color: #92400e;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 16px;
    border: 2px solid #fcd34d;
}

.sa-mensaje-continuar strong {
    font-size: 20px;
}

.sa-badge-invitado {
    background: #f59e0b;
    color: #000;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Controles */
.sa-controles {
    margin-top: 25px;
}

.sa-btn-primary {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    border: none;
    padding: 18px 50px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.4);
}

.sa-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(251, 191, 36, 0.5);
}

.sa-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sa-admin-controles {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #334155;
}

.sa-btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.sa-btn-danger:hover {
    background: #b91c1c;
}

/* Historial */
.sa-historial {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.sa-historial h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #334155;
}

.sa-historial-item {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

.sa-historial-item.sa-al-agua {
    background: #fef2f2;
    border-color: #fca5a5;
    opacity: 0.8;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.sa-hist-num {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    color: #16a34a;
    background: #dcfce7;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
}

.sa-al-agua .sa-hist-num {
    color: #dc2626;
    background: #fee2e2;
    text-decoration: line-through;
}

.sa-hist-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sa-hist-nombre {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sa-hist-rut {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #64748b;
}

.sa-hist-estado {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.sa-badge-ganador {
    background: #16a34a;
    color: white;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.sa-badge-al-agua {
    background: #dc2626;
    color: white;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.sa-hist-premio {
    font-size: 11px;
    color: #64748b;
}

.sa-btn-al-agua {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sa-btn-al-agua:hover {
    background: #dc2626;
    color: white;
}

/* Completado */
.sa-completado {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: white;
}

.sa-completado-icono {
    font-size: 60px;
    margin-bottom: 15px;
}

.sa-completado h3 {
    font-size: 28px;
    margin: 0 0 10px 0;
}

.sa-completado p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    #sa-numero {
        font-size: 70px;
        letter-spacing: 8px;
    }
    
    .sa-sorteo-panel {
        padding: 25px 15px;
    }
    
    .sa-ganador-nombre {
        font-size: 20px;
    }
    
    .sa-historial-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
    }
    
    .sa-hist-estado {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .sa-btn-al-agua {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}
