/* ==========================================================================
   CHILE RP - REVISIÓN DE ESTILO DEFINITIVA v7.0
   - Estilos globales para todo el portal.
   - Incluye el nuevo diseño para la página de inicio (Login).
   ========================================================================== */

/* --- 1. FUENTES Y VARIABLES GLOBALES --- */
@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;700&family=Roboto:wght@400;500;700&display=swap');


:root {
    --font-display: 'Teko', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --primary-accent: #D4AF37;
    --primary-accent-hover: #E6C566;
    --primary-accent-text: #111827;
    --dark-bg: #0D1117;
    --dark-surface: #161B22;
    --border-color: #30363D;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --main-border-radius: 8px;
    --transition-speed: 0.3s;
}

/* --- 2. RESET Y ESTRUCTURA BASE --- */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* Para la página de login, mantenemos el body como layout vertical normal */
body:has(.login-container) {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 100vh;
    overflow-y: auto;   /* 🔹 en vez de overflow: hidden */
}

/* Centrado del contenido principal cuando se muestra el login */
#main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;   /* apila main + footer(s) */
    justify-content: center;  /* centra verticalmente el main */
    align-items: center;      /* centra horizontalmente el main */
}

@media (max-height: 700px) {
    #main-content {
        justify-content: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}



main { flex-grow: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
#video-bg {
    position: fixed; right: 0; bottom: 0;
    min-width: 100%; min-height: 100%;
    z-index: -2; /* Asegura que esté detrás de todo */
    object-fit: cover;
    filter: brightness(0.15);
}

/* --- 3. BARRA DE NAVEGACIÓN (Para otras páginas) --- */
.main-navbar {
    background-color: rgba(13, 17, 23, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: sticky; top: 0; z-index: 1000;
}
.navbar-content { display: flex; justify-content: space-between; align-items: center; }
.navbar-brand { display: flex; align-items: center; gap: 15px; text-decoration: none; }
.navbar-brand:hover { text-decoration: none; }
.navbar-brand img { height: 40px; transition: transform var(--transition-speed) ease; }
.navbar-brand:hover img { transform: rotate(-5deg); }
.navbar-brand span { font-family: var(--font-display); font-size: 1.8rem; color: var(--text-primary); letter-spacing: 1px; }

.navbar-links a {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 8px 12px;
    border-radius: var(--main-border-radius);
    text-decoration: none;
    transition: color var(--transition-speed), background-color var(--transition-speed);
}
.navbar-links a:hover {
    color: var(--text-primary);
    background-color: var(--dark-surface);
}

/* --- 4. SECCIÓN HERO (USADA EN PÁGINAS ANTIGUAS) --- */
.hero-section { min-height: 70vh; display: flex; justify-content: center; align-items: center; text-align: center; padding: 4rem 1rem; }
.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 7rem);
    letter-spacing: 3px;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}
.hero-content p { color: var(--text-secondary); max-width: 600px; margin: 1rem auto 2rem; font-size: 1.2rem; line-height: 1.7; }

/* Estilo base para los botones de login (CORREGIDO) */
.btn-cta {
    font-family: var(--font-body);
    font-size: 1rem; /* <-- Tamaño de fuente unificado y balanceado */
    padding: 13px 20px; /* <-- Espaciado interno consistente para ambos botones */
    border-radius: var(--main-border-radius);
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center; /* <-- Esto asegura el centrado del texto y el ícono */
    font-weight: 700;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-cta:hover { transform: scale(1.05); box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3); text-decoration: none; }

.btn-expediente {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary) !important;
    box-shadow: none;
}

.btn-expediente:hover {
    background-color: var(--dark-surface);
    border-color: var(--primary-accent);
    color: var(--text-primary) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
}

/* Evitar que se ponga morado al estar visitado */
.btn-expediente:visited {
    color: var(--text-secondary) !important;
}


/* --- 5. SECCIONES DE CONTENIDO (STATS Y GUÍAS) --- */
.content-section { padding: 80px 1rem; }
.section-title { font-family: var(--font-display); font-size: 3.5rem; text-align: center; margin-bottom: 50px; color: var(--text-primary); }
.stats-grid, .guides-grid { display: grid; gap: 2rem; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.guides-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat-card, .guide-card { background: var(--dark-surface); border: 1px solid var(--border-color); border-radius: var(--main-border-radius); padding: 2.5rem; text-align: center; transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease; }
.stat-card:hover, .guide-card:hover { transform: translateY(-5px); border-color: var(--primary-accent); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); }
.stat-card i, .guide-card i { font-size: 3rem; color: var(--primary-accent); margin-bottom: 1.5rem; }
.stat-number { font-family: var(--font-display); font-size: 4rem; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 1rem; color: var(--text-secondary); }
.guide-card h4 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 0.5rem; }
.guide-card p { color: var(--text-secondary); line-height: 1.5; margin-bottom: 1.5rem; }
.guide-link { color: var(--primary-accent); text-decoration: none; font-weight: 700; }
.guide-link:hover { text-decoration: underline; }

/* --- 6. FOOTER --- */
.footer {
    margin-top: auto;
}
/* No mostrar footer global en la pantalla de login */
body:has(.login-container) .footer {
    display: none;
}
.footer { background-color: var(--dark-bg); border-top: 1px solid var(--border-color); padding: 50px 1rem; color: var(--text-secondary); }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2.5rem; }
.footer-column h5 { font-family: var(--font-display); font-size: 1.5rem; color: var(--text-primary); margin-bottom: 1rem; }
.footer-column ul { list-style: none; padding: 0; }
.footer-column li { margin-bottom: 0.5rem; }
.footer-column a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s ease; }
.footer-column a:hover { color: var(--primary-accent); }
.social-icons { display: flex; gap: 1.5rem; }
.social-icons a { font-size: 1.5rem; color: var(--text-secondary); }
.social-icons a:hover { color: var(--primary-accent); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 20px; margin-top: 40px; text-align: center; font-size: 0.9rem; }

/* --- 7. ESTILOS PARA MODALES --- */
/* (Se conservan los estilos de .modal-content, .modal-header, etc., para Bootstrap y modales personalizados) */
.modal-content { background-color: var(--dark-surface); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--main-border-radius); }
.modal-header { border-bottom: 1px solid var(--border-color); }
.modal-title { font-family: var(--font-display); font-size: 2rem; color: var(--primary-accent); }
.modal-footer { border-top: 1px solid var(--border-color); }
.close { color: var(--text-primary); text-shadow: none; opacity: 0.8; }
.close:hover { color: white; opacity: 1; }
.modal-body label { font-weight: 500; color: var(--text-secondary); }
.modal-body .form-control { background-color: var(--dark-bg); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 6px; }
.modal-body .form-control:focus { background-color: var(--dark-bg); color: var(--text-primary); border-color: var(--primary-accent); box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25); }
.modal-footer .btn-primary { background-color: var(--primary-accent); color: var(--primary-accent-text); border-color: var(--primary-accent); }
.modal-footer .btn-primary:hover { background-color: var(--primary-accent-hover); border-color: var(--primary-accent-hover); }
.modal-footer .btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-color); }
.modal-footer .btn-outline-secondary:hover { background-color: var(--dark-surface); color: var(--text-primary); border-color: var(--text-secondary); }

/* --- 8. RESPONSIVE Y MENÚ MÓVIL --- */
.menu-toggle { display: none; font-size: 1.5rem; color: var(--text-primary); cursor: pointer; background: none; border: none; }
@media (max-width: 768px) {
    .navbar-links { display: none; position: fixed; top: 67px; right: 0; width: 100%; height: calc(100% - 67px); background-color: var(--dark-bg); flex-direction: column; align-items: center; padding-top: 2rem; gap: 1.5rem; }
    .navbar-links.active { display: flex; }
    .menu-toggle { display: block; }
}

/* ==========================================================================
   ! ! ! SISTEMA DE MODALES GLOBAL (CORRECCIÓN DEFINITIVA) ! ! !
   ========================================================================== */

/* 1. El Overlay (el fondo oscuro y borroso) */
.modal-overlay {
    position: fixed; /* <-- La regla más importante: lo saca del flujo normal */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 17, 23, 0.8); /* Fondo oscuro semi-transparente */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* <-- Se asegura de que esté por encima de TODO */
    padding: 1rem;
    animation: fadeIn 0.3s ease-out forwards;
}

/* 2. El Contenido del Modal (la caja blanca/oscura) */
.modal-content {
    background-color: var(--dark-surface);
    padding: 2rem;
    border-radius: var(--main-border-radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px; /* Ancho máximo para el modal */
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    animation: scaleUp 0.3s ease-out forwards;
}

/* 3. La Clase para Ocultar (la más crucial) */
.modal-overlay.hidden {
    display: none !important; /* <-- Oculta el modal por completo cuando tiene esta clase */
}


/* 4. Estilos internos para los modales (títulos, formularios, etc.) */
.modal-content h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-accent);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.modal-content .form-group {
    margin-bottom: 1.25rem;
}

.modal-content label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}
.modal-content input:focus, .modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
/* Reutilizamos las clases de botones que ya definimos */
.modal-actions .btn-primary { /* Tu botón de confirmar */
    background-color: var(--primary-accent);
    color: var(--primary-accent-text);
    border-color: var(--primary-accent);
}
.modal-actions .btn-secondary { /* Tu botón de cancelar */
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}


/* 5. Animaciones de Entrada */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- 9. AJUSTE DE NAVBAR: SALDO CENTRADO --- */
.user-balance-capsule { background-color: var(--dark-surface); color: var(--text-primary); padding: 8px 16px; border-radius: 999px; font-weight: 600; border: 1px solid var(--border-color); white-space: nowrap; }
@media (min-width: 992px) {
    .navbar-content { position: relative; }
    .user-balance-capsule { position: absolute; left: 50%; transform: translateX(-50%); }
}

/* ==========================================================================
   ! ! ! NUEVOS ESTILOS PARA LA PÁGINA DE INICIO (LOGIN) ! ! !
   ========================================================================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
}

/* Contenedor que agrupa la publicidad y el panel de login */
.login-wrapper {
    display: flex;
    flex-direction: column;   /* banner arriba, panel abajo */
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 900px;         /* limita el ancho total */
    padding: 1rem;
}

.login-panel {
    max-width: 450px;
    width: 100%;
    padding: 2.5rem;
    background-color: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.login-panel {
    max-height: 90vh;
    overflow-y: auto;
}

.login-logo {
    width: 100px;
    margin-bottom: 1rem;
}

.login-panel h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    margin: 0 0 0.5rem 0;
    color: white;
}

.login-panel p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem; /* Más espacio */
    font-size: 1.1rem;
}

#cta-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center; /* <--- AÑADE ESTA LÍNEA */
}

/* Estilo base para los botones de login (CORREGIDO Y MEJORADO) */
.btn-cta {
    font-family: var(--font-body);
    font-size: 1rem; /* Tamaño de fuente unificado */
    padding: 12px 20px; /* Espaciado interno consistente */
    border-radius: var(--main-border-radius);
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    gap: 12px; /* ✅ Añade un espacio consistente entre el ícono y el texto */
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

/* ✅ Regla unificada y corregida para los íconos */
.btn-cta i, .btn-cta svg {
    font-size: 1.5rem; /* Para el ícono de fuente (Discord) */
    width: 1.5rem;     /* Para el ícono SVG (Roblox) */
    height: 1.5rem;    /* Para el ícono SVG (Roblox) */
    flex-shrink: 0;
}

/* Colores específicos */
.btn-cta.discord {
    background-color: #5865F2;
    color: white !important;
}
.btn-cta.discord:hover {
    background-color: #4f5bda;
}

.btn-cta.roblox {
    background-color: #232529; /* Color más oficial de Roblox */
    color: white !important;
}
.btn-cta.roblox:hover {
    background-color: #3a3d42;
}

.footer-music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}
.btn-music {
    background-color: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.btn-music:hover {
    background-color: var(--dark-surface);
    color: white;
}
.btn-music i {
    margin-right: 8px;
}

/* Clase para ocultar elementos */
.hidden {
    display: none !important;
}

/* ========================================
   ESTILOS DEL SPLASH SCREEN
   ======================================== */

#splash-screen {
    position: fixed; /* Ocupa toda la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #121212; /* Fondo oscuro */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Se asegura de estar por encima de todo */
    transition: opacity 0.8s ease-out; /* Animación de salida */
}

.splash-content {
    text-align: center;
    color: white;
    /* Animación de entrada */
    animation: fadeIn 1.5s ease-in-out;
}

#splash-logo {
    width: 150px;
    margin-bottom: 2rem;
    /* Animación del logo (la vuelta que querías) */
    animation: spin 2s linear; 
}

.splash-content p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 2.5rem;
}

#enter-button {
    background-color: var(--primary-accent); /* Usa tu color principal */
    color: var(--primary-accent-text); /* Usa tu color de texto principal */
    border: none;
    padding: 0.8rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--main-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

#enter-button:hover {
    transform: scale(1.05); /* Efecto al pasar el mouse */
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4); /* Sombra de tu color */
}

/* ========================================
   CLASES DE UTILIDAD (MUY IMPORTANTES)
   ======================================== */

/* Oculta un elemento completamente */
.hidden {
    display: none !important;
}

/* Oculta un elemento pero permite animar su salida */
.fade-out {
    opacity: 0;
    pointer-events: none; /* Evita clics mientras desaparece */
}

/* Muestra un elemento con una animación de entrada */
.fade-in {
    opacity: 1;
    animation: fadeIn 0.8s ease-in;
}

/* ========================================
   ANIMACIONES (Keyframes)
   ======================================== */

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}



/* --- Estilos para los Logins Especiales --- */
.special-logins {
    /* Separación de los botones principales */
    margin-top: 2rem;
    padding-top: 1rem;

    /* Línea sutil para separar */
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    text-align: center;
    width: 100%;
}

.special-logins a {
    color: #a0a0a0; /* Color grisáceo y discreto */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.special-logins a:hover {
    color: #ffffff; /* Se ilumina al pasar el mouse */
}

/* Estilo para el separador "|" */
.special-logins span {
    color: #555;
    font-size: 0.9rem;
}

.special-logins a,
.special-logins a:visited {
    color: #a0a0a0;
}

.ad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0 auto;
    max-width: 100%;
    padding: 0.5rem;
}

.ad-container iframe {
    max-width: 100%;
}

.ad-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

/* Si quieres ocultar el banner en pantallas muy chicas */
@media (max-width: 600px) {
    .ad-home-banner {
        transform: scale(0.9);
    }
}