/* ========================================
   La Liguilla MX - Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary-green: #006847;
    --primary-red: #CE1126;
    --primary-white: #FFFFFF;
    --dark-bg: #1a1a2e;
    --darker-bg: #16162a;
    --card-bg: #252542;
    --text-primary: #ffffff;
    --text-secondary: #b4b4c4;
    --accent-gold: #FFD700;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #f44336;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--darker-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-mx {
    color: var(--primary-green);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: var(--transition);
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-green) 0%, #004d35 100%);
    padding: 60px 0;
    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,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='10'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    position: relative;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
}

/* ========================================
   Ad Containers
   ======================================== */
.ad-container {
    padding: 20px 0;
}

.ad-banner {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-banner-top,
.ad-banner-middle {
    min-height: 90px;
}

.ad-sidebar {
    min-height: 250px;
    margin-bottom: 20px;
}

.ad-placeholder {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px;
    text-align: center;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-sticky-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    border-radius: 0;
    min-height: 50px;
}

.ad-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* ========================================
   Main Content Grid
   ======================================== */
.main-content {
    padding: 30px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* ========================================
   Section Headers
   ======================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-left: 15px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: var(--primary-green);
    border-radius: 2px;
}

.see-all {
    color: var(--primary-green);
    font-weight: 500;
    transition: var(--transition);
}

.see-all:hover {
    text-decoration: underline;
}

/* ========================================
   News Section
   ======================================== */
.news-grid {
    display: grid;
    gap: 20px;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    gap: 15px;
}

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

.news-card-image {
    width: 200px;
    min-height: 150px;
    background: var(--darker-bg);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

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

.news-card-image .placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-green), #004d35);
}

.news-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-card-source {
    font-size: 0.75rem;
    color: var(--primary-green);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.news-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Featured News Card */
.news-card.featured {
    flex-direction: column;
}

.news-card.featured .news-card-image {
    width: 100%;
    min-height: 200px;
}

.news-card.featured .news-card-title {
    font-size: 1.3rem;
}

/* ========================================
   Sidebar Widgets
   ======================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scores Widget */
.score-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.score-item:last-child {
    border-bottom: none;
}

.score-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.score-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-result {
    font-weight: 700;
    background: var(--darker-bg);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.score-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 5px;
}

.score-status.live {
    color: var(--error);
    font-weight: 600;
}

/* Standings Widget */
.standings-table {
    width: 100%;
    font-size: 0.85rem;
}

.standings-table th,
.standings-table td {
    padding: 8px 5px;
    text-align: left;
}

.standings-table th {
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.standings-table tr:nth-child(-n+4) td:first-child {
    border-left: 3px solid var(--primary-green);
}

.standings-table td:first-child {
    padding-left: 10px;
}

.standings-table .team-name {
    font-weight: 500;
}

.standings-table .pts {
    font-weight: 700;
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.team-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.team-badge:hover {
    background: var(--darker-bg);
}

.team-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.team-logo.america { background: linear-gradient(135deg, #FFCD00, #1E3A8A); }
.team-logo.chivas { background: linear-gradient(135deg, #C41E3A, #FFFFFF); color: #C41E3A; }
.team-logo.cruzazul { background: linear-gradient(135deg, #0047AB, #87CEEB); }
.team-logo.pumas { background: linear-gradient(135deg, #003366, #FFD700); }
.team-logo.tigres { background: linear-gradient(135deg, #FFD700, #003366); color: #003366; }
.team-logo.monterrey { background: linear-gradient(135deg, #003366, #87CEEB); }

.team-badge span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Team logos from API */
.team-logo-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.team-logo-tiny {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: middle;
}

.score-team {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-item.is-live {
    background: rgba(206, 17, 38, 0.1);
    border-left: 3px solid var(--primary-red);
    padding-left: 12px;
    margin-left: -15px;
    padding-right: 0;
}

.standings-table .team-name {
    display: flex;
    align-items: center;
}

.standings-table tr.playoff-spot td:first-child {
    border-left: 3px solid var(--primary-green);
}

.standings-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
    opacity: 0.8;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 0.9rem;
}

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

/* ========================================
   Featured Section
   ======================================== */
.featured-section {
    padding: 40px 0;
    background: var(--darker-bg);
}

.bracket-preview {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
}

.bracket-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.bracket-info p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.bracket-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.bracket-match {
    background: var(--darker-bg);
    padding: 15px;
    border-radius: 8px;
    min-width: 200px;
}

.bracket-match-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.bracket-team span:first-child {
    font-weight: 500;
}

/* ========================================
   Social Section
   ======================================== */
.social-section {
    padding: 40px 0;
}

.social-feeds {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
}

.social-feed h4 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.tweet-item {
    padding: 15px;
    background: var(--darker-bg);
    border-radius: 8px;
    margin-bottom: 10px;
}

.tweet-item:last-child {
    margin-bottom: 0;
}

.tweet-author {
    font-weight: 600;
    margin-bottom: 5px;
}

.tweet-author span {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
}

.tweet-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--darker-bg);
    padding: 50px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.footer-column h4 {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-column a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--primary-green);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.disclaimer {
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========================================
   Loading States
   ======================================== */
.loading-spinner {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 300px;
    }
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .ad-sidebar {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--darker-bg);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

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

    .news-card {
        flex-direction: column;
    }

    .news-card-image {
        width: 100%;
        min-height: 180px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .ad-sidebar {
        grid-column: span 1;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

    .footer-links {
        gap: 40px;
    }

    .ad-sticky-mobile {
        display: flex;
    }

    body {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bracket-teams {
        flex-direction: column;
    }

    .bracket-match {
        width: 100%;
    }
}
