@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
    /* Colors */
    --primary-color: #ff4d00;    /* Orange from logo K */
    --secondary-color: #0077ff;  /* Blue from logo circle */
    --accent-color: #ffaa00;     /* Amber/Yellow */
    --dark-bg: #0d0d0d;
    --darker-bg: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --gradient-1: linear-gradient(135deg, #ff4d00 0%, #ffaa00 100%);
    --gradient-2: linear-gradient(135deg, #0077ff 0%, #00d4ff 100%);
    --gradient-3: linear-gradient(135deg, #ff4d00 0%, #0077ff 100%);
    
    /* Fonts */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 5rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: var(--font-body);
    background: var(--darker-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Premium Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050505; /* Solid deep black for maximum contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.preloader-logo {
    position: relative;
    width: 140px;
    height: 140px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: preloaderPulse 2s ease-in-out infinite;
}

.preloader-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(255, 77, 0, 0.5));
}

/* Three Orbital Rings */
.preloader-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: preloaderSpin 1.5s cubic-bezier(0.5, 0.2, 0.2, 0.5) infinite;
    z-index: 1;
}

.preloader-spinner::before {
    content: '';
    position: absolute;
    inset: -15px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: preloaderSpin 2s linear infinite reverse;
}

.preloader-spinner::after {
    content: '';
    position: absolute;
    inset: 15px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: preloaderSpin 1s ease-in-out infinite;
}

.preloader-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 77, 0, 0.5);
    margin-top: 10px;
    position: relative;
}

.preloader-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--gradient-1);
    border-radius: 2px;
    animation: preloaderLineGrow 2s ease-in-out infinite;
}

@keyframes preloaderSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 30px rgba(255, 77, 0, 0.4)); }
    50% { transform: scale(1.08); filter: brightness(1.3) drop-shadow(0 0 50px rgba(255, 77, 0, 0.7)); }
}

@keyframes preloaderLineGrow {
    0%, 100% { width: 40px; opacity: 0.5; }
    50% { width: 100px; opacity: 1; }
}

/* Header Styles */
.main-header {
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    position: fixed;
    top: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    z-index: 10000;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Let clicks through the empty space */
}

.main-header > * {
    pointer-events: auto; /* Re-enable clicks for content */
}

.main-header .container {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 95% !important;
    max-width: 1400px !important;
    padding: 0 40px !important;
    background: rgba(10, 14, 39, 0.96);
    backdrop-filter: blur(25px);
    border: 2px solid var(--primary-color);
    border-radius: 100px;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 77, 0, 0.1);
    margin: 0 auto;
}



.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: fit-content;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo:hover .logo-icon {
    transform: scale(1.1);
}

.logo-text {
    display: block !important;
    visibility: visible !important;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Global Header & Nav Structure */
body {
    padding-top: 110px;
    padding-bottom: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 20px;
}

/* Premium Floating Bottom Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 15px;
}



.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 85px;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.nav-link.active {
    color: #fff !important;
    /* background: var(--primary-color); */
    box-shadow: 0 4px 15px rgba(255, 77, 0, 0.4);
}

/* Hide the old underline after-effect */
.nav-link::after {
    display: none !important;
}


.nav-icon {
    font-size: 1.4rem;
    display: block !important;
    transition: transform 0.3s ease;
}


/* Language Toggle */

.lang-toggle {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 77, 0, 0.3);
    padding: 4px;
    border-radius: 30px;
    display: flex;
    gap: 0;
    position: relative;
    overflow: hidden;
    height: 38px;
    width: 90px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 77, 0, 0.2);
}

.lang-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.lang-option.active {
    color: var(--darker-bg) !important;
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 77, 0, 0.4);
    text-shadow: none !important;
}

.lang-divider {
    display: none;
}


/* Hero Section */
.hero-section {
    position: relative;
    padding: var(--spacing-xxl) 0;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(255, 77, 0, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(0, 119, 255, 0.15) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 5px;
    animation: slideUp 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 2px;
    animation: slideUp 1s ease-out 0.2s backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styles */
.results-section,
.matches-section,
.news-section,
.matches-display,
.news-content,
.legends-content,
.league-content {
    padding: var(--spacing-xl) 0;
}

.section-header {
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 3px;
}

.section-line {
    width: 100px;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 2px;
}

/* Match Card Styles */
.results-grid,
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.match-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: var(--spacing-lg);
    border: 2px solid transparent;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 0;
}

.match-card:hover::before {
    opacity: 0.05;
}

.match-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.2);
}

.match-card > * {
    position: relative;
    z-index: 1;
}

.match-league {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--spacing-md) 0;
}

.team {
    text-align: center;
    flex: 1;
}

.team-name {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
}

.team-logo {
    font-size: 3rem;
    margin-bottom: var(--spacing-xs);
}

.match-score {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
}

.match-vs {
    color: var(--text-secondary);
    font-size: 1rem;
}

.match-time,
.match-date {
    text-align: center;
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.match-status {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: var(--spacing-sm);
}

.status-live {
    background: var(--secondary-color);
    color: var(--text-primary);
    animation: blink 1.5s infinite;
}

.status-finished {
    background: rgba(0, 255, 136, 0.2);
    color: var(--primary-color);
}

.status-upcoming {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-color);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* News Card Styles */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.news-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-xl);
}

.news-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition-normal);
}

.news-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 0, 102, 0.2);
}

.news-image {
    width: 100%;
    height: 200px;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}

.news-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
}

.news-content {
    padding: var(--spacing-lg);
}

.news-category {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 0, 102, 0.2);
    color: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.news-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Page Header */
.page-header {
    background: var(--card-bg);
    padding: var(--spacing-xxl) 0 var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 77, 0, 0.1) 0%, transparent 70%);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* Filters */
.filters-section,
.news-categories,
.legends-categories,
.league-selector {
    padding: var(--spacing-lg) 0;
    background: var(--card-bg);
}

.filters {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.filter-select {
    background: var(--dark-bg);
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.filter-select:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
}

.category-tabs,
.league-tabs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab,
.league-tab {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 25px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-tab:hover,
.league-tab:hover,
.category-tab.active,
.league-tab.active {
    background: var(--primary-color);
    color: var(--dark-bg);
    transform: scale(1.05);
}

/* Matches List */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Legends Grid */
.legends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.legend-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.legend-card:hover {
    transform: translateY(-12px) scale(1.02);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Rarity Styles */
.legend-card.immortal {
    border: 2px solid #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.legend-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.legend-photo-wrap {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, #1a1a1a, #2c3e50);
}

.legend-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1) contrast(1.05);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.legend-card:hover .legend-photo {
    transform: scale(1.1);
    filter: brightness(1);
}

.legend-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #d4af37;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    z-index: 2;
}

.legend-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.legend-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.legend-years {
    font-size: 0.75rem;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.legend-name {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 5px;
    line-height: 1.1;
}

.legend-fullname {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 15px;
}

.legend-position-tag {
    display: inline-block;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.legend-achievements {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.achievement-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #d4af37;
    margin-bottom: 10px;
}

.achievement-list {
    list-style: none;
    padding: 0;
}

.achievement-list li {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    padding-left: 18px;
    position: relative;
}

.achievement-list li::before {
    content: '🏆';
    position: absolute;
    left: 0;
    font-size: 0.7rem;
    top: 2px;
}

[dir="rtl"] .achievement-list li {
    padding-left: 0;
    padding-right: 18px;
}

[dir="rtl"] .achievement-list li::before {
    left: auto;
    right: 0;
}

/* League Content */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
}

.content-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.standings-table {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 1fr 1fr;
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    transition: var(--transition-fast);
}

.table-row:hover {
    background: rgba(0, 255, 136, 0.05);
}

.table-header {
    background: rgba(255, 77, 0, 0.1);
    font-weight: 700;
    color: var(--primary-color);
}

.rank {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
}

.team-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.team-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.team-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.team-group {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.team-emoji-icon {
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.stat {
    text-align: center;
    font-weight: 600;
}

/* Scorers List */
.scorers-list {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
}

.scorer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.scorer-item:hover {
    background: rgba(255, 0, 102, 0.05);
    transform: translateX(-5px);
}

.scorer-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.scorer-rank {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--secondary-color);
    min-width: 45px;
    display: flex;
    align-items: center;
}

.scorer-photo-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 0, 102, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scorer-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scorer-photo-placeholder {
    font-size: 1.5rem;
    opacity: 0.5;
}

.scorer-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.scorer-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.scorer-team-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scorer-team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

.scorer-team-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.scorer-goals {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 0.5rem;
}

/* Footer */
.main-footer {
    background: var(--card-bg);
    padding: var(--spacing-xl) 0;
    border-top: 2px solid var(--primary-color);
    margin-top: var(--spacing-xxl);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.footer-logo h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    color: var(--text-secondary);
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .main-nav ul {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .team-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .scorer-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .achievement-list li {
    padding-left: 0;
    padding-right: var(--spacing-md);
}

[dir="rtl"] .achievement-list li::before {
    left: auto;
    right: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .header-content {
        padding: var(--spacing-sm) 0;
    }
    .logo-text {
        font-size: 1.4rem;
    }
    .main-nav ul {
        gap: var(--spacing-md);
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Cleaned up medium screen rules - Header now uses global Flex space-between */

@media (max-width: 768px) {
    .header-content {
        flex-direction: row; /* Keep logo and lang horizontal */
        padding: 10px var(--spacing-md);
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .nav-link {
        font-size: 0.7rem;
        min-width: 55px;
    }
    
    .results-grid,
    .matches-grid,
    .news-grid,
    .news-grid-full,
    .legends-grid {
        grid-template-columns: 1fr;
    }
    
    .table-row {
        grid-template-columns: 40px 2fr 1fr 1fr 1fr;
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.1rem;
    }
    
    .match-teams {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .match-score {
        flex-direction: column;
    }

    .main-nav {
        width: 96%;
        padding: 8px 10px;
        bottom: 15px;
    }
}

/* ============================================================
   API Integration Styles
   ============================================================ */

/* Loading Spinner */
.api-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 77, 0, 0.15);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 1px;
}

/* Error Toast */
.api-error-toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(0, 119, 255, 0.1);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    color: var(--secondary-color);
    grid-column: 1 / -1;
    justify-content: center;
}

.api-error-toast span {
    font-size: 1.5rem;
}

.api-error-toast p {
    font-weight: 600;
}

/* Team Logo Images (from API) */
.team-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: var(--transition-normal);
}

.match-card:hover .team-logo-img {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(255, 77, 0, 0.3));
}

/* Live Match Card Variant */
.match-card--live {
    border-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 119, 255, 0.15);
}

.match-card--live::before {
    background: var(--gradient-2) !important;
    opacity: 0.04 !important;
}

/* News Team Logos */
.news-team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    position: relative;
    z-index: 1;
}

.news-image {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.season-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 77, 0, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-logo-mini {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    padding: 2px;
}

[dir="rtl"] .team-logo-mini {
    margin-right: 0;
    margin-left: 4px;
}

/* ── Group Headers & Grid ── */

.groups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
    width: 100%;
}

/* ============================================================ */
/* Consolidated Responsive Layouts */
/* ============================================================ */

/* Desktop Layout (1261px and above) */
@media (min-width: 1261px) {
    .main-header {
        position: fixed;
        top: 0;
        bottom: auto;
        height: 110px;
        background: transparent;
    }

    .main-header .container {
        background: rgba(10, 14, 39, 0.96);
        border: 2px solid var(--primary-color);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    }

    .nav-icon {
        display: none !important;
    }

    body {
        padding-top: 110px;
        padding-bottom: 0;
    }
}

/* Mobile & Tablet Layout (1260px and below) */
@media (max-width: 1260px) {
    /* Top Bar for Logo & Language Toggle */
    .main-header {
        position: fixed !important;
        top: 0 !important;
        bottom: auto !important;
        height: 70px !important;
        background: rgba(10, 14, 39, 0.98) !important;
        backdrop-filter: none !important; /* REQUIRED: To allow fixed children (.main-nav) to anchor to viewport bottom! */
        border-bottom: 1px solid rgba(255, 77, 0, 0.4) !important;
        z-index: 5000 !important;
    }

    .main-header::before {
        content: '';
        position: absolute;
        inset: 0;
        backdrop-filter: blur(15px);
        z-index: -1;
    }

    .main-header .container {
        background: transparent !important;
        backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        height: 100% !important;
    }

    .header-content {
        justify-content: space-between;
    }

    /* Floating Navigation Dock (Bottom) */
    .main-nav {
        position: fixed !important;
        top: auto !important;
        bottom: 25px !important; 
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 95% !important;
        max-width: 550px !important;
        background: rgba(13, 17, 45, 0.98) !important;
        backdrop-filter: blur(30px) !important;
        border: 2px solid rgba(255, 77, 0, 0.7) !important;
        border-radius: 80px !important;
        padding: 6px 10px !important;
        box-sizing: border-box !important;
        z-index: 9999 !important;
        display: flex !important;
        justify-content: center !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.9) !important;
    }

    .main-nav ul {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 0 !important;
    }

    .main-nav ul li {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .nav-icon {
        display: block !important;
        font-size: 1.25rem !important;
        margin-bottom: 2px !important;
    }

    .nav-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        color: var(--text-secondary) !important;
        width: 100% !important;
    }

    .nav-link.active {
        color: var(--primary-color) !important;
        transform: translateY(-5px) scale(1.1) !important;
    }

    body {
        padding-top: 80px !important;
        padding-bottom: 130px !important;
    }
}
