/* CSS Variables */
:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --dark: #1a1a2e;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Eye Test Colors (dark theme) */
    --et-text: #ffffff;                /* Primary text (white) */
    --et-text-secondary: #d5dce3;      /* Team names, reviewer names - TESTING RED */
    --et-text-muted: #a1a6ae;          /* Rankings, conferences, sub-scores (slate-400) */
    --et-accent: #c4b5fd;              /* Score highlights (violet-300) */
    --et-win: #34d399;                 /* Winning scores (emerald-400) */
    --et-loss: #f87171;                /* Loss indicator (red-400) */
}

/* Eye Test Link Styles */
.et-link {
    color: var(--et-text-muted);
    transition: color 0.15s ease;
}
.et-link:hover {
    color: var(--et-text);
}
.et-link-secondary {
    color: var(--et-text-secondary);
    transition: color 0.15s ease;
}
.et-link-secondary:hover {
    color: var(--et-accent);
}
.et-link-text {
    color: var(--et-text);
    transition: color 0.15s ease;
}
.et-link-text:hover {
    color: var(--et-accent);
}

/* Eye Test Colors Reference (original values)
--et-text: #ffffff;                Primary text (white)
--et-text-secondary: #cbd5e1;      Team names, reviewer names (slate-300)
--et-text-muted: #94a3b8;          Rankings, conferences, sub-scores (slate-400)
--et-accent: #c4b5fd;              Score highlights (violet-300)
--et-win: #34d399;                 Winning scores (emerald-400)
--et-loss: #f87171;                Loss indicator (red-400)
*/

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

body {
    margin: 0;
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
}

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

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.logo-icon { font-size: 1.5rem; }

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
    gap: 5px;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
}
.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-year {
    margin-left: 20px;
}
.nav-year select {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
}
.nav-year select option {
    background: var(--dark);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 160px);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 30px;
}
.page-header h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin: 0 0 10px;
}
.page-header .subtitle {
    color: var(--gray-600);
    font-size: 1.1rem;
    margin: 0;
}

/* Section */
.section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}
.section h2 {
    margin: 0 0 15px;
    font-size: 1.5rem;
    color: var(--dark);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 10px;
}
.section-desc {
    color: var(--gray-600);
    margin: 0 0 20px;
}

/* Week Tabs */
.week-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.week-tab {
    padding: 8px 16px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.week-tab:hover {
    background: var(--gray-300);
    text-decoration: none;
}
.week-tab.active {
    background: var(--primary);
    color: white;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-group label {
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.9rem;
}
.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    min-width: 180px;
}
.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Rankings Table */
.rankings-table-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.rankings-table {
    width: 100%;
    border-collapse: collapse;
}
.rankings-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rankings-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
}
.rankings-table tbody tr:nth-child(even) {
    background: var(--gray-100);
}
.rankings-table tbody tr:hover {
    background: #e8f4fc;
}
.rankings-table tbody tr.hidden {
    display: none;
}

/* Rank styling */
.rank-number {
    font-weight: 700;
    font-size: 1.1rem;
}
.rank-change {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
}
.rank-change.up {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}
.rank-change.down {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}
.rank-change.new {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
}

/* Special ranks */
tr.rank-1 { background: linear-gradient(90deg, #ffd700 0%, #fffacd 30%, white 100%) !important; }
tr.rank-2 { background: linear-gradient(90deg, #c0c0c0 0%, #e8e8e8 30%, white 100%) !important; }
tr.rank-3 { background: linear-gradient(90deg, #cd7f32 0%, #edd7b9 30%, white 100%) !important; }
tr.champion { background: linear-gradient(90deg, #ffd700 0%, #fff8dc 20%, white 100%) !important; }
tr.champion td:first-child::before { content: "🏆 "; }

/* Team Link */
.team-link {
    color: var(--primary);
    font-weight: 500;
}
.team-link:hover { text-decoration: underline; }

/* Result colors */
.result-win { color: var(--success); font-weight: 500; }
.result-loss { color: var(--danger); font-weight: 500; }
.result-bye { color: var(--gray-500); font-style: italic; }
.result-upcoming { color: var(--primary); }

/* SOS colors */
.sos-high { color: var(--success); font-weight: 500; }
.sos-low { color: var(--danger); }

/* Color utilities */
.positive { color: var(--success); }
.negative { color: var(--danger); }

/* Show more button */
.show-more-container {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover {
    background: var(--gray-300);
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

/* Team Hero */
.team-hero {
    background: linear-gradient(135deg, var(--team-color, var(--primary)) 0%, var(--secondary) 100%);
    color: white;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.team-hero h1 {
    font-size: 2.5rem;
    margin: 0 0 5px;
}
.team-conference {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}
.team-stats-grid {
    display: flex;
    gap: 20px;
}
.team-stat-card {
    background: rgba(255,255,255,0.15);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
}
.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Game Cards */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.game-card {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--gray-400);
    gap: 15px;
}
.game-card.win { border-left-color: var(--success); }
.game-card.loss { border-left-color: var(--danger); }

.game-week {
    width: 60px;
    text-align: center;
}
.week-num {
    display: block;
    font-weight: 600;
    color: var(--gray-600);
}
.game-date {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.game-result-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
}
.game-result-icon.win {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}
.game-result-icon.loss {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.game-opponent {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.opponent-location {
    color: var(--gray-500);
    font-size: 0.9rem;
}
.opponent-rank {
    color: var(--gray-600);
    font-size: 0.85rem;
}
.opponent-name {
    font-weight: 600;
    color: var(--dark);
}
.opponent-name:hover { color: var(--primary); }

.game-score {
    width: 70px;
    text-align: center;
    font-weight: 500;
}

.game-points {
    width: 80px;
    text-align: center;
    position: relative;
}
.points-value {
    font-size: 1.2rem;
    font-weight: 700;
}
.points-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.game-rank-change {
    width: 120px;
    text-align: center;
    font-size: 0.9rem;
}
.rank-before, .rank-after { color: var(--gray-600); }
.rank-arrow { color: var(--gray-400); margin: 0 3px; }
.rank-delta {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
}
.rank-delta.up {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}
.rank-delta.down {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}
.tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 12px 15px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    min-width: 260px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}
.tooltip:hover .tooltip-content {
    display: block;
}
.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border: 8px solid transparent;
    border-top-color: var(--dark);
}
.tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tooltip-row:last-child { border-bottom: none; }
.tooltip-row.total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* Season Total */
.season-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
}
.total-label {
    font-weight: 600;
    font-size: 1.1rem;
}
.total-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* Rank Chart */
.rank-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 200px;
    padding: 20px 0;
}
.rank-week {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.rank-bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5px;
    min-height: 20px;
}
.rank-value {
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}
.week-label {
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Conference Cards */
.conf-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.conf-overview-card {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}
.conf-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.conf-change-display {
    font-size: 1.8rem;
    font-weight: 700;
}
.conf-range {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 10px 0;
}
.conf-arrow { margin: 0 5px; }
.conf-teams-count {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Conference Table */
.table-wrapper {
    overflow-x: auto;
}
.conf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.conf-table th, .conf-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}
.conf-table th {
    background: var(--gray-100);
    font-weight: 600;
}
.conf-table th:first-child,
.conf-table td:first-child {
    text-align: left;
}
.conf-name-cell { font-weight: 600; }

/* Conference Standings Grid */
.conf-standings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.conf-standings-card {
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 20px;
}
.conf-standings-card h3 {
    margin: 0 0 15px;
    font-size: 1.1rem;
    color: var(--dark);
}
.standings-table {
    width: 100%;
    font-size: 0.85rem;
}
.standings-table th, .standings-table td {
    padding: 8px 10px;
    text-align: left;
}
.standings-table th {
    font-weight: 600;
    border-bottom: 2px solid var(--gray-300);
}
.standings-table td {
    border-bottom: 1px solid var(--gray-300);
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}
.team-card {
    display: block;
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}
.team-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.team-card.hidden { display: none; }
.team-card-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.team-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 5px 0;
    color: var(--dark);
}
.team-card-conf {
    font-size: 0.85rem;
    color: var(--gray-600);
}
.team-card-record {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-top: 10px;
}
.team-card-points {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Methodology */
.methodology-section h2 {
    color: var(--primary);
}
.methodology-list {
    padding-left: 20px;
}
.methodology-list li {
    margin-bottom: 10px;
}
.formula-card {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 15px 0;
}
.formula-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}
.formula-row:last-child { border-bottom: none; }
.formula-label { color: var(--gray-700); }
.formula-value { font-weight: 600; }
.formula-code {
    font-family: var(--font-mono);
    background: var(--dark);
    color: #88cc88;
    padding: 15px;
    border-radius: var(--radius-sm);
}
.formula-note {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-style: italic;
    margin: 10px 0 0;
}

.example-card {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius-md);
}
.example-card h3 {
    margin: 0 0 15px;
    color: var(--dark);
}
.example-table {
    width: 100%;
}
.example-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}
.example-table td:last-child {
    text-align: right;
    font-weight: 600;
}
.example-table .total-row td {
    border-top: 2px solid var(--gray-400);
    border-bottom: none;
    padding-top: 12px;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--gray-400);
    padding: 25px 20px;
    text-align: center;
    font-size: 0.9rem;
}
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}
.footer a {
    color: var(--primary);
}
.footer-disclaimer {
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 10px;
    }
    .nav-menu.open { display: flex; }
    .nav-toggle { display: flex; }
    .nav-year { margin-left: auto; margin-right: 10px; }

    .page-header h1 { font-size: 1.8rem; }

    .team-hero {
        flex-direction: column;
        text-align: center;
    }
    .team-stats-grid {
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-card {
        flex-wrap: wrap;
    }
    .game-opponent { width: 100%; order: 3; margin-top: 10px; }

    .filter-bar {
        flex-direction: column;
    }
    .filter-group {
        width: 100%;
    }
    .filter-group select,
    .filter-group input {
        flex: 1;
    }

    .week-tabs {
        justify-content: center;
    }

    .rankings-table th,
    .rankings-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    .col-sos { display: none; }
}
