/* CSS Variables for Themes */
:root {
    /* Light Theme */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --live-color: #dc2626;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark-theme {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #94a3b8;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --live-color: #dc2626;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 16px;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
header {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
}

h1 i {
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.theme-toggle {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(15deg);
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.date-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.date-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.date-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.date-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filters {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Leagues & Matches */
.leagues-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.league-section {
    background: var(--surface-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.league-section:hover {
    box-shadow: var(--shadow-lg);
}

.league-header {
    background: var(--surface-color);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.league-header:hover {
    background: var(--background-color);
}

.league-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.league-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.league-details {
    flex: 1;
}

.league-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.league-country {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.matches-count {
    background: var(--background-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.collapse-btn:hover {
    background: var(--background-color);
    color: var(--primary-color);
}

.league-section.collapsed .matches-container {
    display: none;
}

.league-section.collapsed .collapse-btn i {
    transform: rotate(180deg);
}

.matches-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* Match Cards */
.match-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
}

.match-card.live::before {
    background: var(--live-color);
}

.match-card.finished::before {
    background: var(--success-color);
}

.match-card.upcoming::before {
    background: var(--warning-color);
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.match-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.match-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-status.live {
    background: var(--live-color);
    color: white;
    animation: pulse 2s infinite;
}

.match-status.finished {
    background: var(--success-color);
    color: white;
}

.match-status.upcoming {
    background: var(--warning-color);
    color: white;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.team-logo {
    width: 56px;
    height: 56px;
    background: var(--background-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.team-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.team-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.vs {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 8px;
}

.match-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 700;
    margin: 8px 0;
    color: var(--text-primary);
}

.score-home,
.score-away {
    min-width: 40px;
    text-align: center;
}

.score-separator {
    color: var(--text-muted);
}

.match-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.match-venue {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Loading & States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.loading p {
    font-size: 1.1rem;
}

.no-matches {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-matches i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.no-matches p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 40px;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    header {
        padding: 20px;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .header-top {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .theme-toggle {
        align-self: flex-end;
        margin-top: -50px;
    }
    
    .controls {
        gap: 12px;
    }
    
    .date-selector {
        flex-direction: column;
    }
    
    .filters {
        justify-content: stretch;
    }
    
    .filter-btn {
        flex: 1;
        justify-content: center;
    }
    
    .stats-bar {
        padding: 16px;
        border-radius: 12px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .matches-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 12px;
    }
    
    .match-card {
        padding: 16px;
    }
    
    .team-logo {
        width: 48px;
        height: 48px;
    }
    
    .team-name {
        font-size: 0.8rem;
    }
    
    .match-score {
        font-size: 1.75rem;
    }
    
    .league-header {
        padding: 14px 16px;
    }
    
    .league-info {
        gap: 10px;
    }
    
    .league-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .league-name {
        font-size: 0.9rem;
    }
    
    .league-country {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .match-teams {
        flex-direction: column;
        gap: 12px;
    }
    
    .team {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .team-logo {
        margin-bottom: 0;
        margin-right: 12px;
    }
    
    .team-name {
        text-align: left;
        flex: 1;
    }
    
    .vs {
        order: -1;
        margin-bottom: 8px;
    }
    
    .match-score {
        order: -1;
        margin-bottom: 16px;
    }

    
}


/* Search and Filter Styles */
.search-filter-container {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.clear-search {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.country-filter {
    padding: 12px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 180px;
    cursor: pointer;
}

.country-filter:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Country Section Styles */
.country-section {
    background: var(--surface-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.country-header {
    background: var(--surface-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.country-header:hover {
    background: var(--background-color);
}

.country-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.country-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.country-details {
    flex: 1;
}

.country-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.country-stats {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.leagues-container {
    padding: 0;
}

.country-section.collapsed .leagues-container {
    display: none;
}

.country-section.collapsed .country-header .collapse-btn i {
    transform: rotate(180deg);
}

/* League Section within Country */
.league-section {
    background: var(--background-color);
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.league-section:last-child {
    border-bottom: none;
}

.league-section .league-header {
    background: transparent;
    padding: 16px 20px;
    border-bottom: none;
}

.league-section .league-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.league-section .matches-container {
    padding: 16px 20px;
    background: var(--surface-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .country-filter {
        min-width: auto;
        width: 100%;
    }
    
    .country-header {
        padding: 16px;
    }
    
    .country-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .country-name {
        font-size: 1.1rem;
    }
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface-color);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Fixtures Styles */
.fixtures-container {
    padding: 0;
}

.round-section {
    border-bottom: 1px solid var(--border-color);
}

.round-section:last-child {
    border-bottom: none;
}

.round-header {
    background: var(--background-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.round-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.matches-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.round-matches {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fixture-match-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.fixture-match-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.fixture-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.fixture-date, .fixture-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.fixture-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fixture-status.live {
    background: var(--live-color);
    color: white;
}

.fixture-status.finished {
    background: var(--success-color);
    color: white;
}

.fixture-status.upcoming {
    background: var(--warning-color);
    color: white;
}

.fixture-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.fixture-team {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.fixture-team.home-team {
    justify-content: flex-start;
}

.fixture-team.away-team {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.team-logo-small {
    width: 40px;
    height: 40px;
    background: var(--background-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.team-logo-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.team-logo-small .team-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.fixture-team .team-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.fixture-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 80px;
    justify-content: center;
}

.fixture-venue {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    justify-content: center;
}

.no-fixtures {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-fixtures i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.no-fixtures p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* League Actions */
.league-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fixtures-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fixtures-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Mobile Responsive for Modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .round-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .round-matches {
        padding: 12px 16px;
    }
    
    .fixture-match-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .fixture-teams {
        flex-direction: column;
        gap: 12px;
    }
    
    .fixture-team {
        justify-content: flex-start !important;
        flex-direction: row;
    }
    
    .fixture-team.away-team {
        flex-direction: row;
    }
    
    .fixture-score {
        order: -1;
        margin-bottom: 8px;
    }
    
    .league-actions {
        gap: 6px;
    }
    
    .fixtures-btn {
        padding: 6px;
        font-size: 0.8rem;
    }
}

/* Round Selector Styles */
.round-selector-container {
    background: var(--surface-color);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.round-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.round-nav-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 10px 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-nav-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.round-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--background-color);
}

.round-select {
    padding: 10px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 160px;
    cursor: pointer;
    text-align: center;
}

.round-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.round-info {
    text-align: center;
}

.round-matches-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.round-fixtures {
    padding: 0;
}

/* Enhanced Fixture Card Styles */
.fixture-date-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.fixture-additional-info {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.fixture-info-item {
    background: var(--background-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.team-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.fixture-team.home-team .team-info {
    align-items: flex-start;
}

.fixture-team.away-team .team-info {
    align-items: flex-end;
}

.team-record {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.fixture-result-info {
    margin-top: 8px;
    text-align: center;
}

.winner-badge {
    background: linear-gradient(135deg, var(--warning-color), #f59e0b);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.no-matches-in-round {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-matches-in-round i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.no-matches-in-round p {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Mobile Responsive for Round Selector */
@media (max-width: 768px) {
    .round-selector-container {
        padding: 16px;
    }
    
    .round-selector {
        gap: 8px;
    }
    
    .round-nav-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .round-select {
        padding: 8px 12px;
        min-width: 140px;
        font-size: 0.85rem;
    }
    
    .fixture-date-info {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .fixture-teams {
        gap: 12px;
    }
    
    .team-info {
        align-items: center !important;
        text-align: center;
    }
}

/* Standings Modal Styles */
.standings-modal .modal-content {
    max-width: 1000px;
}

.standings-header {
    background: var(--surface-color);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.season-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.current-round, .total-rounds, .teams-count {
    background: var(--background-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.standings-table-container {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.standings-table th {
    background: var(--background-color);
    padding: 12px 8px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.standings-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.standings-row {
    transition: background-color 0.3s ease;
}

.standings-row:hover {
    background: var(--background-color);
}

/* Column widths */
.pos-col { width: 80px; }
.team-col { width: 200px; text-align: left; }
.stats-col { width: 50px; }
.points-col { width: 60px; font-weight: 700; }
.form-col { width: 100px; }

/* Team column */
.team-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-logo-xs {
    width: 24px;
    height: 24px;
    background: var(--background-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

.team-logo-xs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.team-logo-xs .team-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.team-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Position column */
.position {
    font-weight: 700;
    color: var(--text-primary);
}

.promotion-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

/* Promotion colors */
.promotion-promotioncolor_cl {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
}

.promotion-promotioncolor_uefa {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
}

.promotion-promotioncolor_promotion {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.promotion-promotioncolor_relegation {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

/* Stats colors */
.stats-col.positive {
    color: var(--success-color);
    font-weight: 600;
}

.stats-col.negative {
    color: var(--danger-color);
    font-weight: 600;
}

.points-col {
    color: var(--primary-color);
    font-weight: 700;
}

/* Form indicator */
.form-indicator {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.form-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.form-dot.win {
    background: var(--success-color);
}

.form-dot.draw {
    background: var(--warning-color);
}

.form-dot.loss {
    background: var(--danger-color);
}

.form-dot.neutral {
    background: var(--text-muted);
    opacity: 0.3;
}

/* Standings rules */
.standings-rules {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
}

.standings-rules h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.standings-rules p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.no-standings {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-standings i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.no-standings p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* Update league actions for two buttons */
.league-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.standings-btn, .fixtures-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.standings-btn:hover, .fixtures-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Mobile Responsive for Standings */
@media (max-width: 768px) {
    .standings-modal .modal-content {
        margin: 10px;
    }
    
    .standings-header {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .season-info {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .current-round, .total-rounds, .teams-count {
        width: 100%;
        text-align: center;
    }
    
    .standings-table {
        font-size: 0.8rem;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 8px 4px;
    }
    
    .team-col { width: 150px; }
    .stats-col { width: 40px; }
    .form-col { width: 80px; }
    
    .team-info {
        gap: 6px;
    }
    
    .team-logo-xs {
        width: 20px;
        height: 20px;
    }
    
    .team-name {
        font-size: 0.8rem;
    }
    
    .form-dot {
        width: 6px;
        height: 6px;
    }
    
    .standings-rules {
        padding: 16px;
    }
    
    .league-actions {
        gap: 4px;
    }
    
    .standings-btn, .fixtures-btn {
        padding: 6px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .standings-table {
        font-size: 0.75rem;
    }
    
    .team-col { width: 120px; }
    
    .standings-table th:nth-child(n+7),
    .standings-table td:nth-child(n+7) {
        display: none;
    }
}

/* Styles pour la nouvelle navigation par date */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    height: 44px;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn:disabled:hover {
    background: var(--card-bg);
    color: var(--text-color);
}

.date-selector {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    max-width: 200px;
}

.date-picker {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 40px 10px 12px;
    color: var(--text-color);
    font-size: 14px;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    min-width: 0;
}

.date-picker:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

.date-picker:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.date-label {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-date-display {
    text-align: center;
    margin: 8px 0 16px 0;
    font-size: 16px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.4;
    padding: 0 8px;
}

.keyboard-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
    padding: 0 8px;
}

/* Styles pour le dark theme */
.dark-theme .date-picker {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-theme .nav-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-theme .nav-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

/* Masquer le sélecteur de date natif */
.date-picker::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.date-picker::-moz-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.date-picker::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.date-picker::-webkit-datetime-edit {
    padding: 0;
}

.date-picker::-webkit-datetime-edit-text {
    padding: 0 2px;
}

/* Responsive avancé */
@media (max-width: 768px) {
    .date-navigation {
        gap: 8px;
        max-width: 100%;
        padding: 0 8px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        min-width: 42px;
        height: 42px;
    }
    
    .nav-btn i {
        font-size: 14px;
    }
    
    .date-selector {
        max-width: 180px;
    }
    
    .date-picker {
        padding: 8px 36px 8px 10px;
        font-size: 13px;
    }
    
    .date-label {
        right: 10px;
    }
    
    .date-label i {
        font-size: 14px;
    }
    
    .current-date-display {
        font-size: 15px;
        margin: 6px 0 14px 0;
    }
}

@media (max-width: 640px) {
    .date-navigation {
        gap: 6px;
    }
    
    .nav-btn {
        padding: 8px 10px;
        min-width: 40px;
        height: 40px;
    }
    
    .date-selector {
        max-width: 160px;
    }
    
    .date-picker {
        padding: 8px 34px 8px 8px;
        font-size: 12px;
    }
    
    .date-label {
        right: 8px;
    }
    
    .current-date-display {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .date-navigation {
        gap: 4px;
        padding: 0 6px;
    }
    
    .nav-btn {
        padding: 6px 8px;
        min-width: 38px;
        height: 38px;
    }
    
    .nav-btn i {
        font-size: 13px;
    }
    
    .date-selector {
        max-width: 140px;
    }
    
    .date-picker {
        padding: 6px 32px 6px 8px;
        font-size: 11px;
    }
    
    .date-label i {
        font-size: 13px;
    }
    
    .current-date-display {
        font-size: 13px;
        margin: 4px 0 12px 0;
    }
    
    .keyboard-hint {
        font-size: 11px;
        margin-top: 6px;
    }
}

@media (max-width: 400px) {
    .date-navigation {
        gap: 3px;
    }
    
    .nav-btn {
        padding: 5px 6px;
        min-width: 36px;
        height: 36px;
    }
    
    .nav-btn i {
        font-size: 12px;
    }
    
    .date-selector {
        max-width: 130px;
    }
    
    .date-picker {
        padding: 5px 30px 5px 6px;
        font-size: 10px;
    }
    
    .date-label {
        right: 6px;
    }
    
    .date-label i {
        font-size: 12px;
    }
    
    .current-date-display {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .date-navigation {
        gap: 2px;
        padding: 0 4px;
    }
    
    .nav-btn {
        padding: 4px 5px;
        min-width: 34px;
        height: 34px;
    }
    
    .nav-btn i {
        font-size: 11px;
    }
    
    .date-selector {
        max-width: 120px;
    }
    
    .date-picker {
        padding: 4px 28px 4px 6px;
        font-size: 9px;
    }
    
    .date-label i {
        font-size: 11px;
    }
    
    .current-date-display {
        font-size: 11px;
        margin: 3px 0 10px 0;
    }
    
    .keyboard-hint {
        font-size: 10px;
    }
}

/* Support pour l'orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .date-navigation {
        margin-bottom: 6px;
    }
    
    .current-date-display {
        margin: 4px 0 10px 0;
        font-size: 14px;
    }
    
    .nav-btn {
        padding: 6px 8px;
        height: 36px;
    }
}

/* Support pour les très grands écrans */
@media (min-width: 1440px) {
    .date-navigation {
        max-width: 450px;
    }
    
    .date-selector {
        max-width: 220px;
    }
    
    .date-picker {
        font-size: 15px;
        padding: 12px 42px 12px 14px;
    }
    
    .nav-btn {
        padding: 12px 16px;
        min-width: 48px;
        height: 48px;
    }
    
    .nav-btn i {
        font-size: 16px;
    }
}

/* Améliorations d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .nav-btn {
        transition: none;
    }
    
    .nav-btn:hover {
        transform: none;
    }
}

/* Support pour le mode contraste élevé */
@media (prefers-contrast: high) {
    .nav-btn {
        border-width: 2px;
    }
    
    .date-picker {
        border-width: 2px;
    }
    
    .nav-btn:hover:not(:disabled) {
        background: var(--text-color);
        color: var(--card-bg);
    }
}

/* Correction pour Safari iOS */
@supports (-webkit-touch-callout: none) {
    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .date-picker {
        font-size: 16px; /* Empêche le zoom sur iOS */
    }
}

.team-cards {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    justify-content: center;
}

.card {
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.yellow-card {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.red-card {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.match-cards-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.match-cards-summary i {
    color: #ff6b6b;
}

/* Stats Modal Styles - Theme Integrated */
.stats-modal .modal-content {
    max-width: 400px;
    max-height: 90vh;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.stats-modal .modal-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.stats-modal .modal-header h3 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    color: var(--text-color);
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.match-header-stats {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.league-info {
    text-align: center;
    margin-bottom: 15px;
}

.league-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.teams-stats-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.team-stats-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.team-logo-stats-compact {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.team-logo-stats-compact img,
.team-logo-stats-compact .team-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 600;
}

.team-name-stats-compact {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    color: var(--text-color);
}

.team-score-compact {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.match-status-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
}

.status-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.score-compact {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 2px;
    color: var(--text-color);
}

.half-scores {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Stats Main Grid */
.stats-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 15px;
    background: var(--bg-color);
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card.large-card {
    grid-column: 1 / -1;
}

.stat-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ball Possession */
.possession-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.possession-team {
    display: flex;
    align-items: center;
    gap: 10px;
}

.possession-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
    color: var(--text-color);
}

.possession-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.possession-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.home-fill {
    background: var(--primary-color);
}

.away-fill {
    background: #e74c3c;
}

/* Cards */
.cards-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cards-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.yellow-cards,
.red-cards {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-count {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
}

.card-icon {
    font-size: 0.9rem;
}

/* Conversion Rate */
.conversion-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.conversion-team {
    text-align: center;
    flex: 1;
}

.conversion-value {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Basic Stats */
.basic-stat-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.basic-stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    flex: 1;
    color: var(--text-color);
}

.home-value {
    color: var(--primary-color);
}

.away-value {
    color: #e74c3c;
}

/* Substitutions */
.substitutions-section {
    background: var(--card-bg);
    padding: 15px;
    margin: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-color);
}

.substitutions-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.substitutions-column {
    flex: 1;
}

.substitution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.substitution-item:last-child {
    border-bottom: none;
}

.substitution-player {
    flex: 1;
    color: var(--text-color);
}

.substitution-minute {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 25px;
    text-align: right;
}

/* Loading and Error States */
.stats-modal .loading {
    background: var(--card-bg);
    color: var(--text-muted);
    padding: 40px 20px;
    text-align: center;
}

.stats-modal .loading i {
    color: var(--primary-color);
}

.no-stats-available,
.error-modal {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--card-bg);
}

.no-stats-available i,
.error-modal i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.error-modal h3 {
    margin-bottom: 15px;
    color: #e74c3c;
}

.error-modal p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.retry-btn:hover {
    background: var(--primary-dark);
}

/* Modal Body */
.stats-modal .modal-body {
    background: var(--bg-color);
}

/* Responsive Design */
@media (max-width: 480px) {
    .stats-modal .modal-content {
        margin: 0;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .stats-main-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .team-logo-stats-compact {
        width: 35px;
        height: 35px;
    }
    
    .team-name-stats-compact {
        font-size: 0.65rem;
    }
    
    .score-compact {
        font-size: 1.2rem;
    }
    
    .match-header-stats,
    .substitutions-section {
        margin: 10px;
        padding: 12px;
    }
}

/* Match Card Stats Button */
.match-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.stats-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stats-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Theme-specific enhancements */
.light-theme .stats-modal .modal-content {
    background: #ffffff;
}

.light-theme .stats-main-grid {
    background: #f8f9fa;
}

.light-theme .stat-card {
    background: #ffffff;
    border-color: #e9ecef;
}

.light-theme .possession-bar {
    background: #e9ecef;
}

.dark-theme .stats-modal .modal-content {
    background: #1e293b;
}

.dark-theme .stats-main-grid {
    background: #0f172a;
}

.dark-theme .stat-card {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .possession-bar {
    background: #334155;
}

.dark-theme .team-logo-stats-compact .team-logo-fallback {
    background: #334155;
    color: #e2e8f0;
}

/* Ensure smooth theme transitions */
.stats-modal .modal-content,
.stat-card,
.match-header-stats,
.substitutions-section,
.stats-modal .modal-body,
.stats-main-grid {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Box sizing */
.stats-modal * {
    box-sizing: border-box;
}

/* Lineups Modal Styles */
.lineups-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.lineups-header {
    padding: 15px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.formation-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.formation-home, .formation-away {
    display: flex;
    align-items: center;
    gap: 10px;
}

.formation-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.formation-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.lineups-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: var(--bg-color);
}

.lineup-team {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.team-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.manager-info {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.manager-label {
    font-weight: bold;
}

.lineup-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    font-weight: 600;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
}

.player-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.player-card.substitute {
    opacity: 0.8;
    border-left-color: var(--text-secondary);
}

.player-card.goalkeeper { 
    border-left-color: #FF6B6B; 
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1) 0%, transparent 100%);
}

.player-card.defender { 
    border-left-color: #4ECDC4; 
    background: linear-gradient(90deg, rgba(78, 205, 196, 0.1) 0%, transparent 100%);
}

.player-card.midfielder { 
    border-left-color: #45B7D1; 
    background: linear-gradient(90deg, rgba(69, 183, 209, 0.1) 0%, transparent 100%);
}

.player-card.forward { 
    border-left-color: #FFA07A; 
    background: linear-gradient(90deg, rgba(255, 160, 122, 0.1) 0%, transparent 100%);
}

.player-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

.player-position {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.position-abbr {
    font-weight: bold;
}

.substitutions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.substitution-item {
    padding: 10px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.substitution-arrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sub-out, .sub-in {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.sub-out {
    justify-content: flex-end;
    text-align: right;
}

.sub-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--primary-color);
}

.sub-minute {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-color);
}

.sub-out .player-name,
.sub-in .player-name {
    font-size: 0.8rem;
    color: var(--text-color);
}

.sub-out .player-number,
.sub-in .player-number {
    background: var(--text-secondary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Loading and Error States */
.lineups-modal .loading {
    background: var(--card-bg);
    color: var(--text-muted);
    padding: 40px 20px;
    text-align: center;
}

.lineups-modal .loading i {
    color: var(--primary-color);
}

.no-lineups-available {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--card-bg);
}

.no-lineups-available i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.no-lineups-available h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.no-lineups-available p {
    margin-bottom: 25px;
    opacity: 0.9;
}

/* Match Card Buttons */
.match-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.lineups-btn, .stats-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lineups-btn {
    background: var(--secondary-color);
    color: white;
}

.lineups-btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stats-btn {
    background: var(--primary-color);
    color: white;
}

.stats-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Theme-specific enhancements */
.light-theme .lineups-modal .modal-content {
    background: #ffffff;
}

.light-theme .lineups-content {
    background: #f8f9fa;
}

.light-theme .lineup-team {
    background: #ffffff;
    border-color: #e9ecef;
}

.light-theme .player-card {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.light-theme .substitution-item {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.dark-theme .lineups-modal .modal-content {
    background: #1e293b;
}

.dark-theme .lineups-content {
    background: #0f172a;
}

.dark-theme .lineup-team {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .player-card {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .substitution-item {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .team-logo-small .team-logo-fallback {
    background: #334155;
    color: #e2e8f0;
}

/* Ensure smooth theme transitions */
.lineups-modal .modal-content,
.lineup-team,
.player-card,
.substitution-item,
.lineups-modal .modal-body,
.lineups-content,
.lineups-header {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lineups-modal .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .lineups-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .formation-display {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .team-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .manager-info {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .lineups-modal .modal-content {
        margin: 0;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .lineup-team {
        padding: 12px;
    }
    
    .player-card {
        padding: 6px 10px;
    }
    
    .player-number {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
    
    .player-name {
        font-size: 0.8rem;
    }
    
    .lineups-btn, .stats-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .substitution-arrow {
        flex-direction: column;
        gap: 5px;
    }
    
    .sub-out, .sub-in {
        justify-content: center;
        text-align: center;
    }
}

/* Box sizing */
.lineups-modal * {
    box-sizing: border-box;
}

/* Team logo styles */
.team-logo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
}

.team-logo-small img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.team-logo-small .team-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.team-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}


/* Match Modal Tabs */
.match-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    color: var(--text-color);
    background-color: var(--hover-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Match Card Cursor */
.match-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
