/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0a0e17;
    --secondary-bg: #1a1f2e;
    --card-bg: #1e2433;
    --hover-bg: #252b3d;
    --border-color: #2a3040;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-blue: #3b82f6;
    --live-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4055;
}

/* Header Styles */
.app-header {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.app-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Date Navigation */
.date-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.date-nav::-webkit-scrollbar {
    display: none;
}

.date-btn {
    padding: 0.5rem 1.25rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.date-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.date-btn.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

/* Match Cards */
.match-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-card:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.match-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-card.live::before {
    opacity: 1;
    animation: pulse 2s infinite;
}

.match-card.finished::before {
    opacity: 1;
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 1rem;
    color: var(--live-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--live-color);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Score Display */
.score-display {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.score-display.live {
    color: var(--accent-green);
}

/* Match Detail Modal */
.match-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.match-detail-modal {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn.active {
    color: var(--accent-green);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-green);
}

/* Statistics Bars */
.stat-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.stat-bar-fill {
    height: 100%;
    background: var(--accent-green);
    transition: width 0.5s ease;
}

/* Team Formation Display */
.formation-field {
    background: linear-gradient(to bottom, #1e3a1e 0%, #2d5a2d 100%);
    border: 2px solid #3d7a3d;
    border-radius: 1rem;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.formation-field::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.formation-field .center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Player Position on Field */
.player-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 40px;
}

.player-marker .jersey {
    width: 28px;
    height: 28px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin: 0 auto 4px;
}

.player-marker .name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem 0;
    }
    
    .match-card {
        padding: 0.75rem;
    }
    
    .score-display {
        font-size: 1.25rem;
    }
    
    .match-detail-modal {
        width: 95%;
        max-height: 95vh;
    }
}

/* Animations */
.match-enter {
    animation: matchEnter 0.5s ease;
}

@keyframes matchEnter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--secondary-bg) 25%, var(--hover-bg) 50%, var(--secondary-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Notification Toast */
.toast-notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--accent-green);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.3s ease;
    z-index: 1000;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}