/* ========================================
   1. VARIABLES Y ESTILOS GENERALES
   ======================================== */
:root {
    /* Colores Primarios */
    --gold-primary: #C9A55C;
    --gold-dark: #A88A4C;
    --gold-light: #E5C989;
    /* Colores Secundarios */
    --brown-warm: #8C6D3F;
    --bronze: #B39265;
    --amber: #D4B06A;
    /* Colores Neutrales */
    --black-rich: #121212;
    --gray-dark: #1E1E1E;
    --gray-medium: #2D2D2D;
    --gray-light: #B0B0B0;
    --white: #FFFFFF;
    /* Mapeo a usos comunes */
    --color-background: var(--black-rich);
    --color-surface: var(--gray-dark);
    --color-text-primary: var(--white);
    --color-text-secondary: var(--gray-light);
    --color-accent: var(--gold-primary);
    --color-accent-hover: var(--gold-light);
    --color-border: var(--gray-medium);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('../images/bg_leon.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   2. BARRA DE NAVEGACIÓN
   ======================================== */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(201, 165, 92, 0.1);
    transition: padding 0.3s ease, background-color 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    background-color: rgba(18, 18, 18, 0.95);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.logo span .accent-color {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
    font-size: 1rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-accent-hover);
}

.nav-links a:hover::after {
    width: 100%;
}

.logout-link {
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background-color: var(--gold-primary);
    color: var(--black-rich);
}

/* ========================================
   DROPDOWN MENUS (Desktop)
   ======================================== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-arrow {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(10px);
    min-width: 220px;
    border-radius: 8px;
    padding: 10px 0;
    margin-top: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(201, 165, 92, 0.2);
    z-index: 1000;
    list-style: none;
}

/* CRITICAL FIX: Bridge the gap between toggle and menu */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
    z-index: 999;
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: rgba(201, 165, 92, 0.1);
    border-left-color: var(--color-accent);
    color: var(--color-accent);
    padding-left: 25px;
}

.dropdown-menu a.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-menu a.coming-soon:hover {
    background: transparent;
    border-left-color: transparent;
    padding-left: 20px;
}

.badge-small {
    font-size: 0.65em;
    background: rgba(201, 165, 92, 0.2);
    color: var(--color-accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ========================================
   MOBILE DROPDOWNS
   ======================================== */
.mobile-dropdown {
    width: 100%;
    text-align: center;
}

.mobile-dropdown-title {
    width: 100%;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: 15px 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.mobile-dropdown-title span {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.mobile-dropdown.active .mobile-dropdown-title span {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.mobile-dropdown.active .mobile-dropdown-content {
    max-height: 500px;
}

.mobile-dropdown-content a {
    display: block;
    padding: 12px 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.mobile-dropdown-content a:hover {
    color: var(--color-accent);
}

.mobile-lang-switcher {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
}

.mobile-lang-switcher .lang-link {
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.mobile-lang-switcher .lang-link.active {
    background: rgba(201, 165, 92, 0.2);
}

/* ========================================
   SEARCH ICON & LANGUAGE SWITCHER (Desktop)
   ======================================== */
.search-icon a {
    font-size: 1.2em;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.search-icon a:hover {
    background: rgba(201, 165, 92, 0.1);
}

.language-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.language-switcher .lang-link {
    padding: 6px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.language-switcher .lang-link:hover {
    opacity: 1;
    background: rgba(201, 165, 92, 0.1);
}

.language-switcher .lang-link.active {
    opacity: 1;
    background: rgba(201, 165, 92, 0.2);
}

/* ========================================
   SEARCH MODAL
   ======================================== */
.search-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.search-modal-content {
    background-color: var(--color-surface);
    margin: 15% auto;
    padding: 40px;
    border: 1px solid rgba(201, 165, 92, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: fadeInDown 0.3s ease;
}

.search-close {
    color: var(--color-text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-close:hover {
    color: var(--color-accent);
}

.search-modal-content h2 {
    margin-bottom: 25px;
    color: var(--color-accent);
}

.search-modal-content input {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 1px solid rgba(201, 165, 92, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border-radius: 8px;
    margin-bottom: 20px;
}

.search-modal-content input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* --- Estilos para Menú de Hamburguesa --- */
.hamburger {
    display: none; background: none; border: none; cursor: pointer; padding: 10px; z-index: 1001;
}
.hamburger span {
    display: block; width: 25px; height: 3px; background-color: var(--color-text-primary); margin: 5px 0; transition: all 0.3s ease-in-out;
}
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.mobile-nav {
    position: fixed; top: 0; left: 100%; width: 100%; height: 100vh; background-color: var(--color-background); z-index: 1000;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}
.mobile-nav.active { left: 0; }
.mobile-nav a { color: var(--color-text-primary); text-decoration: none; font-size: 1rem; padding: 15px 0; font-weight: 600; transition: color 0.3s ease; }
.mobile-nav a:hover { color: var(--color-accent); }
.mobile-nav .logout-link { margin-top: 20px; font-size: 1rem; }


/* ========================================
   3. SECCIONES Y TÍTULOS
   ======================================== */
.page-section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 3px;
    bottom: -15px;
    left: 20%;
    background-color: var(--color-accent);
}

/* ========================================
   4. SECCIÓN HERO (INICIO)
   ======================================== */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 80px;
    flex-grow: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero h1 span {
    color: var(--color-accent);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 40px;
    color: var(--color-text-secondary);
}

/* ========================================
   5. TARJETAS (CARDS)
   ======================================== */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.card {
    background-color: var(--color-surface);
    border-radius: 10px;
    padding: 30px;
    width: calc(33.333% - 20px);
    transition: all 0.3s ease;
    border: 1px solid rgba(201, 165, 92, 0.1);
    position: relative;
    overflow: hidden;
}

.two-cards .card {
     width: calc(50% - 15px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(201, 165, 92, 0.3);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon img {
    height: 60px;
    width: auto;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--color-accent);
}

.card p {
    color: var(--color-text-secondary);
    font-size: 1rem;
}

/* ========================================
   6. BOTONES
   ======================================== */
.cta-button, .demo-button {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-background);
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--color-accent);
}

.demo-button {
    padding: 12px 25px;
    margin-top: 20px;
}

.cta-button:hover, .demo-button:hover {
    background-color: transparent;
    color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(201, 165, 92, 0.2);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-button.secondary {
    background-color: transparent;
    color: var(--color-accent);
}

.cta-button.secondary:hover {
    background-color: var(--color-accent);
    color: var(--color-background);
}

/* ========================================
   7. SECCIÓN DE CONTACTO Y FOOTER
   ======================================== */
#contacto {
    text-align: center;
}

#contacto h2 {
    font-size: 2.5rem;
}

.contact-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: -40px auto 40px;
}

.contact-subtitle a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-subtitle a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    gap: 20px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(201, 165, 92, 0.3);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form .cta-button {
    width: fit-content;
    align-self: center;
    cursor: pointer;
}

footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(201, 165, 92, 0.1);
    width: 100%;
}

footer p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   8. ESTILOS PARA PÁGINAS DE DEMO
   ======================================== */
.demo-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 40px;
}

.demo-subtitle {
    color: var(--color-text-secondary);
}

.chat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex-grow: 1;
    margin-top: 20px;
    width: 100%;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    background-color: rgba(30, 30, 30, 0.7);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(201, 165, 92, 0.1);
}

.chat-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--gold-light);
}

.chat-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    width: 90%; /* Para centrarlo bien */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

textarea, .chat-input-area input {
    width: 100%;
    flex-grow: 1;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 15px;
    color: var(--color-text-primary);
    font-size: 1rem;
    resize: none;
}

textarea:focus, .chat-input-area input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(201, 165, 92, 0.3);
}

#chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-input-area {
    display: flex;
    margin-top: 15px;
    gap: 10px;
}

.chat-input-area .demo-button {
    margin-top: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 85%;
    width: fit-content;
}

.ai-message {
    background-color: var(--gray-medium);
    color: var(--color-text-primary);
    border-bottom-left-radius: 0;
}

.user-message {
    background-color: var(--gold-primary);
    color: var(--black-rich);
    border-bottom-right-radius: 0;
}

.user-message-container { display: flex; justify-content: flex-end; }
.ai-message-container { display: flex; justify-content: flex-start; }


/* ========================================
   9. ESTILOS PARA LEARNING HUB
   ======================================== */
.course-card {
    background-color: var(--color-surface);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    display: flex;
    overflow: hidden;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.course-image {
    flex: 0 0 40%;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--black-rich);
}

.course-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.course-content {
    padding: 40px;
    flex: 1;
}

.course-content h3 {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.course-description {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 30px;
}

.course-details {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.course-details span {
    background-color: var(--color-background);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.course-content h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--color-text-primary);
}

.syllabus-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 40px;
}

.syllabus-list li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
    color: var(--color-text-secondary);
}

.syllabus-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
    font-weight: bold;
}

.nav-links a.active {
    color: var(--color-accent);
}
.nav-links a.active::after {
    width: 100%;
}

.three-cards .card {
    width: calc(33.333% - 20px);
}

/* ========================================
   10. RESPONSIVE DESIGN
   ======================================== */
@media screen and (max-width: 992px) {
    .card, .three-cards .card {
        width: calc(50% - 15px);
    }
    .course-card {
        flex-direction: column;
    }
}

@media screen and (max-width: 768px) {
    .desktop-menu { display: none; }
    .hamburger { display: block; }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; padding: 0 20px; }
    .section-title h2 { font-size: 2rem; }
    .chat-grid { grid-template-columns: 1fr; height: auto; }
    .chat-panel { min-height: 40vh; }
    .card, .two-cards .card, .three-cards .card {
        width: 100%;
    }
    .form-group { flex-direction: column;}
}

/* ========================================
   11. ESTILOS PARA DEMO DE PRONÓSTICO
   ======================================== */
.forecast-container {
    background-color: var(--color-surface);
    border-radius: 10px;
    padding: 40px;
    border: 1px solid var(--color-border);
    max-width: 1000px;
    margin: 0 auto;
}

.upload-panel {
    text-align: center;
    margin-bottom: 40px;
}

.file-label {
    display: block;
    border: 2px dashed var(--color-border);
    border-radius: 10px;
    padding: 60px 20px;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: var(--color-accent);
    background-color: rgba(201, 165, 92, 0.05);
}

.results-panel {
    border-top: 1px solid var(--color-border);
    padding-top: 40px;
    text-align: center;
}

.prediction-box {
    margin-bottom: 30px;
}

.prediction-box h4 {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.prediction-box p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.chart-box {
    margin-top: 20px;
}

.chart-box img {
    max-width: 100%;
    border-radius: 5px;
    background-color: var(--dark-bg-2);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

/* ========================================
   12. ESTILOS TABLA PRONÓSTICO
   ======================================== */
.forecast-table-container {
    margin-top: 40px;
    text-align: center;
}

.forecast-table-container h4 {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.forecast-table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
    background-color: var(--dark-bg-2);
    border-radius: 5px;
    overflow: hidden;
}

.forecast-table th, .forecast-table td {
    padding: 15px;
    text-align: left;
}

.forecast-table thead {
    background-color: var(--color-surface);
}

.forecast-table th {
    color: var(--color-accent);
    font-weight: 600;
}

.forecast-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.forecast-table tbody tr:last-child {
    border-bottom: none;
}

.forecast-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ========================================
   13. ESTILOS PARA DISCLAIMER Y MÉTRICAS
   ======================================== */
.disclaimer-box {
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    border-left: 4px solid var(--gold-primary);
    padding: 16px 20px;
    margin: 20px auto 40px auto;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 1200px;
    width: 90%;
}

.disclaimer-box strong {
    color: var(--gold-primary);
    font-weight: 600;
}

.model-quality {
    background: rgba(201, 165, 92, 0.1);
    border: 1px solid rgba(201, 165, 92, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 20px 0;
    display: block;
}

.model-quality h5 {
    color: var(--gold-primary);
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.quality-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.metric-item {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.metric-label {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.1rem;
    color: var(--white);
    font-weight: 600;
}

.metric-good { 
    color: #4CAF50 !important; 
}

.metric-warning { 
    color: #FFC107 !important; 
}

.metric-poor { 
    color: #F44336 !important; 
}

/* Estilos para tabla con incertidumbre */
.forecast-table th:last-child,
.forecast-table td.range-column {
    text-align: center;
}

.range-column {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.uncertainty-badge {
    display: inline-block;
    background-color: rgba(201, 165, 92, 0.2);
    color: var(--gold-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 8px;
    font-weight: 600;
}

.table-note {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 15px;
    text-align: center;
    font-style: italic;
}

@media screen and (max-width: 768px) {
    .forecast-table {
        font-size: 0.85rem;
    }
    
    .uncertainty-badge {
        display: block;
        margin: 5px 0 0 0;
    }
}

/* ========================================
   14. PÁGINAS DE ERROR (404/500)
   ======================================== */

.error-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Usamos 100vh para que ocupe toda la altura de la pantalla */
    min-height: 100vh;
    padding: 40px 20px;
}

.error-page-container h1 {
    font-size: 8rem;
    font-weight: 700;
    /* Reutilizamos tus variables de color */
    color: var(--gold-primary); 
    line-height: 1;
    margin-bottom: 10px;
}

.error-page-container h2 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 20px;
}

.error-page-container p {
    color: var(--gray-light);
    margin-bottom: 40px;
    max-width: 500px;
}

/* Esta regla asegura que el botón no tenga 
  subrayado si es una etiqueta <a>,
  aunque tu clase .cta-button probablemente ya lo hace.
*/
.error-page-container .cta-button {
    text-decoration: none;
}

/* ========================================
   15. NUEVOS ESTILOS DE CONTENIDO (Quiénes Somos, Casos Éxito)
   ======================================== */

/* Estilos para Hero */
.hero .button-group {
    margin-top: 40px; /* Añade espacio sobre los botones */
}

/* Subtítulo general para secciones */
.section-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    max-width: 800px;
    margin: -40px auto 40px;
    text-align: center;
    line-height: 1.7;
}

/* Estilos para "Quiénes Somos" */
.about-grid {
    display: grid;
    /* Una columna más angosta para la foto, dos para el texto */
    grid-template-columns: 1fr 2fr; 
    gap: 50px;
    align-items: flex-start; /* Alinea arriba */
    margin-top: 40px;
}

.about-image img {
    width: 100%;
    max-width: 350px; /* Tamaño máximo para la foto */
    border-radius: 10px;
    border: 2px solid var(--color-border);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.about-text h3 {
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-top: 20px; /* Espacio entre "Socio" y "Compromiso" */
    margin-bottom: 10px;
}

.about-text h3:first-child {
    margin-top: 0; /* Sin margen superior para el primer h3 */
}

.about-text p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* Estilos para "Casos de Éxito" */
.card .case-study-label {
    font-weight: 700;
    color: var(--color-accent-hover);
}
.card p + p {
    margin-top: 15px; /* Añade espacio entre párrafos en las tarjetas */
}


/* ========================================
   16. AJUSTES RESPONSIVE (para nuevas secciones)
   ======================================== */

@media screen and (max-width: 768px) {
    /* Apila la cuadrícula de "Quiénes Somos" en móviles */
    .about-grid {
        grid-template-columns: 1fr; /* Una sola columna */
        text-align: center;
    }

    .about-image {
        margin-bottom: 30px;
    }

    .about-image img {
        margin: 0 auto; /* Centra la imagen */
        max-width: 250px; /* Más pequeña en móvil */
    }

    .section-subtitle {
        font-size: 1rem;
        margin-top: -30px;
    }
}

/* ========================================
   17. ESTILOS PARA EL BLOG
   ======================================== */

/* Contenedor angosto para posts */
.container-narrow {
    max-width: 800px;
}

/* Estilos para el contenido del post (de RichText) */
.post-content {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content h2 {
    font-size: 2rem;
    color: var(--color-accent-hover);
    margin-top: 2.5em;
    margin-bottom: 1em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}

.post-content h3 {
    font-size: 1.7rem;
    color: var(--color-accent);
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.post-content li {
    margin-bottom: 0.5em;
}

.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: var(--color-accent-hover);
}

.post-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.5em;
    margin: 2em 0;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--color-text-primary);
}

.post-content code {
    background-color: var(--color-surface);
    color: var(--color-accent-light);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
}

.post-content pre {
    background-color: var(--color-surface);
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5em;
}

.post-content pre code {
    padding: 0;
    background: none;
}

/* ========================================
   18. PAGINATION STYLES (Revised)
   ======================================== */

.pagination-nav {
    display: flex;
    /* --- Changed: Center the items --- */
    justify-content: center; 
    align-items: center;
    margin-top: 80px; /* Increased space above */
    padding-top: 30px; 
    border-top: 1px solid var(--color-border); 
    gap: 25px; /* Increased space between items */
    flex-wrap: wrap; 
}

/* Style for the "Pagina X de Y" text */
.pagination-nav span:not(.cta-button) { 
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-align: center; 
}

/* General styles for pagination buttons */
.pagination-nav .cta-button {
    /* --- Changed: Reduced size --- */
    padding: 8px 16px; 
    font-size: 0.85rem; 
    text-decoration: none; 
    white-space: nowrap; 
}

/* Specific style for the disabled state (span) */
.pagination-nav span.cta-button {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--color-surface); 
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

/* Hover effect ONLY for active links (a tags) */
.pagination-nav a.cta-button:hover {
    background-color: transparent;
    color: var(--color-accent);
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(201, 165, 92, 0.15);
}

/* Responsive adjustments still apply */
@media screen and (max-width: 500px) {
    .pagination-nav {
        gap: 15px; /* Reduce gap slightly */
    }
    .pagination-nav span:not(.cta-button) {
        order: -1; 
        width: 100%; 
        margin-bottom: 15px; 
    }
}


.language-switcher {
    display: flex; /* Alinea las banderas horizontalmente */
    align-items: center; /* Centra verticalmente */
    gap: 10px; /* Espacio entre banderas */
    margin-left: auto; /* <-- ESTA ES LA CLAVE: Empuja a la derecha */
}

.language-switcher img {
    height: 20px; /* Ajusta el tamaño de las banderas */
    width: auto;
    display: block; /* Evita espacio extra debajo */
}

/* ============================================
   NAVBAR DROPDOWN STYLES
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 220px;
    padding: 8px 0;
    margin-top: 10px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.dropdown-menu a:hover {
    background: var(--color-accent);
    color: white;
    padding-left: 25px;
}

.dropdown-menu a.active {
    background: rgba(255, 68, 0, 0.1);
    color: var(--color-accent);
    border-left: 3px solid var(--color-accent);
}

.dropdown-menu a.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.dropdown-menu a.coming-soon:hover {
    background: transparent;
    padding-left: 20px;
}

.badge {
    font-size: 0.7em;
    background: var(--color-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.badge-small {
    font-size: 0.65em;
    background: var(--color-accent);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 5px;
}

/* Search Icon */
.search-icon a {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.search-icon a:hover {
    transform: scale(1.2);
}

/* ============================================
   MOBILE DROPDOWN STYLES
   ============================================ */

.mobile-dropdown {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-dropdown-title {
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.mobile-dropdown-title:hover {
    background: rgba(255, 68, 0, 0.1);
}

.mobile-dropdown-title span {
    transition: transform 0.3s ease;
}

.mobile-dropdown.active .mobile-dropdown-title span {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-dropdown.active .mobile-dropdown-content {
    max-height: 300px;
}

.mobile-dropdown-content a {
    display: block;
    padding: 12px 20px 12px 40px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mobile-dropdown-content a:hover {
    background: rgba(255, 68, 0, 0.1);
    color: var(--color-accent);
    padding-left: 45px;
}

.mobile-dropdown-content a.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   SEARCH MODAL
   ============================================ */

.search-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal-content {
    background: var(--color-bg-primary);
    margin: 10% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-close {
    color: var(--color-text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-close:hover,
.search-close:focus {
    color: var(--color-accent);
}

.search-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--color-accent);
}

.search-modal-content form {
    display: flex;
    gap: 10px;
}

.search-modal-content input[type="search"] {
    flex: 1;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    font-family: 'Montserrat', sans-serif;
}

.search-modal-content input[type="search"]:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .search-modal-content {
        width: 95%;
        padding: 30px 20px;
        margin: 20% auto;
    }
    
    .search-modal-content form {
        flex-direction: column;
    }
}

/* ============================================
   PÁGINAS LEGALES (Privacy Policy & Terms)
   ============================================ */

.legal-page {
    min-height: 100vh;
}

.legal-page h1 {
    color: var(--color-accent);
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.last-updated {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.legal-content {
    line-height: 1.8;
    color: var(--color-text-primary);
}

.legal-content h2 {
    color: var(--color-text-primary);
    font-size: 1.8rem;
    margin-top: 50px;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
}

.legal-content h3 {
    color: var(--color-text-primary);
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.legal-content p {
    margin-bottom: 20px;
    font-size: 1rem;
}

.legal-content ul {
    margin: 20px 0;
    padding-left: 40px;
}

.legal-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.legal-content strong {
    color: var(--color-accent);
    font-weight: 600;
}

.legal-content a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.legal-content a:hover {
    border-bottom: 1px solid var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
    .legal-page h1 {
        font-size: 2rem;
    }
    
    .legal-content h2 {
        font-size: 1.5rem;
    }
    
    .legal-content h3 {
        font-size: 1.2rem;
    }
    
    .legal-content ul {
        padding-left: 25px;
    }
}
/* ============================================
   FOOTER RICO
   ============================================ */

.footer-rich {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--color-text-secondary);
    padding: 40px 0 0;
    margin-top: 100px;
    border-top: 3px solid var(--color-accent);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer Brand Column */
.footer-brand {
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    text-decoration: none;
}

.footer-logo img {
    width: 35px;
    height: 35px;
}

.footer-logo span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.footer-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 15px;
    color: var(--color-text-secondary);
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-3px);
}

.footer-social a svg {
    width: 16px;
    height: 16px;
}

/* Footer Columns */
.footer-column h4 {
    color: var(--color-text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--color-accent);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

.footer-links a.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

.footer-links a.coming-soon:hover {
    padding-left: 0;
    color: var(--color-text-secondary);
}

/* Footer Contact */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.footer-contact svg {
    flex-shrink: 0;
    opacity: 0.7;
    width: 16px;
    height: 16px;
}

.footer-contact a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: var(--color-accent);
}

/* Footer Languages */
.footer-languages {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    margin-top: 15px;
}

.footer-languages strong {
    color: var(--color-text-primary);
    font-size: 0.8rem;
}

.footer-languages a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.8rem;
}

.footer-languages a:hover {
    color: var(--color-accent);
}

.footer-languages .current-lang {
    color: var(--color-accent);
    font-weight: 600;
}

.footer-languages .separator {
    color: rgba(255, 255, 255, 0.3);
}

/* Footer Bottom */
.footer-bottom {
    padding: 20px 0;
}

.footer-legal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.8rem;
}

.footer-legal p {
    margin: 0;
    color: var(--color-text-secondary);
}

.footer-legal-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-legal-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.8rem;
}

.footer-legal-links a:hover {
    color: var(--color-accent);
}

.footer-legal-links .separator {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVE FOOTER
   ============================================ */

@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
    
    .footer-brand {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .footer-rich {
        padding: 30px 0 0;
        margin-top: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-legal {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal-links {
        justify-content: center;
    }
}
/* ============================================
   PÁGINAS LEGALES (Privacy Policy & Terms)
   ============================================ */

.legal-page {
    min-height: 100vh;
}

.legal-page h1 {
    color: var(--color-accent);
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.last-updated {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.legal-content {
    line-height: 1.8;
    color: var(--color-text-primary);
}

.legal-content h2 {
    color: var(--color-text-primary);
    font-size: 1.8rem;
    margin-top: 50px;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
}

.legal-content h3 {
    color: var(--color-text-primary);
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.legal-content p {
    margin-bottom: 20px;
    font-size: 1rem;
}

.legal-content ul {
    margin: 20px 0;
    padding-left: 40px;
}

.legal-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.legal-content strong {
    color: var(--color-accent);
    font-weight: 600;
}

.legal-content a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.legal-content a:hover {
    border-bottom: 1px solid var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
    .legal-page h1 {
        font-size: 2rem;
    }
    
    .legal-content h2 {
        font-size: 1.5rem;
    }
    
    .legal-content h3 {
        font-size: 1.2rem;
    }
    
    .legal-content ul {
        padding-left: 25px;
    }
}
