/* ===========================================================================
   ESTILOS GENERALES Y FONDO
   =========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    
    /* Tu fondo */
    background-image: url('background-van.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; 
    
    background-color: #0f172a; /* Slate 900 de respaldo */
}

/* Superposición (Overlay) - Sutil para mejorar contraste sin tapar el fondo */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; 
    /* Degradado negro suave */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(2px); 
}

/* ===========================================================================
   REDISEÑO DE INTERFAZ (GLASS 40% - EQUILIBRADO)
   =========================================================================== */

/* 1. BORDES REDONDEADOS UNIFICADOS */
.page-content,
#login-modal,
.van-card,
.qr-van-card,
.guantera-van-card,
.vor-van-card,
.manage-van-card,
.van-history-summary-card,
.tire-history-summary-card,
.rental-history-summary-card,
.accident-history-summary-card,
.history-entry-card,
.appointment-card,
#daily-news-modal, 
#suggestion-modal, 
#help-modal,
#vor-decision-modal,
#qr-modal,
#dates-modal,
#edit-modal,
input,
button,
textarea,
select,
.rounded-xl, 
.rounded-2xl,
.rounded-lg {
    border-radius: 12px !important; 
}

/* 2. TARJETAS Y CONTENEDORES (40% OPACIDAD) */
.bg-slate-900\/40,
.bg-slate-800\/50,
.bg-blue-600\/70, 
.bg-slate-800\/70,
.bg-amber-600\/70,
.bg-green-600\/70,
.bg-slate-700\/70 { 
    /* CAMBIO: Ajustado a 0.4 (40%) según petición */
    background-color: rgba(15, 23, 42, 0.4) !important; 
    backdrop-filter: blur(12px) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important; 
}

/* Hover en botones grandes */
.bg-blue-600\/70:hover,
.bg-slate-800\/70:hover,
.bg-amber-600\/70:hover,
.bg-green-600\/70:hover {
    background-color: rgba(30, 41, 59, 0.6) !important; /* Un poco más oscuro al pasar el mouse */
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
}

/* ★★★ BOTÓN ROJO (ACCIDENTES) ★★★ */
.bg-red-600\/70 {
    background-color: rgba(127, 29, 29, 0.4) !important; 
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2) !important;
}
.bg-red-600\/70:hover {
    background-color: rgba(153, 27, 27, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* 3. INPUTS (CAMPOS DE TEXTO) - UN POCO MÁS OPACOS PARA LEER (40-50%) */
input, textarea, select {
    background-color: rgba(0, 0, 0, 0.4) !important; 
    border-color: rgba(255, 255, 255, 0.2) !important; 
    color: #ffffff !important; 
    font-weight: 500 !important;
}
input:focus, textarea:focus {
    border-color: #60a5fa !important; 
    background-color: rgba(0, 0, 0, 0.6) !important; 
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3) !important;
}
input::placeholder, textarea::placeholder {
    color: #94a3b8 !important; 
}


/* ===========================================================================
   UTILIDADES Y COMPORTAMIENTO
   =========================================================================== */

.page-content.hidden, .van-card.hidden, .qr-van-card.hidden, .vans-subpage.hidden, .neumaticos-subpage.hidden, .alquiler-subpage.hidden, .accidentes-subpage.hidden, .guantera-subpage.hidden, #daily-news-modal.hidden, #vor-decision-modal.hidden, #qr-modal.hidden, #dates-modal.hidden, #edit-modal.hidden {
    display: none;
}

.qr-van-card canvas { max-width: 100%; height: auto; }
#modal-composite-canvas { max-width: 100%; height: auto; }

/* Botones de lista matrícula */
.matricula-select-btn.active {
    background-color: rgba(37, 99, 235, 0.6); /* Azul semi-transparente */
    color: white;
    border-color: #ffffff; 
}

#van-history-detail-page.hidden, #tire-history-detail-page.hidden, #rental-history-detail-page.hidden, #accident-history-detail-page.hidden { display: none; }
#page-gestionar-flota.hidden, #page-operativa-vor.hidden { display: none; }

.vor-van-card.hidden, .manage-van-card.hidden, .van-history-summary-card.hidden, .tire-history-summary-card.hidden, .rental-history-summary-card.hidden, .accident-history-summary-card.hidden { display: none; }


/* --- BOTONES HISTORIAL --- */
.history-entry-card {
    transition: transform 0.2s ease;
    background-color: rgba(15, 23, 42, 0.4) !important; /* 40% */
}

.btn-history-edit,
.btn-history-delete,
.btn-history-complete {
    font-size: 0.75rem; 
    font-weight: 600; 
    padding: 0.35rem 0.75rem;
    border-radius: 6px !important;
    transition: all 0.2s ease-in-out;
    border-width: 1px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.btn-history-complete:disabled, .btn-history-delete:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-history-edit { color: #e5e5e5; background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.btn-history-edit:hover { background-color: rgba(255, 255, 255, 0.2); }

.btn-history-delete { color: #fca5a5; background-color: rgba(127, 29, 29, 0.3); border-color: rgba(239, 68, 68, 0.4); }
.btn-history-delete:hover { background-color: rgba(220, 38, 38, 0.5); color: #fff; }

.btn-history-complete { color: #86efac; background-color: rgba(20, 83, 45, 0.3); border-color: rgba(34, 197, 94, 0.4); }
.btn-history-complete:hover { background-color: rgba(22, 163, 74, 0.5); color: #fff; }


/* --- VOR HIGHLIGHTS --- */
.vor-highlight {
    background-color: rgba(69, 10, 10, 0.4) !important; 
    border: 1px solid rgba(248, 113, 113, 0.3) !important;
}
.vor-alert {
    background-color: rgba(66, 32, 6, 0.4) !important; 
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

/* --- INTERACTIVIDAD --- */
.vor-van-card.clickable-card, .guantera-clickable-card { cursor: pointer; position: relative; }
.vor-van-card.clickable-card .vor-toggle-btn, .vor-van-card.clickable-card .edit-dates-btn, .vor-van-card.clickable-card a { position: relative; z-index: 10; }

.guantera-clickable-card:hover {
    border-color: #60a5fa !important; 
    background-color: rgba(30, 41, 59, 0.6) !important;
    transform: translateY(-2px);
}

/* --- ESTILOS SEPARADOS PARA BOTONES FLOTANTES Y VENTANAS MODALES --- */

#suggestion-fab.hidden, #help-fab.hidden { display: none; }

/* 1. Botones Flotantes (Redondos) */
#suggestion-fab, 
#help-fab {
    border-radius: 50px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(15px); 
    z-index: 50; 
    background-color: rgba(15, 23, 42, 0.8) !important; /* Un poco más oscuro para destacar */
    color: white !important;
}
#suggestion-fab:hover, #help-fab:hover {
    background-color: rgba(30, 41, 59, 0.9) !important;
    border-color: white;
}

/* 2. Ventanas Modales (Cuadradas/Glass - 60% Opacidad para que se distingan del fondo) */
#daily-news-modal, 
#suggestion-modal,
#help-modal,
#vor-decision-modal,
#qr-modal,
#dates-modal,
#edit-modal {
    background-color: rgba(15, 23, 42, 0.6) !important; /* 60% */
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    border-radius: 16px !important;
    color: #f8fafc !important;
    z-index: 60;
}

/* Asegurar que los fondos internos de los modales sean transparentes */
#daily-news-modal > div, 
#suggestion-modal > div, 
#help-modal > div,
#vor-decision-modal > div,
#qr-modal > div,
#dates-modal > div,
#edit-modal > div,
#daily-news-modal header,
#suggestion-modal header,
#help-modal header {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important; 
}


/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background-color: #64748b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }

/* --- MODAL GLOBAL --- */
#global-alert-overlay.hidden { display: none; }
#global-alert-modal { 
    transform: scale(0.95); opacity: 0; transition: all 0.2s ease-out; 
    background-color: rgba(30, 41, 59, 0.8) !important; /* Slate 800 semi */
    border: 1px solid rgba(255,255,255,0.2); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
#global-alert-overlay:not(.hidden) #global-alert-modal { transform: scale(1); opacity: 1; }
#global-alert-btn-confirm.btn-destructive { background-color: #991b1b; color: white; }


/* ===========================================================================
   BARRA DE NAVEGACIÓN "AURORA" (40%)
   =========================================================================== */

.aurora-nav-bar {
    background-color: rgba(15, 23, 42, 0.4); /* 40% */
    backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto !important; 
    -webkit-overflow-scrolling: touch; 
    white-space: nowrap; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    scrollbar-width: none; 
}
.aurora-nav-bar::-webkit-scrollbar { display: none; }

.aurora-tab {
    position: relative;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: #cbd5e1; 
    font-weight: 600;
    font-size: 0.95rem;
    background: transparent;
    border: 1px solid transparent; 
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap; 
    overflow: hidden; 
    z-index: 1;
    flex-shrink: 0 !important; 
    flex-grow: 0;
}

.aurora-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.aurora-tab.active {
    color: #ffffff;
    background-color: rgba(30, 41, 59, 0.6); /* 60% para destacar la pestaña activa */
    border-color: rgba(59, 130, 246, 0.5); 
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.aurora-tab.active::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0%, 
        #1e3a8a 40%, 
        #1e40af 60%, 
        transparent 100%
    );
    filter: blur(20px); 
    opacity: 0.4; 
    animation: rotateAurora 4s linear infinite;
    z-index: -2;
}


@keyframes rotateAurora {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ===========================================================================
   ESTILOS STOCK DUAL (40%)
   =========================================================================== */

.stock-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    .stock-grid-container {
        grid-template-columns: 1fr 1fr; 
    }
}

.stock-column {
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4); /* 40% */
    backdrop-filter: blur(10px);
}

.stock-column-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0.5rem;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.stock-missing-card {
    background-color: rgba(127, 29, 29, 0.2); 
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 0.75rem;
}

.stock-available-card {
    background-color: rgba(30, 41, 59, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 0.5rem;
}
.stock-available-card:hover {
    border-color: #93c5fd; 
    background-color: rgba(59, 130, 246, 0.2);
    transform: translateX(3px); 
}


/* ===========================================================================
   OVERLAY DE CARGA
   =========================================================================== */

#loading-overlay {
    background-color: rgba(15, 23, 42, 0.6) !important; /* 60% */
    backdrop-filter: blur(5px) !important; 
    z-index: 100; 
}


/* ===========================================================================
   [BLOQUE 05] - EFECTO 3D LOGIN (TILT)
   =========================================================================== */

#login-modal {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.1s ease-out;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7) !important;
    background-color: rgba(15, 23, 42, 0.6) !important; /* 60% para el login */
}

#login-modal h1, 
#login-modal h2, 
#login-modal form {
    transform: translateZ(40px);
    text-shadow: 0 4px 8px rgba(0,0,0,0.8); 
}


/* ===========================================================================
   CORRECCIONES FINALES
   =========================================================================== */

/* 1. Título "Actividad Reciente" (Sticky) */
#daily-news-modal h3.sticky {
    background-color: rgba(30, 41, 59, 0.8) !important; /* Casi sólido para que no se mezcle al hacer scroll */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding-left: 0.5rem; 
    z-index: 20;
}

/* 2. Botones Grandes del Modal VOR */
#btn-vor-choice-taller,
#btn-vor-choice-task {
    background-color: rgba(30, 41, 59, 0.4) !important; 
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    color: white !important;
    transition: all 0.2s ease-in-out;
}

#btn-vor-choice-taller:hover,
#btn-vor-choice-task:hover {
    background-color: rgba(51, 65, 85, 0.6) !important;
    border-color: #94a3b8 !important;
    transform: translateY(-2px);
}