/**
 * Mundialito 2026 - Estilos Principales
 * Diseño moderno, responsive y vibrante inspirado en el Mundial 2026
 */

/* ============================================
   VARIABLES CSS - Sistema de Diseño
   ============================================ */
:root {
    /* Colores Principales - Inspirados en Mundial 2026 */
    --color-oro: #FFD700;
    --color-plata: #c0c0c0bd;
    --color-bronce: #CD7F32;

    /* Paleta de Colores Vibrantes */
    --primary-color: #FF6B35;
    --secondary-color: #004E89;
    --accent-color: #F77F00;
    --success-color: #06D6A0;
    --warning-color: #FFD23F;
    --danger-color: #EF476F;

    /* Colores de Fondo */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-dark: #1A1D29;
    --bg-card: #FFFFFF;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Colores de Texto */
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-light: #A0AEC0;
    --text-white: #FFFFFF;

    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);

    /* Bordes */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   TIPOGRAFÍA
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */
.header {
    background: linear-gradient(135deg, #FF6B35 0%, #F77F00 100%);
    color: var(--text-white);
    padding: 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-xs) 0;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.header-main {
    padding: var(--spacing-md) 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-white);
}

.logo-icon {
    font-size: 2.5rem;
    animation: rotate 20s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

.logo-text h1 {
    color: var(--text-white);
    font-size: 1.75rem;
    margin: 0;
}

.logo-text p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
}

/* Navegación Sticky (Siempre Visible) */
.nav {
    background: var(--bg-dark);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: box-shadow 0.3s ease;
}

/* Sombra más pronunciada al hacer scroll */
.nav.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-xs);
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Menú Mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-white);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 100px 100px;
    opacity: 0.3;
    animation: float 20s linear infinite;
}

@keyframes float {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100px);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    color: var(--text-white);
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
}

/* ============================================
   TABS DE CATEGORÍAS
   ============================================ */
.category-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    background: var(--bg-card);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.category-tab {
    flex: 1;
    min-width: 150px;
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Estilo por defecto (inactivo) */
    opacity: 0.6;
    filter: grayscale(0.8);
    transform: scale(0.95);
}

.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.category-tab:hover::before {
    left: 100%;
}

.category-tab.oro {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.category-tab.plata {
    background: linear-gradient(135deg, #E8E8E8, #A8A8A8);
    color: #000;
}

.category-tab.bronce {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: #FFF;
}

.category-tab:hover {
    transform: translateY(-2px) scale(0.98);
    box-shadow: var(--shadow-lg);
    opacity: 0.9;
    filter: grayscale(0.2);
}

.category-tab.active {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
    opacity: 1;
    filter: grayscale(0);
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* ============================================
   CARDS Y SECCIONES
   ============================================ */
.section {
    margin-bottom: var(--spacing-xl);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--primary-color);
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.section-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* ============================================
   TABLAS
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

thead {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--text-white);
}

thead th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #E2E8F0;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #F7FAFC;
}

/* Filas de clasificados (Top 8) */
.row-qualified {
    background-color: rgba(118, 196, 175, 0.25);
    /* Verde más intenso y visible */
    border-left: 4px solid var(--success-color);
    font-weight: 500;
}

.row-qualified:hover {
    background-color: rgba(113, 222, 193, 0.35) !important;
}

tbody td {
    padding: var(--spacing-md);
    font-size: 0.9375rem;
}

/* Posiciones especiales en tabla */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.position-1 {
    background: #FFD700;
    color: #000;
}

.position-2 {
    background: #C0C0C0;
    color: #000;
}

.position-3 {
    background: #CD7F32;
    color: #FFF;
}

/* ============================================
   BADGES Y ETIQUETAS
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    text-align: center;
}

.footer p {
    margin: var(--spacing-xs) 0;
    opacity: 0.8;
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-bold {
    font-weight: 700;
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   FILTROS DE PARTIDOS
   ============================================ */
.filter-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 5px;
}

.filter-bar {
    display: flex;
    gap: var(--spacing-md);
    background: #F8FAFC;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid #E2E8F0;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-group label i {
    color: var(--primary-color);
}

.filter-select {
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #CBD5E1;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

@media (max-width: 600px) {
    .filter-bar {
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .filter-group {
        min-width: 120px;
    }
}


/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .nav {
        min-height: 56px;
    }

    .nav-container {
        position: relative;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: var(--spacing-md);
        top: 8px;
        transform: none;
        height: 40px;
        width: 40px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        z-index: 1001;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        padding: 56px 0 var(--spacing-md) 0;
        max-height: 85vh;
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .category-tabs {
        flex-direction: column;
    }

    .category-tab {
        min-width: 100%;
    }

    .table-container {
        font-size: 0.875rem;
    }

    thead th,
    tbody td {
        padding: var(--spacing-sm);
    }

    .container {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   HEADER CON IMAGEN PERSONALIZADA
   ============================================ */
.header-image {
    background: url('../Header.jpg') center center / cover no-repeat;
    min-height: 400px;
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.header-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    padding: var(--spacing-xl) var(--spacing-md);
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-image .logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    color: var(--text-white);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.header-image .logo-icon {
    font-size: 3.5rem;
    animation: rotate 20s linear infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.header-image .logo-text h1 {
    color: var(--text-white);
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.7);
}

.header-image .logo-text p {
    font-size: 1rem;
    opacity: 0.95;
    margin: 0;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

/* Responsive para header con imagen */
@media (max-width: 768px) {
    .header-image {
        min-height: 150px;
    }

    .header-content-wrapper {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .header-image .logo {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }

    .header-image .logo-icon {
        font-size: 2.5rem;
    }

    .header-image .logo-text h1 {
        font-size: 1.75rem;
    }

    .header-image .logo-text p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .header-image {
        min-height: 120px;
    }

    .header-image .logo-icon {
        font-size: 2rem;
    }

    .header-image .logo-text h1 {
        font-size: 1.5rem;
    }
}

/* ============================================
   CUARTOS DE FINAL
   ============================================ */
.cuartos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.bracket-match {
    background: white;
    border-radius: var(--border-radius-lg);
    border: 2px solid #E2E8F0;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.bracket-match:hover {
    transform: translateY(-5px);
    border-color: #FF9F1C;
}

.bracket-header {
    background: #F8FAFC;
    padding: 10px 15px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748B;
}

.bracket-team {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bracket-team:first-of-type {
    border-bottom: 1px solid #F1F5F9;
}

.bracket-team-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bracket-pos {
    width: 24px;
    height: 24px;
    background: #CBD5E1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.bracket-match-vs {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #FF9F1C;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    border: 3px solid white;
    z-index: 2;
}