/*
 * TSBBL Base Styles
 * Core variables, reset, and typography
 */

/* ============================================
   CSS Variables - Theme Colors
   ============================================ */
:root {
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #6a6a6a;
    --border-color: #d0d0d0;
    --link-color: #1e40af;
    --link-hover: #1e3a8a;
    --code-bg: #f0f0f0;
    --shadow: rgba(0, 0, 0, 0.1);

    /* League accent colors (purple/teal) */
    --accent-primary: #6366f1;
    --accent-secondary: #14b8a6;

    /* Team colors - these get overridden on team pages */
    --team-primary: #808080;
    --team-secondary: #a0a0a0;
    --team-tertiary: #c0c0c0;
    --team-text-on-primary: #ffffff;

    /* Status colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
}

[data-theme="dark"] {
    /* Dark mode colors - purple/teal theme */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --text-primary: #e8e8f0;
    --text-secondary: #d4d4dc;
    --text-muted: #a8a8b8;
    --border-color: #3a3a5a;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --code-bg: #252542;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* ============================================
   Code
   ============================================ */
code, pre {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background-color: var(--code-bg);
    border-radius: 4px;
}

code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    padding: 0;
    background: none;
}

/* ============================================
   Lists
   ============================================ */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5rem;
}

/* List without bullets */
.list-unstyled {
    list-style: none;
    padding-left: 0;
}

/* ============================================
   Tables
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Zebra striping */
tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* Tabular numbers for stats */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Text colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font weight */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

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

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }

/* Flex utilities */
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

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