/* =========================================
   1. VARIABLES Y TEMA (MODERNO)
   ========================================= */
:root {
    /* Paleta Refinada */
    --color-primary: #1a2530;      /* Azul Profundo */
    --color-primary-light: #2c3e50;
    --color-accent: #c5a059;       /* Dorado */
    --color-accent-hover: #d4af37; 
    
    /* Fondos */
    --bg-body: #f8f9fa;            /* Gris casi blanco */
    --bg-surface: #ffffff;         /* Blanco puro */
    --bg-alt: #f0f2f5;             /* Gris suave */
    
    /* Textos */
    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-light: #ffffff;

    /* UI Elements */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 12px 24px -6px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.12);
    --shadow-hover: 0 25px 50px -12px rgba(0,0,0,0.18);
    
    --nav-glass: rgba(26, 37, 48, 0.85);
}

/* --- DARK MODE (Alto Contraste) --- */
body.dark-mode {
    --color-primary: #0f1216;
    --color-primary-light: #1a2530;
    --color-accent: #d4af37;
    
    /* Reasignamos los fondos a oscuros */
    --bg-body: #121212;
    --bg-surface: #1e1e1e;
    --bg-alt: #181818;
    
    /* Reasignamos los textos a claros */
    --text-main: #e0e0e0;     /* Blanco suave */
    --text-muted: #b0b3b8;    /* Gris claro */
    
    --nav-glass: rgba(15, 18, 22, 0.95);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
}

/* =========================================
   !!! FIX BOOTSTRAP PARA MODO OSCURO !!!
   (Esto arregla que no se vea el texto)
   ========================================= */
body.dark-mode .text-dark { color: var(--text-main) !important; }
body.dark-mode .text-muted { color: var(--text-muted) !important; }
body.dark-mode .bg-light { background-color: var(--bg-surface) !important; }
body.dark-mode .bg-white { background-color: var(--bg-surface) !important; }
body.dark-mode .border { border-color: rgba(255,255,255,0.1) !important; }

/* =========================================
   2. BASE Y TIPOGRAFÍA
   ========================================= */
html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body {
    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: var(--color-accent);
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }

/* =========================================
   3. NAVBAR (Glassmorphism)
   ========================================= */
.navbar {
    background: var(--nav-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

.navbar-brand span {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
    margin-left: 12px;
}

.navbar-logo {
    height: 45px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 50px;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero {
    height: 90vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(26,37,48,0.3), rgba(26,37,48,0.8));
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    color: #fff !important;
    font-size: clamp(3rem, 6vw, 5rem);
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    font-family: 'Lato', sans-serif;
    color: #fff !important;
}

/* Botones Modernos */
.btn-custom {
    background: var(--color-accent);
    background: linear-gradient(135deg, var(--color-accent), #b08d45);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 40px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(197, 160, 89, 0.5);
    color: #fff;
}

.btn-outline-custom {
    border: 2px solid rgba(255,255,255,0.8);
    color: #fff;
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    background: rgba(255,255,255,0.05);
}

.btn-outline-custom:hover {
    background: #fff;
    color: var(--color-primary);
    border-color: #fff;
}

/* =========================================
   5. TARJETAS Y NOTICIAS
   ========================================= */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.card {
    background-color: var(--bg-surface);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    color: var(--text-main);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-header-custom {
    background: var(--color-primary);
    color: #fff;
    padding: 20px;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    text-align: center;
}

.news-card .card-header {
    background: transparent;
    border-bottom: none;
}

.badge-news-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.95);
    color: var(--color-primary);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.news-card .card-body {
    padding: 1.5rem 2rem;
}

.news-card h3 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

/* Enlaces dentro de noticias - Color dinámico */
.news-card h3 a {
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s;
    padding-bottom: 2px;
    color: var(--text-main); /* Importante para dark mode */
}

.news-card:hover h3 a {
    background-size: 100% 2px;
    color: var(--color-primary);
}
body.dark-mode .news-card:hover h3 a {
    color: var(--color-accent);
}

.book-card-mini {
    text-align: center;
    transition: transform 0.3s;
}
.book-card-mini:hover { transform: translateY(-5px); }
.book-card-mini .ratio {
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
}

/* =========================================
   6. SECCIONES ESPECÍFICAS
   ========================================= */
.bg-alt { background-color: var(--bg-alt); }
.bg-light { background-color: var(--bg-surface); }

/* Campamento Grid */
.camp-badge {
    background: rgba(197, 160, 89, 0.15);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.camp-card {
    background: var(--bg-surface);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    text-align: center;
    height: 100%;
}
.camp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}
.camp-card .camp-section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}
body.dark-mode .camp-card .camp-section-title {
    color: var(--color-accent);
}

.camp-card.bg-primary {
    background: var(--color-primary) !important;
    border: none !important;
}
.camp-card.bg-primary .camp-section-title { color: #fff !important; }
.camp-card.bg-primary small { color: rgba(255,255,255,0.7) !important; }

/* Tablas de Horarios */
.table-custom tr td {
    padding: 18px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 1.05rem;
    color: var(--text-main);
}
.table-custom tr:last-child td { border-bottom: none; }
body.dark-mode .table-custom tr td { border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Contacto Section Moderna */
#contacto.bg-dark {
    background-color: var(--color-primary) !important;
    color: #fff !important;
}
#contacto a.text-white { color: #fff !important; }

/* =========================================
   7. FORMULARIOS & MODALES
   ========================================= */
.form-control, .form-select {
    background-color: var(--bg-surface);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-main);
}
body.dark-mode .form-control, body.dark-mode .form-select {
    border-color: rgba(255,255,255,0.1);
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.1);
    color: var(--text-main);
    background-color: var(--bg-surface);
}

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem 2rem;
}
body.dark-mode .modal-header { border-color: rgba(255,255,255,0.1); }

.modal-body {
    padding: 2rem;
}

/* =========================================
   8. FOOTER & UTILIDADES
   ========================================= */
footer {
    background-color: var(--color-primary);
    color: rgba(255,255,255,0.6);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.dark-toggle {
    background: var(--color-accent);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: fixed;
    bottom: 30px;
    right: 30px;
    box-shadow: var(--shadow-lg);
    z-index: 1030;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.dark-toggle:hover { transform: scale(1.1) rotate(15deg); }

/* Media Containers */
.media-container img, .media-container video {
    transition: transform 0.5s ease;
}
.card:hover .media-container img {
    transform: scale(1.05);
}

/* Utilidad para inputs de archivo en modo oscuro */
body.dark-mode input[type="file"] {
    color: var(--text-main);
}
/* =========================================
   ANIMACIÓN DESTACADA PARA CAMPAMENTO (NAVBAR)
   ========================================= */
.nav-link[href="#campamento"] {
    background: linear-gradient(90deg, var(--color-accent), #f9d976, var(--color-accent));
    background-size: 200% auto;
    color: #1a2530 !important; /* Texto oscuro para que resalte en el dorado */
    font-weight: 800;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.6);
    animation: shine-pulse 2.5s infinite;
    padding: 0.4rem 1.2rem !important;
    margin-left: 8px;
    margin-right: 8px;
}

body.dark-mode .nav-link[href="#campamento"] {
    color: #000 !important;
}

.nav-link[href="#campamento"]:hover {
    color: #000 !important;
    transform: translateY(-2px) scale(1.08) !important;
    animation: none; /* Al pasar el ratón se queda fijo y brillando a tope */
    box-shadow: 0 0 20px rgba(197, 160, 89, 1);
}

@keyframes shine-pulse {
    0% {
        background-position: 0% center;
        box-shadow: 0 0 5px rgba(197, 160, 89, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 18px rgba(197, 160, 89, 0.8);
        transform: scale(1.04);
    }
    100% {
        background-position: 200% center;
        box-shadow: 0 0 5px rgba(197, 160, 89, 0.3);
        transform: scale(1);
    }
}