/* ==========================================
   CSS VARIABLES - DESIGN TOKENS (PREMIUM THEME)
   ========================================== */
:root {
    /* Color Palette - Premium Blue Theme */
    --clr-bg-deep: #132442;         /* Deepest blue for main background */
    --clr-bg-surface: #1A3155;      /* Surface blue for cards and containers */
    --clr-bg-surface-hover: #213D6A; /* Slightly lighter blue for hovers */
    
    --clr-primary: #E63946;         /* Red from Chile Flag - Vibrant */
    --clr-primary-hover: #C92A36;
    --clr-secondary: #2A69AC;       /* Blue from Chile Flag - Elegant */
    --clr-accent: #C5A059;          /* Gold for a "Premium" / Championship feel */
    
    --clr-text-main: #F8FAFC;       /* Off-white for high legibility */
    --clr-text-muted: #B3C5DF;      /* Light blue-slate for secondary info */
    
    --clr-border: #2A4878;          /* Subtle blue borders */
    
    --clr-success: #10B981;
    --clr-danger: #EF4444;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions & Shadows */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(230, 57, 70, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--clr-bg-deep);
    color: var(--clr-text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary) 0%, #A31C27 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--clr-text-main);
    border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
    background: var(--clr-bg-surface-hover);
    border-color: var(--clr-text-muted);
}

.btn-login {
    background: var(--clr-bg-surface);
    color: var(--clr-accent);
    border: 1px solid rgba(197, 160, 89, 0.3);
}

.btn-login:hover {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--clr-accent);
}

/* ==========================================
   NAVIGATION
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(19, 36, 66, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--clr-border);
    transition: all var(--transition-fast);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.nav-logo:hover img {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--clr-text-muted);
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--clr-text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--clr-primary);
    transition: width var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1.5rem;
    background-color: var(--clr-bg-deep);
    overflow: hidden;
}

/* Foto de fondo con opacidad baja */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('./hero-bg.png');
    background-size: cover;
    background-position: center 30%;
    opacity: 0.22;
    filter: saturate(0.7);
    z-index: 0;
}

/* Degradado encima de la foto — colores del sitio */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        /* degradado radial central para oscurecer el centro y dar foco al texto */
        radial-gradient(ellipse 80% 60% at 50% 50%,
            rgba(19, 36, 66, 0.55) 0%,
            transparent 70%),
        /* degradado lineal de abajo: funde con el fondo de la siguiente sección */
        linear-gradient(
            to bottom,
            rgba(19, 36, 66, 0.35) 0%,
            rgba(19, 36, 66, 0.50) 60%,
            var(--clr-bg-deep) 100%
        );
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(197, 160, 89, 0.15);
    color: var(--clr-accent);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.hero-title span {
    color: var(--clr-primary);
    text-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--clr-text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==========================================
   TABLES & ZONES SECTION
   ========================================== */
.section-tables {
    padding: 6rem 0;
    background-color: var(--clr-bg-deep);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--clr-text-muted);
    font-size: 1.125rem;
}

/* Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--clr-bg-surface);
    padding: 0.5rem;
    border-radius: 8px;
    width: max-content;
    margin-inline: auto;
    border: 1px solid var(--clr-border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--clr-text-muted);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--clr-text-main);
}

.tab-btn.active {
    background: var(--clr-secondary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(42, 105, 172, 0.3);
}

/* Tables & Content Wrapper */
.tables-wrapper {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

.table-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.table-content.active {
    display: block;
}

/* Sub-Tabs */
.sub-tabs-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.sub-tab-btn {
    background: var(--clr-bg-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-muted);
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sub-tab-btn:hover {
    background: var(--clr-bg-surface-hover);
    color: var(--clr-text-main);
}

.sub-tab-btn.active {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3);
}

.sub-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.sub-content.active {
    display: block;
}

/* Iframes UI */
.iframe-container {
    background: var(--clr-bg-surface);
    border-radius: 12px;
    border: 1px solid var(--clr-border);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
    width: 100%;
}

.iframe-container iframe {
    width: 100%;
    min-height: 600px;
    border: none;
    display: block;
    background: transparent;
}

.iframe-tall iframe {
    min-height: 800px;
}

.iframe-short iframe {
    min-height: 360px;
}

/* Grid for Cards (Amarillas/Rojas) */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stats-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.yellow-card-icon, .red-card-icon {
    display: inline-block;
    width: 16px;
    height: 22px;
    border-radius: 3px;
}

.yellow-card-icon {
    background: #FBBF24;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.red-card-icon {
    background: #EF4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

@media (max-width: 992px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none; /* In a real app, implement hamburger menu */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hide-mobile {
        display: none;
    }
    
    .tabs-container {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .contact-list li, .footer-links a {
        justify-content: center;
    }

    .footer-bottom-flex {
        flex-direction: column;
        text-align: center;
    }
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.standings-table th {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--clr-text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--clr-border);
}

.standings-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--clr-border);
    vertical-align: middle;
}

.team-row {
    transition: background var(--transition-fast);
}

.team-row:hover {
    background: var(--clr-bg-surface-hover);
}

/* Specific Columns */
.col-pos {
    width: 50px;
    text-align: center;
}

.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--clr-border);
    color: var(--clr-text-muted);
}

.pos-1 { background: var(--clr-accent); color: #000; box-shadow: 0 0 10px rgba(197, 160, 89, 0.4); }
.pos-2 { background: #94A3B8; color: #000; }

.col-club {
    width: 100%; /* Expands to fill available space */
}

.club-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.club-shield {
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%; /* Just a placeholder shape */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 2px var(--clr-border);
}

.club-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.col-pts {
    font-weight: 700;
    color: var(--clr-text-main);
    font-size: 1.125rem;
}

.col-dg {
    font-weight: 600;
    color: var(--clr-success); /* If positive */
}

.table-empty {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--clr-text-muted);
}

/* ==========================================
   BLOG SECTION
   ========================================== */
.section-blog {
    padding: 6rem 0;
    background-color: var(--clr-bg-surface);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--clr-bg-deep);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--clr-border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}

.blog-card-image {
    position: relative;
    height: 200px;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--clr-primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-date {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.blog-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-title a {
    transition: color var(--transition-fast);
}

.blog-title a:hover {
    color: var(--clr-primary);
}

.blog-excerpt {
    font-size: 0.95rem;
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-read-more {
    font-weight: 600;
    color: var(--clr-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.blog-read-more span {
    transition: transform var(--transition-fast);
}

.blog-read-more:hover span {
    transform: translateX(5px);
}

/* ==========================================
   FOOTER PREMIUM
   ========================================== */
.site-footer {
    background-color: var(--clr-bg-deep); 
    color: #F8FAFC;
    border-top: 2px solid var(--clr-primary); /* Red accent line to separate */
}

.footer-top {
    padding: 4rem 0;
    background-color: #1A3155; /* Match surface color */
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 1fr;
    gap: 3rem;
}

.footer-brand-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    max-width: 130px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
    transition: transform var(--transition-fast);
}

.footer-logo:hover {
    transform: scale(1.05);
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.contact-list svg {
    color: var(--clr-accent);
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
}

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

/* Custom bullet for first links list */
.footer-col:nth-child(2) .footer-links a::before {
    content: '◉';
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    margin-right: 0.5rem;
}

/* Custom arrows for "Links de interes" */
.footer-links-arrow a::before {
    content: '»';
    font-size: 1.1rem;
    color: rgba(255,255,255,0.5);
    margin-right: 0.5rem;
    transition: transform var(--transition-fast);
}

.footer-links-arrow a:hover::before {
    transform: translateX(3px);
    color: var(--clr-accent);
}

.footer-map {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.footer-map iframe {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 2px solid var(--clr-border);
    filter: grayscale(20%) contrast(1.1);
    transition: filter var(--transition-fast), border-color var(--transition-fast);
}

.footer-map iframe:hover {
    filter: grayscale(0%) contrast(1.1);
    border-color: var(--clr-accent);
}

.footer-bottom {
    background-color: #132442; /* Darker main bg */
    padding: 1.5rem 0;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dev-credits {
    color: rgba(255,255,255,0.7);
}

.dev-name {
    color: var(--clr-primary);
    font-weight: 700;
}

.dev-credits a {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.dev-credits a:hover {
    color: var(--clr-accent);
}

/* ==========================================
   ANIMATIONS & MEDIA QUERIES
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .nav-menu {
        display: none; /* In a real app, implement hamburger menu */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hide-mobile {
        display: none;
    }
    
    .tabs-container {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }
}
