/**
 * /assets/css/styles.css - Main stylesheet for GameDay Analytics
 * Version: 1.0.0
 * Changelog:
 * - v1.0.0: Initial creation with CSS variables and mobile-first design
 */

/* CSS Variables for Theme */
:root {
    --color-primary: #667eea;
    --color-primary-dark: #5a67d8;
    --color-secondary: #764ba2;
    --color-success: #4CAF50;
    --color-warning: #ff9800;
    --color-danger: #f44336;
    --color-info: #2196F3;
    
    --color-text-primary: #333;
    --color-text-secondary: #666;
    --color-text-muted: #999;
    
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f5f5f5;
    --color-bg-tertiary: #f8f9fa;
    
    --color-border: #e0e0e0;
    --color-border-light: #f0f0f0;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 6px 20px rgba(0,0,0,0.15);
    
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 20px;
    
    --transition-default: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-default);
}

a:hover {
    color: var(--color-primary-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Styles (matching nav.php) */
header {
    background: var(--color-bg-primary);
    border-bottom: 2px solid var(--color-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: var(--transition-default);
}

.logo:hover {
    color: var(--color-text-secondary);
}

.nav-links {
    display: flex;
    gap: 35px;
    list-style: none;
    align-items: center;
}

.nav-links > li > a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-default);
    padding: 5px 0;
}

.nav-links > li > a:hover {
    color: var(--color-text-primary);
}

/* Hero Section */
.hero {
    background: var(--color-bg-primary);
    padding: 60px 0;
    margin-bottom: 40px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--color-text-primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto 40px auto;
}

.stat-card {
    background: var(--color-bg-primary);
    padding: 25px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-default);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Title */
.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--color-text-primary);
    text-align: center;
}

/* Trends Grid */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Trend Card */
.trend-card {
    background: var(--color-bg-primary);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition-default);
}

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.trend-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.trend-icon {
    font-size: 1.75rem;
}

.trend-card p {
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.trend-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.trend-stat {
    text-align: center;
}

.trend-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text-primary);
}

.trend-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.trend-percentage {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--color-success);
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius-xl);
    font-weight: bold;
    font-size: 1rem;
}

.trend-percentage.negative {
    background: var(--color-danger);
}

.trend-percentage.neutral {
    background: var(--color-warning);
}

/* Teams Comparison */
.teams-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.teams-section {
    background: var(--color-bg-primary);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.teams-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border-light);
    padding-bottom: 10px;
}

.teams-list {
    margin-top: 20px;
}

.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--color-border-light);
    transition: var(--transition-default);
}

.team-row:hover {
    background: var(--color-bg-tertiary);
}

.team-row:last-child {
    border-bottom: none;
}

.team-rank {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--color-text-muted);
    width: 40px;
}

.team-name {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-left: 10px;
}

.team-stats {
    display: flex;
    gap: 30px;
}

.team-stat {
    text-align: center;
}

.team-stat-value {
    font-size: 1.125rem;
    font-weight: bold;
    color: var(--color-text-primary);
}

.team-stat-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--color-text-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition-default);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #555;
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-success {
    background: var(--color-success);
}

.btn-danger {
    background: var(--color-danger);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition-default);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Footer (matching footer.php) */
.footer {
    background: linear-gradient(to bottom, var(--color-bg-primary), var(--color-bg-tertiary));
    margin-top: auto;
    border-top: 3px solid var(--color-border);
    font-size: 0.875rem;
    padding-top: 50px;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 50px 0 40px 0;
}

.footer-section h4 {
    color: var(--color-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: var(--transition-default);
    position: relative;
}

.footer-section a:hover {
    color: var(--color-success);
    padding-left: 5px;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 300px;
        height: calc(100vh - 70px);
        background: var(--color-bg-primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 30px;
        gap: 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s;
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }
    
    .mobile-menu-btn span {
        width: 25px;
        height: 3px;
        background: var(--color-text-primary);
        border-radius: 2px;
        transition: var(--transition-default);
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trends-grid {
        grid-template-columns: 1fr;
    }
    
    .teams-comparison {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .team-stats {
        gap: 15px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 0;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.125rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .trend-stats {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    left: -9999px;
    z-index: 9999;
}

.skip-to-content:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    background: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
}