/*
 * Hoja de Estilos Principal para VivaElMundial.com
 * VERSIÓN 2.3 - DISEÑO FINAL (HERO CON FONDO Y AJUSTES)
 * Autor: angelgrimaldo.com
 */

/* --- FUENTES Y VARIABLES GLOBALES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root {
    --color-dark-primary: #0a101f;
    --color-dark-secondary: #121a2e;
    --color-accent-gold: #fca311;
    --color-accent-blue: #3a86ff;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #a0a0a0;
    --font-primary: 'Inter', sans-serif;
    --container-width: 1200px;
    --border-radius: 12px;
}

/* --- RESETEO Y ESTILOS BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-dark-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- CABECERA --- */
.site-header {
    background-color: rgba(10, 16, 31, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-header .logo h1 { font-size: 1.7rem; font-weight: 900; color: #fff; }
.site-header .logo a { text-decoration: none; }
.site-header .main-nav ul { display: flex; list-style: none; gap: 5px; }
.site-header .main-nav a { color: var(--color-text-secondary); font-weight: 600; padding: 8px 12px; border-radius: 8px; transition: all 0.3s ease; text-decoration: none; }
.site-header .main-nav a:hover { color: #fff; background-color: rgba(255, 255, 255, 0.1); }

/* --- CONTENIDO PRINCIPAL --- */
.site-content { flex-grow: 1; padding: 0; }
.page-section { padding: 40px 0 60px 0; }

/*
==============================================
PÁGINA DE INICIO (HOME)
==============================================
*/

.home-hero {
    position: relative;
    /* --- INICIO: CAMBIO --- Se ha reducido la altura y añadido una imagen de fondo */
    height: 45vh;
    min-height: 350px;
    background-image: 
        linear-gradient(to top, rgba(10, 16, 31, 1) 0%, rgba(10, 16, 31, 0.7) 50%, rgba(10, 16, 31, 0.4) 100%),
        url('https://images.pexels.com/photos/978695/pexels-photo-978695.jpeg');
    background-size: cover;
    background-position: center 30%;
    /* --- FIN: CAMBIO --- */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-text-container { position: relative; z-index: 2; }
.home-hero-title { font-size: clamp(2.8rem, 10vw, 5.5rem); font-weight: 900; color: #fff; text-shadow: 0 0 30px rgba(0,0,0,0.7); }
.home-hero-subtitle { font-size: clamp(1rem, 4vw, 1.4rem); color: var(--color-accent-gold); font-weight: 600; }

/* --- INICIO: CAMBIO --- Se ha ajustado el espaciado del título para acercarlo al Hero */
.home-section-title { text-align: center; font-size: 2.5rem; margin-top: 0; margin-bottom: 40px; }
/* --- FIN: CAMBIO --- */

.home-mundiales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.home-mundial-card {
    aspect-ratio: 3 / 4;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    text-decoration: none;
    color: #fff;
    background-color: var(--color-dark-secondary);
    background-image: var(--bg-image);
    background-size: 80%;
    background-position: center 30%;
    background-repeat: no-repeat;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.home-mundial-card .card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(10, 16, 31, 0.95) 25%, transparent 60%);
    transition: all 0.3s ease;
}
.home-mundial-card .card-content { position: relative; z-index: 2; }
.home-mundial-card .card-year { font-size: 1rem; font-weight: 600; color: var(--color-accent-gold); }
.home-mundial-card .card-country { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }

.home-mundial-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.home-mundial-card:hover .card-overlay { background: linear-gradient(to top, rgba(18, 26, 46, 0.8) 20%, transparent 70%); }

/*
==============================================
PÁGINA INTERNA (DETALLES DEL MUNDIAL)
==============================================
*/

.hero-mundial {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background-color: var(--color-dark-secondary);
}
.hero-mundial::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: var(--bg-logo); background-size: contain; background-position: center; background-repeat: no-repeat; opacity: 0.05; z-index: 1; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle, transparent 40%, var(--color-dark-primary) 90%); z-index: 2; }
.hero-content { position: relative; z-index: 3; }
.hero-content h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); font-weight: 900; text-shadow: 0 0 20px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.2rem; color: var(--color-accent-gold); font-weight: 600; }

.mundial-stats-container { max-width: 1100px; margin: -80px auto 40px auto; position: relative; z-index: 5; padding: 0 20px; display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 992px) { .mundial-stats-container { grid-template-columns: 2fr 1fr; } }

.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 20px; color: #fff; border-left: 4px solid var(--color-accent-gold); padding-left: 15px; }

.cards-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

.stat-card { background: linear-gradient(145deg, var(--color-dark-secondary), #1a243d); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--border-radius); padding: 25px; transition: all 0.3s ease; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-color: var(--color-accent-gold); }
.stat-card .card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.stat-card .card-header .icon { font-size: 2rem; }
.stat-card .card-header h3 { font-size: 1.2rem; color: var(--color-text-secondary); font-weight: 600; }
.stat-card .card-body { text-align: center; }
.stat-card.champion .card-body .team-name, .stat-card.runner-up .card-body .team-name { font-size: 1.5rem; font-weight: 700; color: #fff; display: block; margin-top: 10px; }
.card-flag { width: 80px; height: 55px; object-fit: cover; border-radius: 5px; border: 2px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 10px rgba(0,0,0,0.2); margin: 0 auto; }
.stat-card.award .player-name { font-size: 1.5rem; font-weight: 700; color: var(--color-accent-gold); }
.stat-card.award .award-detail { display: block; font-size: 1rem; color: var(--color-text-secondary); }

/* --- PIE DE PÁGINA --- */
.site-footer { background-color: var(--color-dark-secondary); border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 30px 0; margin-top: auto; text-align: center; font-size: 0.9rem; color: var(--color-text-secondary); }
.site-footer .footer-nav { margin-top: 10px; }
.site-footer .footer-nav ul { display: flex; justify-content: center; gap: 20px; list-style: none; }
.site-footer .footer-nav a { color: var(--color-text-secondary); transition: color 0.3s ease; }
.site-footer .footer-nav a:hover { color: var(--color-accent-gold); }

/* --- ANIMACIONES --- */
.animate-fade-in-down { animation: fadeInDown 0.8s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.8s 0.2s ease-out forwards; }
.animate-card { opacity: 0; animation: fadeInUp 0.5s ease-out forwards; }
.trophy-cabinet .animate-card:nth-child(2) { animation-delay: 0.2s; }
.player-awards .animate-card:nth-child(1) { animation-delay: 0.4s; }
.player-awards .animate-card:nth-child(2) { animation-delay: 0.6s; }

@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/*
==============================================
PÁGINA DE SELECCIONES
==============================================
*/

/* Hero genérico para páginas internas */
.page-hero {
    position: relative;
    height: 40vh;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--color-dark-secondary);
}

.page-hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.page-hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.3rem);
    color: var(--color-accent-gold);
    font-weight: 600;
}

/* Grilla de Selecciones */
.selecciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.seleccion-card {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #fff;
    transition: all 0.3s ease;
}

.seleccion-card .card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.5);
    transform: scale(1.2);
    transition: all 0.5s ease;
}

.seleccion-card .card-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 16, 31, 0.6);
    z-index: 1;
}

.seleccion-card .card-content-seleccion {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.seleccion-card .seleccion-flag {
    width: 100px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.seleccion-card .seleccion-name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
}

.seleccion-card .seleccion-confederacion {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent-gold);
    background-color: rgba(0,0,0,0.3);
    padding: 3px 8px;
    border-radius: 20px;
}

.seleccion-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

.seleccion-card:hover .card-background {
    filter: blur(5px) brightness(0.7);
    transform: scale(1.1);
}

.seleccion-card:hover .seleccion-flag {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
/*
==============================================
PÁGINA DE SELECCIONES (ACTUALIZACIÓN HERO)
==============================================
*/

.hero-selecciones {
    background-image: 
        /* Capa de degradado oscuro para legibilidad del texto */
        linear-gradient(to top, rgba(10, 16, 31, 0.8) 0%, rgba(10, 16, 31, 0.6) 100%),
        /* Imagen de fondo del mapa del mundo */
        url('https://images.pexels.com/photos/220201/pexels-photo-220201.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
    background-size: cover;
    background-position: center;
}
/*
==============================================
PÁGINA DE JUGADORES
==============================================
*/

.jugadores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.player-card {
    position: relative;
    aspect-ratio: 3 / 4.5;
    border-radius: var(--border-radius);
    overflow: hidden;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: all 0.4s ease;
}

.player-card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    transition: all 0.4s ease;
}

.player-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 16, 31, 1) 30%, transparent 70%);
    z-index: 1;
}

.player-card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-position {
    font-weight: 700;
    background-color: rgba(0,0,0,0.4);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.player-flag {
    width: 40px;
    height: 26px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid rgba(255,255,255,0.5);
}

.player-card-name-container {
    text-align: right;
}

.player-nickname {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent-gold);
    display: block;
}

.player-name {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.player-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.player-card:hover .player-card-background {
    transform: scale(1.1);
}
/* Enlace para la tarjeta de jugador */
.player-card-link {
    text-decoration: none;
}

/*
==============================================
PÁGINA DE DETALLE DEL JUGADOR
==============================================
*/

.player-detail-hero {
    position: relative;
    width: 100%;
    padding: 60px 0;
    overflow: hidden;
    min-height: 400px;
}

.player-detail-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 20%;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.2);
}

.player-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(18, 26, 46, 0.5) 0%, var(--color-dark-primary) 85%);
}

.player-detail-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
}

@media (min-width: 768px) {
    .player-detail-container {
        flex-direction: row;
        text-align: left;
        gap: 50px;
    }
}

.player-image-container {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.player-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info-container {
    color: #fff;
}

.player-detail-name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1;
}

.player-detail-nickname {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-accent-gold);
    margin-bottom: 20px;
}

.player-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    justify-content: center;
}

@media (min-width: 768px) {
    .player-meta-info {
        justify-content: flex-start;
    }
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    background-color: rgba(0,0,0,0.2);
    padding: 8px 15px;
    border-radius: 20px;
}

.meta-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
}

/*
==============================================
PÁGINA DE DETALLE DEL JUGADOR - SECCIONES ENRIQUECIDAS
==============================================
*/

.player-content-section {
    padding: 40px 0;
    background-color: var(--color-dark-primary);
}

.detail-section {
    margin-bottom: 50px;
}

.detail-section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
}

.section-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 60px auto;
    width: 80%;
}

/* Galería de Imágenes */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    aspect-ratio: 16 / 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Datos Curiosos */
.facts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .facts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.fact-card {
    background: linear-gradient(145deg, var(--color-dark-secondary), #1a243d);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.fact-icon {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-accent-gold);
}

.fact-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* Video */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Proporción 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/*
==============================================
ESTILOS RESPONSIVOS Y MENÚ MÓVIL
==============================================
*/

/* Ocultar menú de escritorio en móvil */
.desktop-nav {
    display: none;
}
/* Mostrar botón de hamburguesa en móvil */
.mobile-nav-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}
.mobile-nav-toggle .hamburger-icon rect {
    fill: var(--color-text-secondary);
    transition: all 0.3s ease;
}
.mobile-nav-toggle:hover .hamburger-icon rect {
    fill: #fff;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Estilos del panel de navegación móvil */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%; /* Empieza fuera de la pantalla */
    width: 100%;
    height: 100%;
    /* --- INICIO: CAMBIO --- Se mejora el fondo para evitar translucidez y añadir efecto moderno */
    background-color: rgba(10, 16, 31, 0.95);
    backdrop-filter: blur(15px);
    /* --- FIN: CAMBIO --- */
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.mobile-nav.is-active {
    right: 0; /* Se desliza a la vista */
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-mobile {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
}
.close-nav-toggle {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    /* --- INICIO: CAMBIO --- Se añade z-index para asegurar que el botón sea clickeable */
    position: relative;
    z-index: 1002;
    /* --- FIN: CAMBIO --- */
}
.close-nav-toggle:hover {
    color: #fff;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.mobile-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    padding: 10px;
    transition: color 0.3s ease;
}
.mobile-nav ul li a:hover {
    color: var(--color-accent-gold);
}


/* Media Query para pantallas más grandes (tablets y escritorio) */
@media (min-width: 992px) {
    /* Ocultar botón de hamburguesa en escritorio */
    .mobile-nav-toggle {
        display: none;
    }
    /* Mostrar menú de escritorio */
    .desktop-nav {
        display: block;
    }
    /* Ocultar panel de navegación móvil */
    .mobile-nav {
        display: none;
    }

    /* Estilos responsivos para el footer */
    .site-footer .container {
        flex-direction: row;
        justify-content: space-between;
    }
    .site-footer .footer-nav {
        margin-top: 0;
    }
}