/* ==========================================================================
   Festiva — Tema moderno (capa de overrides sobre style.css)
   Glassmorphism + degradados + microanimaciones. Se carga DESPUÉS de style.css.
   Para volver al look anterior basta quitar el <link> en index.html.
   ========================================================================== */

:root {
    --ed-grad: linear-gradient(135deg, #7c3aed 0%, #c026d3 55%, #ec4899 100%);
    --ed-grad-acento: linear-gradient(135deg, #f59e0b 0%, #e8b64f 100%);
    --ed-vidrio: rgba(255, 255, 255, .72);
    --ed-vidrio-borde: rgba(255, 255, 255, .65);
    --ed-sombra-sm: 0 4px 16px rgba(124, 58, 237, .08);
    --ed-sombra-md: 0 10px 30px rgba(124, 58, 237, .14);
    --ed-sombra-lg: 0 20px 50px rgba(124, 58, 237, .22);
    --ed-glow: 0 8px 22px rgba(124, 58, 237, .35);
    --ed-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ── Fondo "aurora" con manchas de color difuminadas ─────────────────── */
body {
    background-color: #eef3f6;
    background-image:
        radial-gradient(60vmax 60vmax at 8% -10%, rgba(236, 72, 153, .22), transparent 60%),
        radial-gradient(50vmax 50vmax at 100% 10%, rgba(245, 158, 11, .16), transparent 60%),
        radial-gradient(60vmax 60vmax at 50% 110%, rgba(124, 58, 237, .16), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ── Entrada animada de cada pantalla y de sus tarjetas ──────────────── */
@keyframes edEntrada {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes edFlota {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes edBrillo {
    0%   { transform: translateX(-120%) skewX(-20deg); }
    60%, 100% { transform: translateX(260%) skewX(-20deg); }
}
@keyframes edPulso {
    0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, .45); }
    100% { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); }
}
@keyframes edGradienteMov {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#app-container > * { animation: edEntrada .55s var(--ed-ease) both; }
/* Los offcanvas y modales NO llevan la entrada de pantalla: su fill-mode "both" dejaba transform:none aun cerrados
   y anulaba el translateX(100%) del offcanvas, que entonces aparecía de golpe en vez de deslizarse. */
#app-container > .offcanvas, #app-container > .modal { animation: none; }
.card-grid > .card,
.product-grid > .card,
.dash-kpi-grid > *,
.dash-lower-grid > * { animation: edEntrada .5s var(--ed-ease) both; }
.card-grid > :nth-child(1), .dash-kpi-grid > :nth-child(1) { animation-delay: .04s; }
.card-grid > :nth-child(2), .dash-kpi-grid > :nth-child(2) { animation-delay: .09s; }
.card-grid > :nth-child(3), .dash-kpi-grid > :nth-child(3) { animation-delay: .14s; }
.card-grid > :nth-child(4), .dash-kpi-grid > :nth-child(4) { animation-delay: .19s; }
.card-grid > :nth-child(5) { animation-delay: .24s; }
.card-grid > :nth-child(6) { animation-delay: .28s; }
.card-grid > :nth-child(n+7) { animation-delay: .32s; }

/* ── Tarjetas de vidrio ──────────────────────────────────────────────── */
.card {
    background: var(--ed-vidrio);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--ed-vidrio-borde);
    border-radius: 20px;
    box-shadow: var(--ed-sombra-sm);
    transition: transform .35s var(--ed-ease), box-shadow .35s var(--ed-ease);
    position: relative;
    overflow: hidden;
}
.card::before {            /* hilo de luz superior */
    content: '';
    position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--ed-grad);
    opacity: 0;
    transition: opacity .3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--ed-sombra-md); }
.card:hover::before { opacity: 1; }
.card-header { border-bottom: 1px solid rgba(124, 58, 237, .08); }

.avatar { border: 2px solid transparent; background: var(--ed-grad-acento) border-box; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }

/* ── Header (si alguna pantalla lo usa) ──────────────────────────────── */
.header {
    background: var(--ed-grad);
    background-size: 200% 200%;
    animation: edGradienteMov 12s ease infinite;
    box-shadow: var(--ed-sombra-md);
    border-radius: 0 0 24px 24px;
}

/* ── Hero del dashboard con degradado vivo + brillo ──────────────────── */
.dash-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #5b21b6, #c026d3, #ec4899, #7c3aed);
    background-size: 300% 300%;
    animation: edGradienteMov 14s ease infinite, edEntrada .6s var(--ed-ease) both;
    border-radius: 24px;
    box-shadow: var(--ed-sombra-lg);
}
.dash-hero::before {      /* círculos decorativos */
    content: '';
    position: absolute; right: -40px; top: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 70%);
    animation: edFlota 6s ease-in-out infinite;
}
.dash-hero::after {       /* destello que cruza */
    content: '';
    position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
    animation: edBrillo 6s ease-in-out infinite;
    pointer-events: none;
}

/* ── KPIs ────────────────────────────────────────────────────────────── */
.kpi-card { border-radius: 22px; }
.kpi-card .kpi-icono {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--ed-grad);
    color: #fff !important;
    opacity: 1;
    box-shadow: var(--ed-glow);
    transition: transform .35s var(--ed-ease);
}
.kpi-card:hover .kpi-icono { transform: rotate(-8deg) scale(1.12); }
.kpi-card .kpi-valor {
    background: var(--ed-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
    letter-spacing: -.01em;
}
.kpi-link:hover { box-shadow: var(--ed-sombra-lg); }

/* ── Botones ─────────────────────────────────────────────────────────── */
.btn { transition: transform .25s var(--ed-ease), box-shadow .25s var(--ed-ease), background-color .2s, color .2s; font-weight: 600; letter-spacing: .01em; }
.btn-primary {
    background: var(--ed-grad);
    background-size: 160% 160%;
    border: none;
    box-shadow: var(--ed-glow);
    position: relative; overflow: hidden;
}
.btn-primary:hover, .btn-primary:focus-visible {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, .42);
}
.btn-primary:active { transform: translateY(0) scale(.97); }
.btn-primary::after {     /* destello al pasar */
    content: ''; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: translateX(-130%) skewX(-20deg);
}
.btn-primary:hover::after { animation: edBrillo 1s ease; }
.btn-outline-primary:hover { box-shadow: var(--ed-glow); transform: translateY(-2px); }
.btn-success { box-shadow: 0 8px 20px rgba(25, 135, 84, .3); }
.btn-danger  { box-shadow: 0 8px 20px rgba(220, 53, 69, .28); }
.btn-outline-secondary { border-width: 1.5px; backdrop-filter: blur(6px); background: rgba(255, 255, 255, .5); }

.btn-icon { border-radius: 12px; background: rgba(255, 255, 255, .7); backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(124, 58, 237, .08); }
.btn-icon:hover { box-shadow: 0 8px 18px rgba(124, 58, 237, .22); }

/* ── Barra inferior flotante de vidrio ───────────────────────────────── */
.tab-nav {
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, .8);
    box-shadow: 0 -10px 40px rgba(124, 58, 237, .14);
}
.sucursal-bar {
    background: transparent;
    border-bottom: 1px solid rgba(124, 58, 237, .08);
    color: var(--ed-primario);
    font-weight: 600;
    letter-spacing: .04em;
}
.tab-item { transition: color .25s, transform .3s var(--ed-ease); }
.tab-item:hover { color: var(--ed-primario); transform: translateY(-2px); }
.tab-item.active::before {
    background: var(--ed-grad);
    opacity: .16;
    animation: edPildora .35s var(--ed-ease) both;
}
@keyframes edPildora {
    from { opacity: 0; transform: translateX(-50%) scale(.6); }
    to   { opacity: .16; transform: translateX(-50%) scale(1); }
}
.tab-item.active i { color: var(--ed-primario); transform: translateY(-1px) scale(1.12); transition: transform .3s var(--ed-ease); }
.tab-item.active::after {   /* puntito dorado indicador */
    content: ''; position: absolute; bottom: 4px; left: 50%;
    width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
    background: var(--ed-acento);
}
@media (min-width: 768px) {
    .tab-nav { bottom: 12px; border-radius: 26px; border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--ed-sombra-lg); }
}

/* ── Modales y offcanvas de vidrio ───────────────────────────────────── */
.modal-backdrop.show, .offcanvas-backdrop.show {
    opacity: 1;
    background: rgba(10, 40, 54, .45);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.modal-content {
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: var(--ed-sombra-lg);
}
.modal.fade .modal-dialog { transform: translateY(30px) scale(.94); transition: transform .4s var(--ed-ease), opacity .3s; }
.modal.show .modal-dialog { transform: none; }
.offcanvas {
    background: rgba(248, 251, 252, .94);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    transition: transform .45s var(--ed-ease);
}
.offcanvas-end { border-left: 1px solid rgba(255, 255, 255, .8); box-shadow: -10px 0 50px rgba(124, 58, 237, .2); }
.offcanvas-header { border-bottom: 1px solid rgba(124, 58, 237, .08); }
.offcanvas-title { font-weight: 700; color: var(--ed-primario-oscuro); }

/* ── Formularios ─────────────────────────────────────────────────────── */
.form-control, .form-select, .input-group-text {
    background: rgba(255, 255, 255, .8);
    border: 1.5px solid rgba(124, 58, 237, .14);
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.form-control:focus, .form-select:focus {
    background: #fff;
    border-color: #c026d3;
    box-shadow: 0 0 0 4px rgba(192, 38, 211, .16);
}
.android-input.form-floating > .form-control { background: transparent; border-bottom: 2px solid rgba(124, 58, 237, .18); }
.android-input.form-floating > .form-control:focus {
    border-bottom-color: var(--ed-primario);
    box-shadow: 0 8px 14px -10px rgba(124, 58, 237, .55) !important;
}
.selector-item { background: rgba(255, 255, 255, .85); border: 1.5px solid rgba(124, 58, 237, .1); transition: transform .25s var(--ed-ease), border-color .2s, box-shadow .25s; }
.selector-item:hover, .selector-item.activo { transform: translateX(4px); box-shadow: var(--ed-sombra-sm); }

/* ── Chips, pestañas y badges ────────────────────────────────────────── */
.chips-scroll { padding: 4px 2px 8px; }
.chips-scroll .btn { border-radius: 50px; }
.chips-scroll .btn-primary { transform: scale(1.04); }
.chips-scroll .btn-outline-secondary { border-color: rgba(124, 58, 237, .15); }
.nav-pills .nav-link { border-radius: 50px; transition: all .3s var(--ed-ease); }
.nav-pills .nav-link.active { background: var(--ed-grad); box-shadow: var(--ed-glow); }
.badge { box-shadow: 0 2px 8px rgba(0, 0, 0, .08); letter-spacing: .02em; }

/* ── Progreso con brillo animado ─────────────────────────────────────── */
.progreso-fino { border-radius: 50px; background: rgba(124, 58, 237, .1); overflow: hidden; }
.progreso-fino .progress-bar {
    background: linear-gradient(90deg, #f59e0b, #f0c466, #f59e0b);
    background-size: 200% 100%;
    animation: edGradienteMov 3s linear infinite;
    border-radius: 50px;
    transition: width .9s var(--ed-ease);
}

/* ── Login ───────────────────────────────────────────────────────────── */
#form-login-passenger {
    background: var(--ed-vidrio);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid var(--ed-vidrio-borde);
    border-radius: 30px;
    padding: 2rem 1.6rem 1.4rem;
    margin-top: 2rem !important;
    box-shadow: var(--ed-sombra-lg);
}
#form-login-passenger h1 { font-size: 1.5rem; font-weight: 700; color: var(--ed-primario-oscuro); }
#img-login-logo {
    animation: edFlota 4s ease-in-out infinite;
    box-shadow: 0 14px 34px rgba(124, 58, 237, .35);
}

/* ── Scrollbar fina ──────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(124, 58, 237, .3) transparent; }
::selection { background: rgba(245, 158, 11, .3); }

/* ── Accesibilidad: sin animaciones si el usuario lo pide ────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ── Tarjetas: sombra en capas + brillo que sigue al cursor ──────────── */
.card {
    box-shadow:
        0 1px 2px rgba(124, 58, 237, .06),
        0 6px 14px rgba(124, 58, 237, .08),
        0 18px 36px -8px rgba(124, 58, 237, .16),
        inset 0 1px 0 rgba(255, 255, 255, .9);
}
.card:hover {
    box-shadow:
        0 2px 4px rgba(124, 58, 237, .08),
        0 12px 24px rgba(124, 58, 237, .14),
        0 30px 56px -10px rgba(124, 58, 237, .28),
        0 0 0 1px rgba(192, 38, 211, .25),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}
.card::after {              /* brillo: reflejo diagonal al pasar el mouse */
    content: '';
    position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .55) 50%, transparent 100%);
    transform: translateX(-160%) skewX(-20deg);
    pointer-events: none;
}
.card:hover::after { animation: edBrillo .9s ease; }
.card:active { transform: translateY(-1px) scale(.99); }
.dash-hero::after, .kpi-card::after { z-index: 0; }

/* ── Fondo de modales/offcanvas: mismo color abierto o cerrándose; solo cambia la opacidad ── */
.modal-backdrop, .offcanvas-backdrop {
    --bs-backdrop-opacity: 1;
    background-color: rgba(10, 40, 54, .45);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.modal-backdrop.fade, .offcanvas-backdrop.fade { transition: opacity .4s ease; }
.modal-backdrop.fade:not(.show), .offcanvas-backdrop.fade:not(.show) { opacity: 0; }

/* ── Rendimiento: transiciones ágiles y sin desenfoque costoso dentro de paneles ── */
.modal-backdrop.fade, .offcanvas-backdrop.fade { transition: opacity .2s ease; }
.offcanvas { transition: transform .28s var(--ed-ease); -webkit-backdrop-filter: none; backdrop-filter: none; background: #f8fbfc; }
.modal.fade .modal-dialog { transition: transform .25s var(--ed-ease), opacity .2s; transform: translateY(16px) scale(.97); }
.modal.show .modal-dialog { transform: none; }
.modal-content { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
.modal-backdrop, .offcanvas-backdrop { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
