/* Color Theme Variables */
:root {
    /* NFL Logo Theme - Default */
    --primary-color: #1A3A52;
    --primary-light: #335B7B;
    --accent-color: #C8102E;
    --accent-hover: #A00D24;
    --text-dark: #2C3E50;
    --text-medium: #34495e;
    --text-light: #7f8c8d;
    --bg-gradient-start: #1A3A52;
    --bg-gradient-end: #335B7B;
    --card-bg: #FFFFFF;
    --card-bg-alpha: rgba(255, 255, 255, 0.95);
    --border-color: #E8ECF1;
    --light-bg: #F5F7FA;
    --shadow-color: rgba(26, 58, 82, 0.1);
    --highlight-gradient-start: #C8102E;
    --highlight-gradient-end: #A00D24;
    --success-color: #22c55e;
    --success-light: #86efac;
    --warning-color: #fbbf24;
    --danger-color: #dc2626;
}

/* Purple Theme - Fallback (add class="purple-theme" to <html> to use) */
:root.purple-theme {
    --primary-color: #667eea;
    --primary-light: #764ba2;
    --accent-color: #f5576c;
    --accent-hover: #f093fb;
    --text-dark: #2c3e50;
    --text-medium: #34495e;
    --text-light: #7f8c8d;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: #FFFFFF;
    --card-bg-alpha: rgba(255, 255, 255, 0.95);
    --border-color: #e0e0e0;
    --light-bg: #F5F7FA;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-gradient-start: #f093fb;
    --highlight-gradient-end: #f5576c;
    --success-color: #22c55e;
    --success-light: #86efac;
    --warning-color: #fbbf24;
    --danger-color: #dc2626;
}

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

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    padding: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 0;
    padding: 0 40px 40px 40px;
    box-shadow: none;
    overflow-x: hidden;
}

/* Header Styles */
header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 5px 10px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    background: white;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 0;
}

.logo img {
    height: 90px;
    width: auto;
    margin: 0;
    padding: 0;
}

.main-nav {
    display: flex;
    gap: 0;
    align-items: center;
}

.main-nav a {
    padding: 12px 20px;
    color: #000;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.2s;
    border-bottom: 4px solid transparent;
}

.main-nav a:hover {
    background: var(--light-bg);
}

.main-nav a.active {
    border-bottom-color: var(--accent-color);
}

/* Charity Pill Button - Floating at Bottom Right */
.charity-pill-button {
    position: fixed;
    bottom: 30px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #335B7B;
    color: white;
    border: 2px solid #335B7B;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease, opacity 0.3s ease;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.charity-pill-button:hover {
    background: #1A3A52;
    border-color: #1A3A52;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 58, 82, 0.5);
}

.charity-pill-button img {
    height: 16px;
    width: auto;
    display: block;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

/* Week/Team Selector Styles */
.week-title-selector,
.team-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selector-label {
    font-size: 0.75em;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.week-selector-button,
.team-selector-button {
    min-width: 200px;
    padding: 8px 40px 8px 16px;
    border: 2px solid var(--border-color);
    background: #ffffff;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    color: var(--text-dark);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.week-selector-button::after,
.team-selector-button::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%231f2937' d='M16 22L6 12h20z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s;
}

.week-selector-button:hover,
.team-selector-button:hover {
    background-color: var(--light-bg);
    border-color: var(--accent-color);
    box-shadow: 0 2px 6px rgba(200, 16, 46, 0.2);
}

.week-selector-button.open::after,
.team-selector-button.open::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown Styles */
.week-dropdown,
.team-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-top: 5px;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.week-dropdown {
    right: 0;
    min-width: 600px;
}

@media (max-width: 768px) {
    .week-dropdown,
    .team-dropdown {
        /* Use fixed positioning to span viewport width */
        position: fixed;
        left: 2.5vw;
        right: auto;
        width: 95vw;
        min-width: 0;
        max-width: 95vw;
        /* Position below the button - adjust top dynamically via JS if needed */
        margin-top: 5px;
        padding: 8px;
    }

    .week-dropdown-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .team-dropdown-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .week-option,
    .team-option {
        font-size: 0.85em;
        padding: 6px 4px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    .week-column-header,
    .team-column-header {
        font-size: 0.75em;
        padding: 4px 2px;
        text-align: center;
    }

    /* Season dropdown is narrower (single column), so center it better */
    #seasonDropdown {
        width: 60vw;
        max-width: 60vw;
        left: 20vw;
    }

    /* Sort dropdown on team page - narrower (single column) */
    #sortDropdown {
        width: 60vw;
        max-width: 60vw;
        left: 20vw;
    }
}

/* Season selector should be narrower */
#seasonDropdown {
    min-width: 200px;
}

.team-dropdown {
    left: 0;
    right: 0;
}

.week-dropdown.show,
.team-dropdown.show {
    display: block;
}

.week-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

/* Season grid should be single column */
#seasonGrid {
    grid-template-columns: 1fr;
}

.team-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.week-column,
.team-column {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.week-column-header,
.team-column-header {
    font-weight: 700;
    color: #374151;
    padding: 4px 8px;
    font-size: 0.85em;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 3px;
}

.week-option,
.team-option {
    padding: 6px 8px;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Quicksand', sans-serif;
    transition: background 0.2s;
    text-align: left;
}

.week-option:hover:not(.disabled) {
    background: #FFE5E5;
    color: var(--accent-color);
}

.team-option:hover {
    background: rgba(200, 16, 46, 0.1);
    color: var(--accent-color);
}

.week-option.selected,
.team-option.selected,
#seasonGrid .week-option.selected,
#seasonDropdown .week-option.selected {
    background: var(--accent-color) !important;
    color: white !important;
    font-weight: 600 !important;
}

.week-option.disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

/* Content Layout */
.content-wrapper,
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    margin-top: 30px;
}

.stats-sidebar,
.stat-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Season page stats should be 2 columns */
.season-stat-cards {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Team page stats should be 2 columns */
.team-stat-cards {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Team page grid - give more space to table */
.team-page-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    margin-top: 30px;
}

/* Section Titles */
.section-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #003D7A;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
}

.section-title.standalone {
    margin-top: 30px;
}

/* Stat Cards */
.stat-card {
    background: #fafafa;
    border: none;
    border-radius: 0;
    padding: 10px 12px;
}

.stat-card h3 {
    font-size: 0.85em;
    font-weight: 700;
    color: #003D7A;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

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

.stat-label {
    font-size: 0.8em;
    color: #666;
}

.stat-value {
    font-weight: 700;
    color: #000;
    font-size: 0.85em;
    text-align: right;
}

.stat-highlight {
    color: #000;
    font-weight: 700;
}

.stat-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--highlight-gradient-start), var(--highlight-gradient-end));
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 0.9em;
}

thead {
    background: rgba(26, 58, 82, 0.05);
}

thead th {
    padding: 10px 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85em;
    border-bottom: 2px solid var(--accent-color);
    background: rgba(26, 58, 82, 0.05);
}

#topGamesTable thead th {
    background: rgba(26, 58, 82, 0.05);
}

#topGamesTable thead {
    background: rgba(26, 58, 82, 0.05);
}

#topGamesTable thead tr {
    background: rgba(26, 58, 82, 0.05);
}

#topGamesTable thead th:last-child {
    width: 50px;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

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

tbody tr.expanded {
    background: rgba(200, 16, 46, 0.05);
}

tbody tr:not(.level-header):not(.details-row)::after {
    content: ' ▼';
    color: var(--accent-color);
    font-size: 0.75em;
    margin-left: 10px;
}

tbody tr.expanded::after {
    content: ' ▲';
}

td {
    padding: 5px 8px;
    white-space: nowrap;
    font-size: 0.9em;
    color: #333;
}

td.center {
    text-align: center;
}

.rank {
    font-weight: 600;
    color: #666;
    font-size: 0.85em;
}

.matchup {
    font-weight: 600;
    color: #000;
}

.rating {
    font-weight: 700;
    color: #000;
}

.week-label {
    color: #666;
    font-size: 0.85em;
}

.level {
    color: #666;
    font-size: 0.85em;
}

/* Level Header Styles */
.level-header {
    background: var(--light-bg);
    font-weight: 600;
    cursor: default;
    border-top: 2px solid var(--accent-color);
}

.level-header:first-child {
    border-top: none;
}

.level-header td {
    padding: 6px 10px;
}

.level-header::after {
    content: '';
}

.level-title {
    font-size: 1em;
    color: #003D7A;
    display: inline;
    margin-right: 12px;
}

.level-commentary {
    color: #666;
    font-size: 0.85em;
    display: inline;
}

.total {
    font-weight: 600;
}

/* Badges and Pills */
.bonus-badges {
    display: flex;
    gap: 5px;
}

.bonus-badge {
    background: var(--warning-color);
    color: #78350f;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.redeeming-pill {
    background: rgba(200, 16, 46, 0.1);
    color: var(--accent-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
}

/* Highlight Icons */
.highlight-icon {
    cursor: help;
    position: relative;
    margin: 0 2px;
}

.highlight-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.75em;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Details Row */
.details-row {
    display: none;
    background: #f8fafc;
}

.details-row.show {
    display: table-row;
}

.details-content {
    padding: 20px;
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section h4 {
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* Component Grid */
.component-grid {
    display: grid;
    grid-template-columns: 120px 1fr 70px;
    gap: 10px;
    align-items: center;
}

.component-label {
    font-size: 0.9em;
    color: #666;
}

.component-bar {
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.component-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--highlight-gradient-start), var(--highlight-gradient-end));
    transition: width 0.3s;
}

.component-value {
    text-align: right;
    font-weight: 600;
}

/* Dramatic Events */
.dramatic-events {
    background: #fef3c7;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.dramatic-events ul {
    margin-left: 20px;
    margin-top: 10px;
}

.dramatic-events li {
    margin: 5px 0;
}

/* Redeeming Features */
.redeeming-features {
    background: rgba(200, 16, 46, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.feature-item {
    margin: 8px 0;
}

.feature-tag {
    font-weight: 600;
    margin-right: 8px;
}

/* Team Table Specific Styles */
.team-table {
    table-layout: fixed;
    width: 100%;
}

.team-table td {
    cursor: default;
}

.team-table td::after {
    content: '';
}

.team-table tr::after {
    content: '' !important;
}

.team-table th {
    cursor: pointer;
    user-select: none;
    position: relative;
    width: 7.7%;
}

.team-table th:first-child {
    width: 5%;
}

.team-table th:nth-child(2) {
    width: 8%;
}

.team-table th:hover {
    background: rgba(200, 16, 46, 0.1);
}

.team-table th.sortable::after {
    content: ' ⇅';
    opacity: 0.3;
}

.team-table th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
}

.team-table th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
}

/* Top Games Table - With Arrows (same as weekly) */
#topGamesTable tbody tr:not(.level-header):not(.details-row) {
    cursor: pointer;
}

#topGamesTable tbody tr:not(.level-header):not(.details-row)::after {
    content: ' ▼';
    color: var(--accent-color);
    font-size: 0.75em;
    margin-left: 10px;
}

#topGamesTable tbody tr.expanded::after {
    content: ' ▲';
}

/* Score Table - No Arrows */
.score-table tr::after {
    content: '' !important;
}

.score-table tr {
    cursor: default !important;
}

.details-content table tr::after {
    content: none !important;
    display: none !important;
}

.details-content table thead tr::after {
    content: none !important;
    display: none !important;
}

.details-content table tbody tr::after {
    content: none !important;
    display: none !important;
}

.details-content table tbody tr {
    cursor: default !important;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .stats-sidebar,
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .content-wrapper,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .team-page-grid {
        grid-template-columns: 1fr;
    }

    .stats-sidebar,
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    header {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        order: 1;
        width: 100%;
        justify-content: center;
    }

    .logo img {
        height: 70px;
    }

    .charity-pill-button {
        bottom: 25px;
        right: 15px;
        padding: 8px 14px;
        font-size: 0.8em;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }

    .charity-pill-button img {
        height: 14px;
    }

    .header-controls {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-left: 0;
        gap: 6px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        border-top: 1px solid var(--border-color);
        padding-top: 8px;
        margin-top: 8px;
    }

    .main-nav a {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .selector-label {
        font-size: 0.7em;
    }

    .week-selector-button,
    .team-selector-button {
        min-width: 90px;
        padding: 8px 28px 8px 10px;
        font-size: 0.85em;
        text-align: center;
    }

    .week-selector-button::after,
    .team-selector-button::after {
        right: 8px;
        width: 16px;
        height: 16px;
    }

    .week-title-selector,
    .team-selector {
        justify-content: center;
        margin-left: 0;
    }

    header h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
    }

    .content-wrapper,
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 15px;
        padding: 0;
    }

    .table-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin: 0;
    }

    .section-title {
        display: none;
    }

    table {
        font-size: 0.85em;
        width: 100%;
        display: block;
        overflow-x: auto;
    }

    table thead,
    table tbody {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    th, td {
        padding: 8px 1px;
        font-size: 0.85em;
        word-wrap: break-word;
    }

    th:first-child, td:first-child {
        padding-left: 2px;
    }

    th:last-child, td:last-child {
        padding-right: 2px;
    }

    .level-header td {
        padding: 8px 2px;
    }

    .level-title {
        display: block;
        margin-bottom: 4px;
        font-size: 0.95em;
    }

    .level-commentary,
    .level-count,
    .level-header .level-count {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide emojis in season table rating column on mobile */
    .rating-emoji {
        display: none;
    }

    .stats-sidebar,
    .stat-cards {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    #statsSidebar {
        grid-template-columns: 1fr !important;
    }

    .season-stat-cards {
        padding: 0 10px;
    }

    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .breakdown-item .label {
        min-width: auto;
    }

    .highlights-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* Footer Styles */
.page-footer {
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: 100%;
    margin: 0 0 15px 0;
    padding: 0 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.footer-content span {
    font-size: 0.85em;
    color: #999;
    font-weight: 400;
}

.footer-links {
    font-size: 0.9em;
    color: #666;
    padding: 0 20px;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
    margin: 0 8px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Charity Support - Call to Action Button */
.charity-support {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    margin: 0 0 8px 0;
    width: 100%;
    background: linear-gradient(135deg, #335B7B 0%, #1A3A52 100%);
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(26, 58, 82, 0.3);
    border: none;
    gap: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.charity-support:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(26, 58, 82, 0.5);
    background: linear-gradient(135deg, #3d6a8f 0%, #1f4463 100%);
}

.charity-logo-container {
    flex-shrink: 0;
    order: -1;
}

.charity-content {
    flex: 1;
    text-align: left;
}

.shine-logo {
    max-height: 50px;
    width: auto;
}

.charity-icon {
    font-size: 1.2em;
    display: inline;
    margin-right: 8px;
}

.charity-support p {
    margin: 5px 0;
    color: white;
    font-size: 0.95em;
    line-height: 1.3;
    font-weight: 500;
    display: inline;
}

.charity-support strong {
    font-weight: 700;
    font-size: 1em;
}

.charity-cta-arrow {
    display: inline-block;
    margin-left: 10px;
    font-size: 1.3em;
    font-weight: bold;
    color: white;
    transition: transform 0.3s ease;
}

.charity-support:hover .charity-cta-arrow {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .charity-support {
        flex-direction: column;
        padding: 12px 15px;
        margin: 5px 0;
        text-align: center;
        gap: 10px;
    }

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

    .shine-logo {
        max-height: 40px;
    }

    .charity-icon {
        display: block;
        margin: 0 0 5px 0;
    }

    .charity-support p {
        font-size: 0.85em;
        display: block;
        margin: 5px 0;
    }

    .charity-cta-arrow {
        display: block;
        margin: 5px 0 0 0;
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0;
    }

    .footer-content {
        padding: 0 10px;
        flex-direction: column;
        gap: 8px;
        text-align: right;
    }

    .footer-content span {
        font-size: 0.8em;
    }
}

/* ========================================
   STATS INFO BUTTON AND MODAL
   ======================================== */

.stats-info-button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.stats-info-button:hover {
    background: #c74c00;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.stats-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.stats-modal-overlay.show {
    display: flex;
}

.stats-modal {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
}

.stats-modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5em;
}

.stats-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stats-modal-close:hover {
    background: #e5e7eb;
    color: var(--primary-color);
}

.stats-modal-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.stat-explanation {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.stat-explanation:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.stat-explanation h3 {
    color: var(--accent-color);
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.stat-explanation p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .stats-info-button {
        position: fixed;
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 1em;
        z-index: 9999;
        margin-left: 0;
    }

    .stats-modal {
        max-width: 95%;
        max-height: 90vh;
    }

    .stats-modal-header {
        padding: 16px;
    }

    .stats-modal-header h2 {
        font-size: 1.2em;
    }

    .stats-modal-content {
        padding: 16px;
        max-height: calc(90vh - 70px);
    }

    .stat-explanation h3 {
        font-size: 1em;
    }

    .stat-explanation p {
        font-size: 0.9em;
    }
}
