/* DiamondEdge — Modern Sports Analytics */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
    /* Light, clean palette */
    --bg-primary: #f8fafc;
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    /* Brand */
    --brand-blue: #3b82f6;
    --brand-blue-dark: #2563eb;
    --brand-blue-light: #60a5fa;
    
    /* Semantic */
    --green: #10b981;
    --green-light: #d1fae5;
    --red: #ef4444;
    --red-light: #fee2e2;
    --yellow: #f59e0b;
    --yellow-light: #fef3c7;
    
    /* Borders & Shadows */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: color 0.15s;
}

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

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* Navigation */
.nav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-6);
    height: 64px;
    display: flex;
    align-items: center;
    gap: var(--space-8);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.nav-logo svg {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    gap: var(--space-2);
}

.nav-links a {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.nav-links a:hover {
    background: var(--bg-gray-50);
    color: var(--text-primary);
}

.nav-links a.active {
    background: var(--brand-blue);
    color: white;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

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

/* Game Cards */
.game-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.game-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--brand-blue);
}

.game-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.team {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.team-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.team-name {
    font-size: 1.125rem;
    font-weight: 700;
}

.vs {
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 0.875rem;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-gray-50);
}

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

.stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-1);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background: var(--green-light);
    color: var(--green);
}

.badge-red {
    background: var(--red-light);
    color: var(--red);
}

.badge-yellow {
    background: var(--yellow-light);
    color: var(--yellow);
}

/* Tables - Minimal, Clean */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-gray-50);
    border-bottom: 2px solid var(--border);
}

tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

tbody tr:hover {
    background: var(--bg-gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

.r { text-align: right; }
.c { text-align: center; }

/* Utility Classes */
.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.bold { font-weight: 600; }
.green { color: var(--green); }
.red { color: var(--red); }
.muted { color: var(--text-tertiary); }
.secondary { color: var(--text-secondary); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.tiny { font-size: 0.6875rem; }

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Section */
.section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--border);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    color: var(--text-tertiary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Page Header */
.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* Legacy compatibility */
:root {
    --navy: #1e293b;
    --bg: #ffffff;
    --bg-alt: var(--bg-gray-50);
    --border-light: var(--border-light);
    --text: var(--text-primary);
    --text-muted: var(--text-secondary);
    --text-light: var(--text-tertiary);
    --accent: var(--brand-blue);
    --font: var(--font-sans);
}

.lineup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

@media (max-width: 768px) {
    .lineup-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Container padding */
    .container {
        padding: var(--space-4);
    }
    
    /* Hero section */
    div[style*="padding:80px 0 100px"] {
        padding: 40px 0 60px !important;
    }
    
    div[style*="font-size:4rem"] {
        font-size: 2rem !important;
    }
    
    div[style*="font-size:3.5rem"] {
        font-size: 2rem !important;
    }
    
    div[style*="font-size:1.25rem"] {
        font-size: 1rem !important;
    }
    
    /* Navigation - stack vertically */
    .nav {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-4);
        gap: var(--space-4);
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        margin-left: 0 !important;
        gap: var(--space-1);
    }
    
    .nav-links a {
        width: 100%;
        text-align: left;
    }
    
    /* Typography scaling */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    /* Cards - reduce padding */
    .card {
        padding: var(--space-4);
    }
    
    .section {
        padding: var(--space-4);
    }
    
    /* Game cards - smaller logos */
    .team-logo {
        width: 36px;
        height: 36px;
    }
    
    /* Tables - smaller text, wrapped in scrollable container */
    table {
        font-size: 0.8125rem;
    }
    
    thead th {
        padding: var(--space-2) var(--space-3);
        font-size: 0.6875rem;
    }
    
    tbody td {
        padding: var(--space-2) var(--space-3);
        font-size: 0.8125rem;
    }
    
    /* K distribution table - allow horizontal scroll */
    .section {
        overflow-x: auto;
    }
    
    /* Home page hero */
    .page-title {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    .page-subtitle {
        font-size: 0.9375rem !important;
    }
    
    /* Stats banner - reduce padding */
    div[style*="padding:48px"] {
        padding: 24px !important;
    }
    
    /* Feature cards - reduce padding */
    a[class="card"][style*="padding:40px"] {
        padding: 24px !important;
    }
    
    a[class="card"][style*="padding:32px"] {
        padding: 20px !important;
    }
    
    /* Icon boxes - smaller */
    div[style*="width:56px;height:56px"] {
        width: 48px !important;
        height: 48px !important;
    }
    
    div[style*="width:48px;height:48px"] svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Game card grid - adjust min width */
    div[style*="minmax(360px"] {
        grid-template-columns: 1fr !important;
    }
    
    div[style*="minmax(340px"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    /* Extra small screens - even more compact */
    .container {
        padding: var(--space-3);
    }
    
    h1 { font-size: 1.5rem; }
    
    /* Navigation - more compact */
    .nav {
        padding: var(--space-3);
    }
    
    .nav-logo {
        font-size: 1rem;
    }
    
    .nav-logo svg {
        width: 24px;
        height: 24px;
    }
    
    /* Game cards - even smaller */
    .game-card {
        font-size: 0.875rem;
    }
    
    .team-logo {
        width: 32px;
        height: 32px;
    }
    
    /* Tables - more compact */
    table {
        font-size: 0.8125rem;
    }
    
    thead th {
        padding: var(--space-2);
        font-size: 0.625rem;
    }
    
    tbody td {
        padding: var(--space-2);
    }
    
    /* Buttons - full width */
    a[style*="padding:16px 40px"],
    a[style*="padding:16px 32px"] {
        padding: 14px 28px !important;
        font-size: 1rem !important;
    }
    
    /* Button containers - stack on mobile */
    div[style*="display:flex;gap:16px;justify-content:center"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    div[style*="display:flex;gap:16px;justify-content:center"] a {
        width: 100% !important;
        text-align: center !important;
    }
}
