:root {
    --bg-base: #003764;
    /* Sincronizado exactamente con seguimiento.php */
    --accent-blue: #00d0f0;
    --glass-bg: rgba(0, 55, 100, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-hover: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-white: #ffffff;

    /* Tipografía Sincronizada */
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-display: 'League Spartan', sans-serif;
    /* Cambiado de Jersey 10 */
    --font-display-20: 'Jersey 20', sans-serif;
}

body,
html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-base);
    font-family: var(--font-main);
    /* Cambiado de Poppins a Inter */
    color: var(--text-white);
    height: 100%;
    overflow: hidden;
}

/* --- SPLASH SCREEN --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #003764;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

#splash-screen img {
    width: 150px;
    height: auto;
    animation: pulse 1s ease-in-out;
}

#splash-screen .splash-text {
    color: white;
    margin-top: 20px;
    font-size: 1.2rem;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* --- FONDO ANIMADO Y PROFUNDIDAD --- */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-base);
}

.blob {
    position: absolute;
    filter: blur(90px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
    border-radius: 50%;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: #005a9c;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: #001f3f;
    animation-delay: -5s;
}

.blob-3 {
    top: 30%;
    left: 20%;
    width: 35vw;
    height: 35vw;
    background: var(--accent-blue);
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10%, 15%) scale(1.1);
    }
}

/* --- SISTEMA DE VISTAS (SPA) CON ANIMACIÓN --- */
.view {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    position: absolute;
    top: 0;
    left: 0;
}

.view.active {
    display: flex;
    animation: fadeInSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 100 !important;
    /* Below the banner (1500) */
}

#view-fullscreen.active {
    z-index: 10000 !important;
}

@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- BANNER AUTO-SLIDE (PERSISTENT) --- */
.slider-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 0px;
    position: fixed;
    top: 70px;
    left: 0;
    z-index: 1500;
    pointer-events: none;
}

.slider-container {
    width: 90%;
    max-width: 420px;
    /* Ajustado para coincidir con la botonera */
    height: 150px;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    pointer-events: auto;
}

.slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.slide {
    min-width: 100%;
    flex-shrink: 0;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    opacity: 1;
    /* Maximizado para nitidez premium */
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 20px;
    text-align: left;
    z-index: 2;
}

.slide-content h3 {
    margin: 0;
    font-size: 2.2rem;
    /* Aumentado para Jersey */
    color: var(--accent-blue);
    text-transform: uppercase;
    font-family: var(--font-display);
    line-height: 1;
    margin-bottom: 5px;
}

.slide-content p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    line-height: 1.4;
}

.slide-content .citation {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.verse-slide .slide-content p {
    font-style: italic;
}

.top-nav {
    padding: 25px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    /* Directly above the view layer */
    width: 100%;
    pointer-events: none;
}

.btn-volver,
#btn-back-global {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 3rem !important;
    text-decoration: none !important;
    z-index: 2000 !important;
    /* Top layer, above banner */
    line-height: 0.5 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 10px !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    transition: all 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
}

.btn-volver:hover {
    color: white !important;
    transform: scale(1.1) !important;
}

/* --- ADMIN MENU FLAG --- */
#admin-menu {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    color: white;
    font-size: 1.5rem;
}

#admin-menu a {
    color: white;
    text-decoration: none;
}

/* --- CONTENEDORES PRINCIPALES --- */
.content-wrapper {
    padding: 280px 20px 40px 20px;
    /* Ajustado para el nuevo offset del banner */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    padding-top: 230px;
    padding-bottom: 0px;
    /* Ajustado para el nuevo offset del banner */
    position: relative;
    z-index: 10;
}

.view-title {
    font-family: var(--font-display-20);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 20px;
    margin-top: 0px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 208, 240, 0.4);
}

/* --- BOTONES DE NAVEGACIÓN --- */
.button-grid,
.internal-menu {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.nav-button,
.internal-menu button,
.internal-menu a {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    /* Slightly reduced padding */
    min-height: 80px;
    /* Reduced min-height */
    border-radius: 20px;
    text-align: left;
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    font-family: var(--font-main);
    gap: 20px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

/* Estilos específicos para botones de la PWA (iconos PNG) */
.btn-pwa-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.pwa-button {
    border-left: 4px solid var(--accent-blue) !important;
}

.nav-button::after,
.internal-menu button::after,
.internal-menu a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
}

.nav-button:hover::after,
.internal-menu button:hover::after,
.internal-menu a:hover::after {
    left: 200%;
}

.nav-button:hover,
.internal-menu button:hover,
.internal-menu a:hover {
    background: var(--glass-hover);
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 208, 240, 0.3);
    color: var(--accent-blue);
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.btn-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.btn-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.nav-button i {
    font-size: 1.5rem;
    width: 25px;
    text-align: center;
    opacity: 0.9;
}

.nav-button:hover i {
    transform: scale(1.1);
    color: var(--accent-blue);
}

.nav-button:hover .btn-subtitle,
.internal-menu button:hover .btn-subtitle {
    color: white;
}

/* --- VISTA PANTALLA COMPLETA --- */
.fullscreen-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 100px;
    align-items: center;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

.fullscreen-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 55, 100, 0.5), rgba(0, 30, 60, 0.9));
    z-index: 1;
    backdrop-filter: blur(0.7px);
}

/* --- LAMP VIEW MODIFICATIONS (SOLID BG) --- */
#view-fullscreen.lamp-view .fullscreen-content {
    background-image: none !important;
    /* Hide image for better contrast if preferred */
    background-color: var(--bg-base) !important;
    justify-content: flex-start;
    /* Moved to top as requested */
    padding-top: 120px;
    /* Space for the back button and visual balance */
    align-items: center;
}

#view-fullscreen.lamp-view .top-nav {
    top: 0;
    /* Reset to top when banner is hidden */
}

#view-fullscreen.lamp-view .btn-volver {
    top: 20px !important;
}

#view-fullscreen.lamp-view .fs-text-container {
    max-width: 400px;
    /* More focused column */
}

.fs-text-container {
    position: relative;
    z-index: 2;
    padding: 40px;
    width: 90%;
    max-width: 800px;
    animation: fadeInSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fs-title {
    font-family: var(--font-display-20);
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Fix for lint warning */
    -webkit-text-fill-color: transparent;
}

.fs-label {
    font-size: 1rem;
    color: var(--accent-blue);
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    display: none;
    /* Hidden by default, shown for lamps */
    margin-bottom: 5px;
}

.fs-info-box {
    display: none;
    /* Hidden by default */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.fs-info-item {
    margin: 10px 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.fs-info-item strong {
    color: var(--accent-blue);
    text-transform: uppercase;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}

.fs-subtitle {
    font-family: var(--font-main);
    font-size: 1.8rem;
    font-weight: 400;
    margin: 20px 0 40px 0;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
}

.btn-llegar {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #008eb0 100%);
    color: var(--text-white);
    border: none;
    padding: 20px 45px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 40px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 208, 240, 0.4);
    font-family: var(--font-main);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-llegar:hover {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-blue) 100%);
    color: var(--bg-base);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.4);
}

footer {
    text-align: center;
    font-family: 'Jersey 10', sans-serif;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    margin-top: auto;
    position: relative;
    z-index: 10;
    letter-spacing: 1px;
}

.float-wa {
    position: fixed;
    width: 42px;
    height: 42px;
    bottom: 54px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.float-wa:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* --- MODAL UBICACION FAMILIAS --- */
#familias-location-modal .modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: white;
    width: 350px;
    width: 70%;
    max-width: 350px;
}

#familias-location-modal .modal-header h2 {
    color: var(--accent-blue);
}

#familias-location-modal .modal-body p {
    color: rgba(255, 255, 255, 0.9);
}

.modal-btn-large {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #008eb0 100%);
    color: white;
    border: none;
    padding: 18px 0;
    border-radius: 15px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 208, 240, 0.3);
    display: block;
    margin-bottom: 15px;
}

.modal-btn-large.outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    color: rgba(255, 255, 255, 0.7);
}

.modal-btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 208, 240, 0.5);
    background: linear-gradient(135deg, #00e0ff 0%, #00a0c0 100%);
}

.modal-btn-large.outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* --- MODAL ACTUALIZACIÓN --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 35, 60, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.modal-overlay.show {
    display: flex !important;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 90%;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    color: #333;
}

.modal-header h2 {
    color: #003764;
    margin-bottom: 15px;
    font-size: 1.2rem;
    align-self: center;
}

.modal-body p {
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.4;
    color: #555;
}

#btn-update-app {
    background-color: #00ddffdb;
    color: white;
    border: none;
    padding: 15px 0;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

#btn-update-app:hover {
    background-color: #01aac4db;
}


@media (max-width: 600px) {
    .fs-title {
        font-size: 2.8rem;
    }

    .fs-subtitle {
        font-size: 1.3rem;
    }

    .view-title {
        font-size: 2rem;
    }

    .nav-button,
    .internal-menu button,
    .internal-menu a {
        min-height: 70px;
        font-size: 1.1rem;
    }
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ff416c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 10;
}

/* --- ESTILOS CABECERA (UNIFICADO) --- */
.app-header {
    background-color: #003764;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    /* Crucial para evitar desbordamiento por padding */
}

.header-controls {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.menu-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.header-right-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon-only {
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- ESTILOS MENÚ LATERAL (UNIFICADO) --- */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.side-menu-overlay.show {
    display: block;
    opacity: 1;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 3001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

.side-menu.show {
    transform: translateX(0);
}

.side-menu-header {
    padding: 7px 20px;
    padding-top: 17px;
    background: linear-gradient(135deg, #003764 0%, #001529 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-menu-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: white !important;
}

#menu-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    padding-bottom: 4px;
}

.side-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
    font-family: var(--font-main);
}

.menu-item:hover,
.menu-item:active {
    background: #f8f9fa;
    color: #003764;
    border-left-color: #00d0f0;
}

.menu-item.logout {
    color: #dc3545;
    margin-top: auto;
    border-top: 1px solid #eee;
}

.menu-item.logout:hover {
    background: #fff5f5;
    border-left-color: #dc3545;
}

.menu-item-icon {
    width: 28px;
    height: 28px;
    margin-right: 15px;
    opacity: 0.8;
}

.menu-item-icon-right {
    width: 18px;
    height: 18px;
    margin-left: auto;
    opacity: 0.6;
}

.side-menu-divider {
    height: 1px;
    background: #eee;
    margin: 10px 20px;
}
