/* ==========================================================================
   CSS PRINCIPAL - WEB OFICIAL CFL N° 407
   Ecosistema Educativo Fundaluz XXI / FATLyF
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Paleta Institucional Fundaluz XXI / CFL 407 */
    --cfl-navy-dark: #070b14;
    --cfl-navy-deep: #071540;
    --cfl-navy-mid: #0b1f66;
    --cfl-blue-primary: #1e40af;
    --cfl-blue-bright: #1d4ed8;
    --cfl-blue-electric: #2563eb;
    --cfl-cyan: #0284c7;
    --cfl-cyan-light: #38bdf8;
    --cfl-gold: #F5C518;
    --cfl-amber: #d97706;
    
    /* Neutros */
    --cfl-white: #ffffff;
    --cfl-bg-light: #f8fafc;
    --cfl-bg-card: #ffffff;
    --cfl-text-dark: #0f172a;
    --cfl-text-heading: #0b1f66;
    --cfl-text-body: #334155;
    --cfl-text-muted: #64748b;
    --cfl-border-light: #e2e8f0;
    --cfl-border-blue: rgba(29, 78, 216, 0.15);
    
    /* Fuentes */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Sombras & Transiciones */
    --shadow-sm: 0 2px 8px rgba(11, 31, 102, 0.04);
    --shadow-md: 0 10px 25px rgba(11, 31, 102, 0.08);
    --shadow-lg: 0 20px 45px rgba(11, 31, 102, 0.12);
    --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.35);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: #0284c7 #f1f5f9;
}

/* ==========================================================================
   BARRA DE SCROLL GENERAL ELEGANTE (ESTILO INSTITUCIONAL CFL 407)
   ========================================================================== */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1d4ed8 0%, #0284c7 50%, #38bdf8 100%);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:horizontal {
    background: linear-gradient(90deg, #1d4ed8 0%, #0284c7 50%, #38bdf8 100%);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #071540 0%, #0b1f66 40%, #1d4ed8 100%);
}

::-webkit-scrollbar-thumb:horizontal:hover {
    background: linear-gradient(90deg, #071540 0%, #0b1f66 40%, #1d4ed8 100%);
}

::-webkit-scrollbar-corner {
    background: #f1f5f9;
}

body {
    font-family: var(--font-body);
    color: var(--cfl-text-body);
    background-color: var(--cfl-white);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}



h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--cfl-text-heading);
    font-weight: 800;
    line-height: 1.25;
}

a {
    color: var(--cfl-blue-primary);
    text-decoration: none;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Clases de utilidad */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; text-justify: inter-word; }

.text-gradient-blue,
.text-gradient-cyan,
.text-gradient-gold {
    background: linear-gradient(90deg, #071540 0%, #071540 50%, #0b1f66 70%, #0284c7 88%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.section-padding {
    padding: 5.5rem 0;
}

.section-padding-sm {
    padding: 3.5rem 0;
}

.section-title-wrap {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    z-index: 5;
}

.section-title-mist {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    padding: 1.4rem 2.8rem;
    border-radius: 26px;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 30px rgba(11, 31, 102, 0.05), 0 0 25px rgba(255, 255, 255, 0.6) inset;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.section-tag {
    display: block;
    color: var(--cfl-cyan);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.9rem, 4.2vw, 2.9rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
    line-height: 1.15;
    background: linear-gradient(90deg, #071540 0%, #071540 50%, #0b1f66 70%, #0284c7 88%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
    z-index: 2;
}

.section-title span,
.section-title .text-gradient-cyan,
.section-title .text-gradient-blue,
.section-title .text-gradient-gold {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: inherit !important;
    color: inherit !important;
    display: inline !important;
}

.section-subtitle {
    color: var(--cfl-text-body);
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 740px;
    margin: 0 auto;
    line-height: 1.6;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #071540 0%, #0284c7 100%);
    margin: 1.1rem auto 0;
    border-radius: 2px;
}

/* Canvas 3D de fondo */
#canvasCfl407 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Botones Flotantes de Acción Rápida (WhatsApp + Buscador Lupa) */
.cfl-floating-actions {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.floating-wa-btn {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.floating-wa-btn.visible,
.cfl-floating-actions.visible .floating-wa-btn {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.floating-wa-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.65);
    color: white;
}

.floating-wa-btn .wa-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: waPulse 2s infinite;
    pointer-events: none;
}

@keyframes waPulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

.floating-search-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #071540 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45), 0 0 18px rgba(56, 189, 248, 0.25);
    cursor: pointer;
    outline: none;
    position: relative;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.floating-search-btn.visible,
.cfl-floating-actions.visible .floating-search-btn {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.floating-search-btn:hover {
    transform: scale(1.1) translateY(-3px);
    background: linear-gradient(135deg, #0ea5e9 0%, #1e40af 100%);
    box-shadow: 0 12px 32px rgba(2, 132, 199, 0.65), 0 0 25px rgba(56, 189, 248, 0.5);
    color: #ffffff;
    border-color: #38bdf8;
}

.floating-search-btn .search-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px solid #38bdf8;
    animation: searchPulse 2.8s infinite;
    pointer-events: none;
}

@keyframes searchPulse {
    0% { transform: scale(1); opacity: 0.8; }
    60% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

/* ==========================================================================
   OVERLAY DE BÚSQUEDA PREMIUM (Estilo Fundaluz XXI)
   ========================================================================== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 21, 64, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    width: 100%;
    max-width: 760px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.search-overlay-close {
    position: fixed;
    top: 24px;
    right: 28px;
    color: #ffffff;
    font-size: 2.3rem;
    cursor: pointer;
    opacity: 0.85;
    line-height: 1;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: all 0.25s ease;
    z-index: 100002;
}

.search-overlay-close:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    transform: rotate(90deg);
}

/* Badge Oficial Tripartito: Fundaluz - CFL - Luz y Fuerza */
.search-overlay-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.9rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.32);
    padding: 5px 16px 5px 8px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-overlay-brand-logos {
    display: flex;
    align-items: center;
    gap: 7px;
}

.search-overlay-brand-logos .brand-logo-fxxi {
    height: 26px;
    width: 26px;
    border-radius: 6px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 114, 255, 0.45));
}

.search-overlay-brand-logos .brand-logo-cfl-box {
    height: 26px;
    width: 23px;
    background: #ffffff;
    border-radius: 4px;
    padding: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.search-overlay-brand-logos .brand-logo-cfl-box img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}

.search-overlay-brand-logos .brand-logo-lyf {
    height: 26px;
    width: 26px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.65));
}

.search-overlay-brand-divider {
    width: 1px;
    height: 16px;
    background: rgba(56, 189, 248, 0.35);
}

.search-overlay-brand-badge span {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #38bdf8;
}

.search-overlay-title {
    color: #ffffff !important;
    margin-bottom: 1.6rem;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    text-align: center;
    font-weight: 800;
    -webkit-text-fill-color: #ffffff !important;
    line-height: 1.18;
}

.search-overlay-title span {
    color: #38bdf8 !important;
    -webkit-text-fill-color: #38bdf8 !important;
}

.search-overlay .search-container {
    max-width: 720px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    padding: 0.45rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 35px rgba(2, 132, 199, 0.25);
    transform: translateY(20px) scale(0.98);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.search-overlay.active .search-container {
    transform: translateY(0) scale(1);
}

.search-overlay .search-container input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 0.9rem 1.4rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.search-overlay .search-container input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.search-overlay .search-container button {
    background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 0 1.8rem;
    height: 48px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.96rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

.search-overlay .search-container button:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
}

.search-overlay-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 1.4rem;
    max-width: 650px;
}

.search-overlay-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    font-family: inherit;
}

.search-overlay-tag:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Lista de Resultados en Vivo dentro del Overlay */
.search-overlay-results {
    width: 100%;
    max-width: 720px;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 1rem;
    background: rgba(11, 31, 102, 0.96);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(2, 132, 199, 0.2);
    display: none;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
    z-index: 10;
}

.search-overlay-results.has-results {
    display: flex;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(56, 189, 248, 0.2);
    padding-left: 26px;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.search-result-cat {
    color: #38bdf8;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.search-result-arrow {
    color: #38bdf8;
    font-size: 0.95rem;
    transition: transform 0.2s;
    margin-left: 12px;
}

.search-result-item:hover .search-result-arrow {
    transform: translateX(4px);
    color: #ffffff;
}

.search-result-empty {
    padding: 18px 22px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-align: center;
}

/* Destello / Resaltado del curso seleccionado en el mapa */
@keyframes leafPulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.9);
        border-color: #38bdf8;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px 8px rgba(56, 189, 248, 0.7);
        border-color: #ffffff;
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
        border-color: #38bdf8;
        transform: scale(1);
    }
}

.cfl-map-course-leaf.pulse-highlight {
    animation: leafPulseHighlight 1.8s ease-out 2;
    z-index: 10;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 3.5rem 0;
    }
    .section-title-wrap {
        margin-bottom: 2.5rem;
    }
    .cfl-floating-actions {
        bottom: 16px;
        right: 16px;
        gap: 10px;
    }
    .floating-wa-btn,
    .floating-search-btn {
        width: 48px;
        height: 48px;
    }
    .floating-wa-btn {
        font-size: 1.45rem;
    }
    .floating-search-btn {
        font-size: 1.15rem;
    }

    /* Optimización del Overlay de Búsqueda en Móvil */
    .search-overlay {
        padding: 1rem 0.85rem 2rem;
        justify-content: flex-start;
    }
    .search-overlay-inner {
        padding-top: 3.6rem;
        min-height: auto;
    }
    .search-overlay-close {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
        font-size: 1.9rem;
    }
    .search-overlay-brand-badge {
        margin-bottom: 0.6rem;
        padding: 4px 13px 4px 7px;
        gap: 8px;
    }
    .search-overlay-brand-logos {
        gap: 5px;
    }
    .search-overlay-brand-logos .brand-logo-fxxi {
        height: 22px;
        width: 22px;
    }
    .search-overlay-brand-logos .brand-logo-cfl-box {
        height: 22px;
        width: 19px;
    }
    .search-overlay-brand-logos .brand-logo-lyf {
        height: 22px;
        width: 22px;
    }
    .search-overlay-brand-divider {
        height: 14px;
    }
    .search-overlay-brand-badge span {
        font-size: 0.74rem;
        letter-spacing: 1px;
    }
    .search-overlay-title {
        font-size: 1.55rem !important;
        margin-bottom: 1.1rem !important;
        line-height: 1.2 !important;
    }
    .search-overlay .search-container {
        padding: 0.35rem 0.4rem;
        border-radius: 50px;
    }
    .search-overlay .search-container input {
        padding: 0.65rem 0.85rem;
        font-size: 0.95rem;
    }
    .search-overlay .search-container button {
        height: 40px;
        padding: 0 1.2rem;
        font-size: 0.88rem;
        border-radius: 50px;
    }
    .search-overlay-tags {
        gap: 6px;
        margin-top: 1rem;
    }
    .search-overlay-tag {
        padding: 5px 11px;
        font-size: 0.76rem;
    }
    .search-overlay-results {
        max-height: 270px;
        margin-top: 0.75rem;
        border-radius: 16px;
    }
    .search-result-item {
        padding: 11px 14px;
        gap: 10px;
    }
    .search-result-title {
        font-size: 0.92rem;
    }
    .search-result-meta {
        font-size: 0.74rem;
        gap: 8px;
    }
    .search-result-arrow {
        font-size: 0.8rem;
        margin-left: 6px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .search-overlay .search-container button {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    .search-overlay .search-container button .search-btn-label {
        display: none;
    }
    .search-overlay .search-container button i {
        margin: 0;
        font-size: 0.9rem;
    }
}
