/* ===========================================================================
   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: #000000; 
}

/* Superposición (Overlay) - MUY SUTIL (10-40% Opacidad) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; 
    /* Degradado negro muy suave para máxima visibilidad del fondo */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(2px); 
}

/* ===========================================================================
   REDISEÑO DE INTERFAZ (ULTRA TRANSPARENT GLASS)
   =========================================================================== */

/* 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, /* NUEVO: Tarjetas de Citas */
#daily-news-modal, 
#suggestion-modal, 
#help-modal,
#vor-decision-modal,
#qr-modal,           /* NUEVO */
#dates-modal,        /* NUEVO */
#edit-modal,         /* NUEVO */
input,
button,
textarea,
select,
.rounded-xl, 
.rounded-2xl,
.rounded-lg {
    border-radius: 12px !important; 
}

/* 2. TARJETAS Y CONTENEDORES NEGROS (TRANSPARENCIA ALTA) */
.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 { /* NUEVO: Para inputs de citas */
    background-color: rgba(0, 0, 0, 0.25) !important; /* 25% Opacidad (Muy cristalino) */
    backdrop-filter: blur(15px) !important; 
    border: 1px solid rgba(255, 255, 255, 0.1) !important; 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2) !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, 30, 30, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ★★★ BOTÓN ROJO TRANSPARENTE (ACCIDENTES) ★★★ */
.bg-red-600\/70 {
    background-color: rgba(153, 27, 27, 0.25) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2) !important;
}
.bg-red-600\/70:hover {
    background-color: rgba(185, 28, 28, 0.4) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* 3. INPUTS (CAMPOS DE TEXTO) - CASI INVISIBLES */
input, textarea, select {
    background-color: rgba(0, 0, 0, 0.2) !important; 
    border-color: rgba(255, 255, 255, 0.15) !important; 
    color: #f1f5f9 !important; 
}
input:focus, textarea:focus {
    border-color: #ffffff !important; 
    background-color: rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) !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(255, 255, 255, 0.1); 
    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(0, 0, 0, 0.2) !important; 
}

.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.05); border-color: rgba(255, 255, 255, 0.15); }
.btn-history-edit:hover { background-color: rgba(255, 255, 255, 0.1); }

.btn-history-delete { color: #ef4444; background-color: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.btn-history-delete:hover { background-color: rgba(239, 68, 68, 0.2); color: #fff; }

.btn-history-complete { color: #22c55e; background-color: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); }
.btn-history-complete:hover { background-color: rgba(34, 197, 94, 0.2); color: #fff; }


/* --- VOR HIGHLIGHTS --- */
.vor-highlight {
    background-color: rgba(69, 10, 10, 0.3) !important; 
    border: 1px solid rgba(127, 29, 29, 0.4) !important;
}
.vor-alert {
    background-color: rgba(66, 32, 6, 0.3) !important;
    border: 1px solid rgba(146, 64, 14, 0.4) !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: #ffffff !important; 
    background-color: rgba(255, 255, 255, 0.05) !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.15);
    backdrop-filter: blur(15px); 
    z-index: 50; 
    background-color: rgba(0, 0, 0, 0.8) !important; /* 80% Opacidad */
    color: white !important;
}

/* 2. Ventanas Modales (Cuadradas/Glass) */
#daily-news-modal, 
#suggestion-modal,
#help-modal,
#vor-decision-modal,
#qr-modal,           /* NUEVO */
#dates-modal,        /* NUEVO */
#edit-modal {        /* NUEVO */
    background-color: rgba(15, 23, 42, 0.85) !important; /* Color base oscuro + 85% opacidad */
    backdrop-filter: blur(15px) !important; /* Desenfoque fuerte */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !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,      /* NUEVO */
#dates-modal > div,   /* NUEVO */
#edit-modal > div,    /* NUEVO */
#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.1); }
::-webkit-scrollbar-thumb { background-color: #525252; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background-color: #737373; }

/* --- 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(10, 10, 10, 0.8) !important; border: 1px solid rgba(255,255,255,0.15); }
#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" (Refined Mobile)
   =========================================================================== */

.aurora-nav-bar {
    background-color: rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(8px); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    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 10px 40px -10px rgba(0, 0, 0, 0.3);
    scrollbar-width: none; 
}
.aurora-nav-bar::-webkit-scrollbar { display: none; }

.aurora-tab {
    position: relative;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: #d4d4d4; 
    font-weight: 600;
    font-size: 0.95rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease, background 0.3s 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);
}

.aurora-tab.active {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.aurora-tab.active::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0%, 
        transparent 20%, 
        #3b82f6 40%, 
        #f59e0b 50%, 
        #3b82f6 60%, 
        transparent 80%, 
        transparent 100%
    );
    filter: blur(20px); 
    opacity: 0.8; 
    animation: rotateAurora 4s linear infinite;
    z-index: -2;
}

.aurora-tab.active::after {
    content: '';
    position: absolute;
    inset: 2px; 
    background: rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(5px); 
    border-radius: 10px; 
    z-index: -1;
}

@keyframes rotateAurora {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ===========================================================================
   ESTILOS STOCK DUAL (TRANSPARENTE)
   =========================================================================== */

.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.15);
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); 
    backdrop-filter: blur(10px);
}

.stock-column-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    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.15); 
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 0.75rem;
}

.stock-available-card {
    background-color: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}
.stock-available-card:hover {
    border-color: #ffffff; 
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px); 
}


/* ===========================================================================
   OVERLAY DE CARGA (10% OPACIDAD)
   =========================================================================== */

#loading-overlay {
    background-color: rgba(0, 0, 0, 0.1) !important; 
    backdrop-filter: blur(3px) !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.5) !important;
}

#login-modal h1, 
#login-modal h2, 
#login-modal form {
    transform: translateZ(40px);
    text-shadow: 0 10px 20px rgba(0,0,0,0.5); 
}


/* ===========================================================================
   CORRECCIONES FINALES: BITÁCORA Y VOR (GLASS STYLE)
   =========================================================================== */

/* 1. Título "Actividad Reciente" (Sticky) - Efecto Cristal */
#daily-news-modal h3.sticky {
    background-color: rgba(15, 23, 42, 0.6) !important; 
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding-left: 0.5rem; 
}

/* 2. Botones Grandes del Modal VOR (Taller vs Tarea) */
#btn-vor-choice-taller,
#btn-vor-choice-task {
    background-color: rgba(0, 0, 0, 0.25) !important; 
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2) !important;
    color: white !important;
    transition: all 0.2s ease-in-out;
}

#btn-vor-choice-taller:hover,
#btn-vor-choice-task:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
}

#btn-vor-choice-taller > div:first-child,
#btn-vor-choice-task > div:first-child {
    background-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px);
    border-radius: 8px;
}