/* ==================== CSS Variables ==================== */
:root {
    /* Colors */
    --primary-color: #00d4ff;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #0a0e27;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-bg: linear-gradient(180deg, #0a0e27 0%, #1a1f3a 100%);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ==================== Header ==================== */
.header {
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 2rem;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(239, 68, 68, 0.2);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-weight: 600;
    font-size: 0.9rem;
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* ==================== Hero Section ==================== */
.hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    margin-bottom: var(--spacing-lg);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== Main Content ==================== */
.main-content {
    padding: var(--spacing-lg) 0;
    min-height: 60vh;
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-container {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.retry-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: var(--spacing-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* No Matches State */
.no-matches {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.no-matches-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

/* ==================== Matches Container ==================== */
.matches-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.league-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.league-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--card-border);
}

.league-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.league-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.league-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.matches-grid {
    display: grid;
    gap: var(--spacing-md);
}

/* ==================== Match Card ==================== */
.match-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.match-card:hover::before {
    opacity: 0.1;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.match-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 212, 255, 0.1);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.match-time .time {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.match-time .date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.match-status {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

.status-not-started {
    background: rgba(160, 174, 192, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 174, 192, 0.3);
}

.status-live {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse 2s ease infinite;
}

.status-finished {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--spacing-md);
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.team-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.match-card:hover .team-logo {
    transform: scale(1.1);
}

.team-name {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

.vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-secondary);
    opacity: 0.5;
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--card-border);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.channel-icon {
    font-size: 1.2rem;
}

.watch-btn {
    background: var(--gradient-success);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.watch-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.watch-btn:hover::before {
    width: 300px;
    height: 300px;
}

.watch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

.watch-btn:active {
    transform: translateY(0);
}

.watch-btn.disabled {
    background: rgba(160, 174, 192, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

.watch-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ==================== Footer ==================== */
.footer {
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--card-border);
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-top: var(--spacing-xl);
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.footer-note {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .match-teams {
        gap: var(--spacing-sm);
    }
    
    .team-logo {
        width: 50px;
        height: 50px;
    }
    
    .team-name {
        font-size: 0.9rem;
    }
    
    .vs {
        font-size: 1.2rem;
    }
    
    .match-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .watch-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .match-card {
        padding: var(--spacing-sm);
    }
    
    .team-logo {
        width: 40px;
        height: 40px;
    }
}
