/* Global Styles */
:root {
    --primary-color: #1a472a;
    --secondary-color: #d50a0a;
    --accent-color: #fb4f14;
    --background: #0a0e27;
    --surface: #141b3d;
    --surface-light: #1f2847;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #2d3748;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--surface);
    border-bottom: 2px solid var(--accent-color);
    padding: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.header-content {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fb4f14 0%, #d50a0a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.nav-link {
    padding: 0.75rem 2rem;
    background: var(--surface-light);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    min-width: 160px;
}

.nav-link:hover {
    border-color: var(--accent-color);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(251, 79, 20, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(251, 79, 20, 0.4);
}

.api-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 2s infinite;
}

.status-indicator.healthy {
    background: var(--success);
    animation: none;
}

.status-indicator.error {
    background: var(--error);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
main {
    padding: 2rem 0;
}

section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Week Selector */
.week-selector {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.week-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.week-select {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.week-select:hover,
.week-select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(251, 79, 20, 0.4);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    background: var(--surface);
}

/* Predictions Section */
.predictions-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 16px rgba(251, 79, 20, 0.3);
}

.game-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.game-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.teams-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
}

.team {
    text-align: center;
    flex: 1;
}

.team-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

.vs-separator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 1rem;
}

.prediction-box {
    background: rgba(251, 79, 20, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.predicted-winner {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.confidence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confidence-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.confidence-high {
    background: var(--success);
    color: white;
}

.confidence-medium {
    background: var(--warning);
    color: white;
}

.confidence-low {
    background: var(--text-secondary);
    color: white;
}

.spread-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 2rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error);
    border-radius: 12px;
    color: var(--error);
}

/* Statistics Section */
.stats-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--surface-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-4px);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Insights Section */
.insights-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.insights-list {
    display: grid;
    gap: 1rem;
}

.insight-item {
    background: var(--surface-light);
    padding: 1.5rem;
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.insight-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 2px solid var(--accent-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--secondary-color);
}

.disclaimer {
    font-size: 0.85rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .week-controls {
        flex-direction: column;
    }
    
    .week-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .teams-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vs-separator {
        transform: rotate(90deg);
    }
}
