:root {
    --primary-color: #6fc41f;
    --secondary-color: #58a61a;
    --text-color: #e0e0e0;
    --text-color-muted: #b0b0b0;
    --bg-color: #1e1e1e;
    --bg-color-alt: #2a2a2a;
    --card-bg-color: #2c2c2c;
    --border-color: #444;
    --shadow-color: rgba(0,0,0,0.5);
    --hero-overlay-color: rgba(0,0,0,0.7);
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    --theme-color-meta-dark: #1e1e1e; /* CORRECCIÓN: Variable añadida para JS */
    --theme-color-meta-light: #f9f9f9; /* CORRECCIÓN: Variable añadida para JS */
}

body.light-theme {
    --text-color: #333;
    --text-color-muted: #555;
    --bg-color: #f9f9f9;
    --bg-color-alt: #ffffff;
    --card-bg-color: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0,0,0,0.1);
}

body {
    font-family: var(--font-secondary);
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

section h2 {
    text-align: center;
    font-family: var(--font-primary);
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.cta-button {
    background-color: var(--primary-color);
    color: white !important;
    padding: 20px 30px !important;
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 1.1em;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}
.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}
.download-btn-text {
    color: white !important;
    text-decoration: none !important;
}
.download-container {
    width: 1200px;
    max-width: 100% !important;
}

.discord-user {
    height: 45px;
    width: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* =========================================
   HEADER Y NAVEGACIÓN
   ========================================= */
header { background-color: var(--bg-color-alt); padding: 15px 0; box-shadow: 0 2px 5px var(--shadow-color); position: sticky; top: 0; z-index: 1000; transition: background-color 0.3s; }
nav { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto; padding: 0 5%; }
.logo-container { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo-img { height: 40px; width: auto; margin-right: 10px; }
.logo-text { font-family: var(--font-primary); font-size: 1.8em; color: var(--primary-color); }

/* --- Enlaces de Navegación --- */
nav .nav-links { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; }
nav .nav-links li { margin-left: 25px; }
nav .nav-links li a { text-decoration: none; color: var(--text-color); font-weight: 600; padding-bottom: 5px; transition: color 0.3s, border-color 0.3s; white-space: nowrap; }
nav .nav-links li a:hover, nav .nav-links li a.active { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }

/* --- Controles de Acción (Tema, Usuario, Menú Móvil) --- */
.nav-actions { display: flex; align-items: center; gap: 15px; justify-content: center; }
.theme-toggle-button { background: none; border: none; color: var(--text-color); cursor: pointer; font-size: 1.5em; padding: 5px; display: flex; align-items: center; justify-content: center; }
.theme-toggle-button svg { width: 24px; height: 24px; fill: currentColor; }
.mobile-menu-button { display: none; background: none; border: none; color: var(--text-color); font-size: 1.8em; cursor: pointer; }
#auth-container { position: relative; }

/* =========================================
   FOOTER
   ========================================= */
footer { background-color: var(--bg-color-alt); color: var(--text-color-muted); text-align: center; padding: 30px 20px; border-top: 1px solid var(--border-color); transition: background-color 0.3s, border-color 0.3s; }
footer p { margin: 5px 0; }
footer a { color: var(--primary-color); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* =========================================
   CSS INICIO DE SESIÓN 
   ========================================= */

.user-menu-dropdown { display: none; position: absolute; top: calc(100% + 15px); right: 0; background-color: var(--card-bg-color); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 5px 15px var(--shadow-color); min-width: 160px; z-index: 1001; overflow: hidden; padding: 5px 0; }
.user-menu-dropdown.show { display: block; }
.user-menu-dropdown a, .user-menu-dropdown button { display: block; width: 100%; box-sizing: content-box; padding: 12px 20px; text-align: left; background: none; border: none; color: var(--text-color); font-family: var(--font-secondary); font-size: 1em; text-decoration: none; cursor: pointer; transition: background-color 0.2s; }
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover { background-color: var(--primary-color); color: #fff; }
#auth-container {
    position: relative;
    margin-left: 20px;
}
#auth-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
#user-menu {
    right: -55px;
    top: 100%;
    margin-top: 15px;
}
#user-name {
    padding: 0px 20px;
    font-style: italic;
    font-weight: 700;
}

/* =========================================
   PÁGINA PERFIL INICIO DE SESIÓN
   ========================================= */
#hero img.profile-pic {
     max-width: 250px;
     border-radius: 50%;
     border: 5px solid var(--primary-color);
     box-shadow: 0 0 15px var(--primary-color);
}

/* =========================================
   PÁGINA DE INICIO (INDEX.HTML)
   ========================================= */

/* --- Hero Section Modificado --- */
.hero { 
    position: relative; /* Contenedor para posicionamiento absoluto */
    color: #fff; 
    text-align: center;
    overflow: hidden; /* Evita que la imagen se salga */
}
.hero-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Equivalente a background-size: cover */
    z-index: 1; /* Detrás de todo */
}
/* Creamos la capa de sombreado con un pseudoelemento */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--hero-overlay-color);
    z-index: 2; /* Encima de la imagen, pero debajo del contenido */
}
.hero-content-container {
    position: relative; /* Para que se ponga encima del resto */
    z-index: 3; /* Asegura que el contenido esté al frente */
}
/* Ajustamos el padding que antes estaba en .hero, para el contenido */
.hero-content-container .container {
    padding-top: 80px;
    padding-bottom: 80px;
}

.hero h1 { font-family: var(--font-primary); font-size: 3em; margin-bottom: 20px; text-shadow: 2px 2px 4px rgba(0,0,0,0.7); }
.hero p { font-size: 1.2em; margin-bottom: 30px; }

/* --- Resto de la página de inicio --- */
.videos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.video-card { background-color: var(--card-bg-color); border-radius: 8px; box-shadow: 0 4px 10px var(--shadow-color); overflow: hidden; transition: transform 0.3s ease, background-color 0.3s; }
.video-card:hover { transform: translateY(-5px); }
.video-embed-container { position: relative; padding-bottom: 56.25%; height: 0; background-color: #000; }
.video-embed-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-info { padding: 20px; }
.video-info h3 { font-family: var(--font-primary); font-size: 1.3em; margin-top: 0; margin-bottom: 10px; }
#about .container { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; justify-content: center; }
#about img.profile-pic { max-width: 250px; border-radius: 50%; border: 5px solid var(--primary-color); box-shadow: 0 0 15px var(--primary-color); }
#community { background-color: var(--primary-color); }
#community h2, #community p { color: white; text-align: center; }
#community p { font-size: 1.1em; margin-bottom: 30px; }
.social-links { text-align: center; }
.social-links a { display: inline-block; margin: 0 15px; color: white !important; text-decoration: none; }
.social-links svg { width: 40px; height: 40px; fill: currentColor; transition: transform 0.3s ease; }
.social-links a:hover svg { transform: scale(1.2); }
        
/* =========================================
   ESTILOS PARA SUBPÁGINAS
   ========================================= */
.sub-hero { background-color: var(--bg-color-alt); padding: 50px 20px; text-align: center; border-bottom: 1px solid var(--border-color); }
.sub-hero h1 { font-family: var(--font-primary); font-size: 3em; color: var(--primary-color); margin: 0; }
.sub-hero p { font-size: 1.2em; color: var(--text-color-muted); max-width: 600px; margin: 10px auto 0 auto; }

/* --- Novedades --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.news-card { background-color: var(--card-bg-color); border-radius: 8px; box-shadow: 0 4px 10px var(--shadow-color); transition: transform 0.3s ease; display: flex; flex-direction: column; overflow: hidden; }
.news-card:hover { transform: translateY(-5px); }
.news-card img { width: 100%; height: 200px; object-fit: cover; }
.news-card-info { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.news-card-info .news-header h3 { margin: 0 0 5px 0; font-family: var(--font-primary); font-size: 1.6em; }
.news-card-info .news-date { font-size: 0.9em; color: var(--text-color-muted); margin-bottom: 20px; }
.news-card-info p { flex-grow: 1; margin-bottom: 20px; }
.news-card-info a { color: var(--primary-color); }
.read-more { color: var(--primary-color); text-decoration: none; font-weight: bold; margin-top: auto; align-self: flex-start; }
.read-more:hover { text-decoration: underline; }

/* --- Descargas --- */
.downloads-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.download-card { background-color: var(--card-bg-color); border-radius: 8px; box-shadow: 0 4px 10px var(--shadow-color); transition: transform 0.3s ease; display: flex; flex-direction: column; overflow: hidden; }
.download-card:hover { transform: translateY(-5px); }
.download-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.download-info { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.download-info h3 { margin: 0 0 10px 0; font-family: var(--font-primary); font-size: 1.6em; }
.download-info p { color: var(--text-color-muted); font-size: 0.9em; flex-grow: 1; margin-bottom: 15px; }
.file-details { font-size: 0.8em; color: var(--text-color-muted); display: block; margin-bottom: 25px; font-style: italic; }
.download-button { width: 100%; margin-top: auto; text-align: center; }

/* --- Filtros de Descargas --- */
.downloads-filter-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
#searchInput { flex-grow: 1; min-width: 250px; padding: 12px 15px; font-size: 1em; border: 1px solid var(--border-color); border-radius: 5px; background-color: var(--bg-color-alt); color: var(--text-color); outline: none; transition: border-color 0.3s, box-shadow 0.3s; }
#searchInput:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(111, 196, 31, 0.3); }
.tag-filter-container { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag-filter-container span { font-weight: 600; color: var(--text-color-muted); margin-right: 5px; }
.tag-button { padding: 8px 15px; font-family: var(--font-secondary); font-size: 0.9em; font-weight: 600; border: 1px solid var(--border-color); background-color: var(--card-bg-color); color: var(--text-color); border-radius: 20px; cursor: pointer; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.tag-button:hover { background-color: var(--bg-color-alt); border-color: var(--primary-color); }
.tag-button.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }

/* --- Comunidad --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.gallery-item { background-color: var(--card-bg-color); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px var(--shadow-color); transition: transform 0.3s ease; }
.gallery-item:hover { transform: translateY(-5px); }
.gallery-item img { width: 100%; height: 200px; object-fit: cover; display: block; border-bottom: 1px solid var(--border-color); }
.gallery-info { padding: 20px; }
.gallery-info h3 { margin: 0 0 5px 0; font-size: 1.3em; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    /* Ocultar enlaces de texto y mostrar botón de menú */
    nav .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; /* Altura del header */
        left: 0;
        width: 100%;
        background-color: var(--bg-color-alt);
        box-shadow: 0 2px 5px var(--shadow-color);
        padding: 10px 0;
    }
    nav .nav-links.active {
        display: flex; /* Mostrar el menú desplegable */
    }
    nav .nav-links li {
        margin: 10px 0;
        text-align: center;
    }
    .mobile-menu-button {
        display: block; /* Mostrar el botón de hamburguesa */
    }
    /* Ocultar enlaces de texto principales en la barra */
    nav ul.nav-links {
        display: none;
    }
    /* Mostrar menú desplegable cuando se activa con JS */
    nav ul.nav-links.active {
        display: flex;
    }

    .sub-hero h1, .hero h1, section h2 { font-size: 2.2em; }
    #about .container { flex-direction: column; }
    .downloads-filter-controls { flex-direction: column; align-items: stretch; }
}
