* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: rgba(148, 163, 184, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.9)), url("https://images.unsplash.com/photo-1489944440615-453fc2b6a9a9?w=1920&q=80");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    padding: 20px;
    transition: background 0.5s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px 40px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
    font-weight: 500;
}

.status-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-icon {
    font-size: 1.3rem;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Content */
.content {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.refresh-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    padding: 15px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

tbody td {
    padding: 18px 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

tbody tr td:first-child {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

tbody tr td:nth-child(2) {
    font-weight: 600;
    color: var(--text-primary);
}

tbody tr td:last-child {
    font-weight: 800;
    color: var(--success);
    font-size: 1.1rem;
}

tbody tr:nth-child(1) td:first-child {
    color: #fbbf24;
}

tbody tr:nth-child(2) td:first-child {
    color: #d4d4d8;
}

tbody tr:nth-child(3) td:first-child {
    color: #cd7f32;
}

/* Scorers Grid */
.scorers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.scorer-card {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scorer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.scorer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
}

.scorer-rank {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.scorer-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.scorer-goals {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fixture-date,
.fixture-time {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.fixture-score {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.05em;
}

.played-match {
    border-left: 3px solid var(--success);
}

/* Chart */
#market-chart {
    max-height: 500px;
}

/* Loader */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-row td {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tech-stack {
    margin-top: 8px;
    color: rgba(203, 213, 225, 0.5);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }

    .tabs {
        flex-direction: column;
    }

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

/* Statistics Section */
.stats-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats-tab-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stats-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.stats-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.stats-content {
    display: none;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.stat-card.top-3 {
    border-left: 4px solid var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.stat-rank {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
}

.stat-info {
    flex: 1;
}

.stat-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: white;
    margin-bottom: 4px;
}

.stat-team {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.stat-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 10px 16px;
    border-radius: 10px;
    min-width: 50px;
    text-align: center;
}

/* Table coloring */
.top-team {
    background: rgba(34, 197, 94, 0.08) !important;
}

.bottom-team {
    background: rgba(239, 68, 68, 0.08) !important;
}

.positive {
    color: #22c55e !important;
}

.negative {
    color: #ef4444 !important;
}

.wins {
    color: #22c55e;
    font-weight: 600;
}

.losses {
    color: #ef4444;
}

.points {
    font-weight: 700 !important;
    font-size: 1.1rem;
    color: var(--primary) !important;
}

/* Fixtures */
#fixtures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
}

.fixture-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 25px;
    transition: all 0.3s ease;
}

.fixture-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fixture-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.home-team,
.away-team {
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
}

.vs {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 6px;
}

.fixture-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.fixture-date,
.fixture-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fixture-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #22c55e;
    text-align: center;
    padding: 8px 20px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(34, 197, 94, 0.3);
}

.played-match {
    border-left: 4px solid #22c55e;
}

@media (max-width: 768px) {
    .stats-tabs {
        justify-content: center;
    }

    .stats-tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .stats-grid,
    .fixtures-grid {
        grid-template-columns: 1fr;
    }
}

/* Zone Colors for Standings */
.zone-ucl {
    border-left: 4px solid #3b82f6 !important;
    background: rgba(59, 130, 246, 0.08) !important;
}

.zone-uel {
    border-left: 4px solid #f97316 !important;
    background: rgba(249, 115, 22, 0.08) !important;
}

.zone-uecl {
    border-left: 4px solid #22c55e !important;
    background: rgba(34, 197, 94, 0.08) !important;
}

.zone-relegation {
    border-left: 4px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

/* Zone Legend */
.zone-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.ucl {
    background: #3b82f6;
}

.legend-color.uel {
    background: #f97316;
}

.legend-color.uecl {
    background: #22c55e;
}

.legend-color.relegation {
    background: #ef4444;
}

.legend-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Form Badges */
.form-cell {
    display: flex;
    gap: 4px;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.form-win {
    background: #22c55e;
    color: white;
}

.form-draw {
    background: #6b7280;
    color: white;
}

.form-loss {
    background: #ef4444;
    color: white;
}

/* Fixture Card Updates */
.fixture-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    transition: all 0.3s ease;
}

.fixture-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.fixture-team {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}

.fixture-team.away {
    align-items: flex-end;
}

.fixture-team .team-form-box {
    display: flex;
    gap: 3px;
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.fixture-team .team-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fixture-team .team-rank-box {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.fixture-team .team-name {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.fixture-team .team-form .form-badge {
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
}

/* AI Prediction */
.ai-prediction {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ai-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.ai-result {
    font-weight: 700;
    font-size: 0.95rem;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    padding: 4px 12px;
    border-radius: 6px;
}

.ai-result.draw {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.ai-confidence {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.ai-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .zone-legend {
        flex-direction: column;
        gap: 10px;
    }

    .fixture-team-row {
        flex-direction: column;
        gap: 10px;
    }

    .fixture-team.home,
    .fixture-team.away {
        align-items: center;
    }
}