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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #fbfbfb;
    color: #003321;
    line-height: 1.47;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Navbar */
.navbar {
    background-color: #003321;
    color: white;
    padding: 1.25rem 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1300;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    letter-spacing: -0.01em;
}

.nav-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.season-selector {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid rgba(193,151,80,0.3);
    border-radius: 4px;
    background-color: rgba(193,151,80,0.15);
    color: white;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
}

.season-selector:hover {
    background-color: rgba(193,151,80,0.2);
    border-color: rgba(193,151,80,0.4);
}

.season-selector option {
    background-color: #003321 !important;
    color: white !important;
    padding: 0.5rem;
}

.season-selector option:hover,
.season-selector option:focus,
.season-selector option:checked {
    background-color: #003321 !important;
    color: white !important;
    opacity: 0.8;
}

/* Force dropdown styling on Windows */
.season-selector::-ms-expand {
    background-color: #003321;
    color: white;
}

/* Windows-specific overrides for select dropdown */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .season-selector option {
        background-color: #003321 !important;
        color: white !important;
    }
}

/* Additional targeting for Windows browsers */
.season-selector {
    /* Force background color in dropdown */
    option {
        background-color: #003321 !important;
        color: white !important;
    }
}

/* Target select element on focus to override Windows styling */
.season-selector:focus option {
    background-color: #003321 !important;
    color: white !important;
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 78px);
    padding: 0rem 0 3rem 0;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Screens */
.screen {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 3rem;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

.login-container h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: #003321;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #424245;
    font-size: 0.9375rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #d1d1d6;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fbfbfb;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #003321;
    box-shadow: 0 0 0 3px rgba(0,51,33,0.1);
    background-color: white;
}

.form-group .custom-select {
    width: 100%;
}

.form-group .custom-select-button {
    min-height: 48px;
    padding: 0.875rem 1rem;
    background-color: #fbfbfb;
    border-color: #d1d1d6;
    font-size: 1rem;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    vertical-align: middle;
    -webkit-appearance: checkbox; /* Restore default checkbox appearance */
    appearance: checkbox;
}

.form-group label.checkbox-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    font-weight: normal;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #003321;
    color: white;
    box-shadow: 0 2px 4px rgba(0,51,33,0.2);
}

.btn-primary:hover {
    background-color: #001a11;
    box-shadow: 0 4px 8px rgba(0,51,33,0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #c19750;
    color: #003321;
    box-shadow: 0 2px 4px rgba(193,151,80,0.2);
}

.btn-secondary:hover {
    background-color: #a17c3a;
    box-shadow: 0 4px 8px rgba(193,151,80,0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #ff3b30;
    color: white;
    box-shadow: 0 2px 4px rgba(255,59,48,0.2);
}

.btn-danger:hover {
    background-color: #d70015;
    box-shadow: 0 4px 8px rgba(255,59,48,0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #ff9500;
    color: white;
    box-shadow: 0 2px 4px rgba(255,149,0,0.2);
}

.btn-warning:hover {
    background-color: #cc7700;
    box-shadow: 0 4px 8px rgba(255,149,0,0.3);
    transform: translateY(-1px);
}

.btn-success {
    background-color: #34c759;
    color: white;
    box-shadow: 0 2px 4px rgba(52,199,89,0.2);
}

.btn-success:hover {
    background-color: #248a3d;
    box-shadow: 0 4px 8px rgba(52,199,89,0.3);
    transform: translateY(-1px);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-header h2 {
    color: #003321;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.rankings-snapshot-label {
    color: #6e6e73;
    font-size: 0.875rem;
}

.rankings-status-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #003321;
    color: white;
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    border-bottom: 0;
}

.data-table thead tr {
    box-shadow: inset 0 -2px 0 rgba(255,255,255,0.1);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9375rem;
    color: #1d1d1f;
}

.data-table tbody tr:hover {
    background-color: #faf8f5;
}

.data-table tbody tr.ranking-row-favorite {
    background-color: #fffbef;
    box-shadow: inset 3px 0 0 #c19750;
}

.data-table tbody tr.ranking-row-favorite:hover {
    background-color: #fff6dc;
}

.data-table tbody tr.game-row-favorite {
    background-color: #fffbef;
    box-shadow: inset 3px 0 0 #c19750;
}

.data-table tbody tr.game-row-favorite:hover {
    background-color: #fff6dc;
}

.game-team-display {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.game-team-display.favorite .game-team-name {
    color: #75520f;
    font-weight: 600;
}

.game-team-favorite-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9b9b9f;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.game-team-favorite-btn:hover,
.game-team-favorite-btn:focus-visible {
    outline: none;
    color: #9a6a12;
    background: #fff3cd;
}

.game-team-favorite-btn.active {
    color: #c18a24;
}

.favorite-column,
.favorite-cell {
    width: 48px;
    min-width: 48px;
    padding-right: 0.35rem !important;
    padding-left: 0.35rem !important;
    text-align: center !important;
}

.favorite-team-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9b9b9f;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.favorite-team-btn:hover,
.favorite-team-btn:focus-visible {
    outline: none;
    color: #9a6a12;
    background: #fff3cd;
    transform: scale(1.06);
}

.favorite-team-btn.active {
    color: #c18a24;
}

.data-table .empty-state {
    padding: 2.5rem 1rem;
    color: #6e6e73;
    text-align: center;
}

.data-table .loading {
    text-align: center;
    color: #8e8e93;
    font-style: italic;
}

/* Info Box */
.info-box {
    background-color: rgba(193,151,80,0.08);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid rgba(0,0,0,0.05);
    color: #424245;
}

/* Admin Sections */
.admin-sections {
    display: grid;
    gap: 2rem;
}

.admin-section {
    background: white;
    padding: 2.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

.admin-section h3 {
    margin-bottom: 1.5rem;
    color: #003321;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.elo-form {
    margin-top: 1rem;
}

/* Analytics Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #f8f9fb 100%);
    border: 1px solid rgba(0,51,33,0.1);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #003321;
    letter-spacing: -0.02em;
}

.chart-container {
    min-height: 300px;
    padding: 1rem;
    background: #f8f9fb;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 2.5rem;
    border-radius: 6px;
    margin-top: 2em;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    color: #8e8e93;
    transition: color 0.2s ease;
}

.close:hover {
    color: #003321;
}

/* Error Messages */
.error-message {
    color: #ff3b30;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9375rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background-color: white;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    margin: 0 auto;
    max-width: 1200px;
    border: 1px solid rgba(0,0,0,0.05);
}

.tab-btn {
    flex: 1;
    padding: 1.25rem 1.5rem;
    border: none;
    background-color: rgba(193,151,80,0.1);
    color: #8e8e93;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(0,0,0,0.1);
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background-color: #e5e5ea;
    color: #003321;
}

.tab-btn.active {
    background-color: white;
    color: #003321;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #003321;
}

/* Hide admin-only elements by default, but allow JS to override */
.admin-only {
    display: none;
}

.tab-btn.admin-only {
    display: none;
}

/* Tab Content */
.tab-content {
    max-width: 1200px;
    margin: 1.5rem auto 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.results-header {
    gap: 1rem;
}

.results-header h2 {
    flex: 0 0 auto;
    white-space: nowrap;
}

.results-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(105px, 1fr)) auto;
    flex: 1 1 auto;
    gap: 0.5rem;
    min-width: 0;
}

.results-filters .filter-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 42px;
}

.results-filter-actions {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.5rem;
}

.results-filter-actions .btn {
    white-space: nowrap;
}

.results-favorites-btn.active {
    background: #fff6dc;
    border: 1px solid #c19750;
    color: #75520f;
}

.filter-select,
.filter-input {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(193,151,80,0.3);
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-input {
    width: 150px;
}

.rankings-toolbar {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.rankings-filter-grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.2fr) minmax(230px, 1.5fr) minmax(150px, 0.8fr) minmax(160px, 0.8fr);
    gap: 0.75rem;
}

.rankings-filter-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #424245;
    font-size: 0.8125rem;
    font-weight: 600;
}

.rankings-filter-control .filter-input,
.rankings-filter-control .filter-select {
    width: 100%;
    min-width: 0;
}

.rankings-filter-control .filter-input,
.rankings-filter-control .custom-select-button {
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
}

.rankings-toolbar-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.85rem;
}

.rankings-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.rankings-result-summary {
    color: #6e6e73;
    font-size: 0.875rem;
    text-align: right;
    white-space: nowrap;
}

.favorites-filter-btn.active {
    background: #fff6dc;
    border-color: #c19750;
    color: #75520f;
}

.custom-select {
    position: relative;
    min-width: 0;
    width: 100%;
}

.custom-select-season {
    width: 260px;
}

.custom-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.custom-select-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 38px;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(193,151,80,0.35);
    border-radius: 4px;
    background: white;
    color: #1d1d1f;
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.custom-select-season .custom-select-button {
    color: white;
    background: rgba(193,151,80,0.15);
    border-color: rgba(193,151,80,0.35);
}

.custom-select-button:hover {
    border-color: #c19750;
}

.custom-select-button:focus-visible,
.custom-select.open .custom-select-button {
    outline: none;
    border-color: #c19750;
    box-shadow: 0 0 0 3px rgba(193,151,80,0.2);
}

.custom-select-chevron {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s ease;
}

.custom-select.open .custom-select-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.custom-select-list {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 0.35rem);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(360px, calc(100vw - 2rem));
    max-height: 280px;
    overflow-y: auto;
    padding: 0.35rem;
    background: white;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.16);
}

.custom-select-season .custom-select-list {
    right: 0;
    left: auto;
}

.custom-select-list[hidden] {
    display: none;
}

.custom-select-option {
    display: block;
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #1d1d1f;
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
    outline: none;
    background: #f5f1e8;
}

.custom-select-option[aria-selected="true"] {
    background: #003321;
    color: white;
}

.custom-select.disabled {
    opacity: 0.55;
}

.custom-select.disabled .custom-select-button {
    cursor: not-allowed;
}

/* Tournament Toggle Slider */
.tournament-toggle-container {
    display: flex;
    position: relative;
    background-color: #f5f5f7;
    border-radius: 6px;
    padding: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.tournament-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background-color: #c19750;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(193,151,80,0.3), 0 1px 2px rgba(0,0,0,0.1);
    z-index: 1;
}

.tournament-toggle-container.active-remaining .tournament-toggle-slider {
    transform: translateX(100%);
    background-color: #003321;
}

.tournament-toggle-option {
    background: none;
    border: none;
    padding: 0.65rem 2rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8e8e93;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    letter-spacing: -0.01em;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.tournament-toggle-option.active {
    color: white;
}

.tournament-toggle-option:hover:not(.active) {
    color: #1d1d1f;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: #faf8f5;
    border-radius: 4px;
}

.metric label {
    font-weight: 500;
    color: #555;
}

.metric span {
    font-weight: 600;
    color: #003321;
}

.metric .highlight {
    color: #003321;
    font-size: 1.1rem;
}

/* About Tab Styling */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.1rem 2rem 2rem 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.about-content h1,
.about-content h2,
.about-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #003321;
}

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

.about-content p {
    margin-bottom: 1rem;
}

.about-content ul,
.about-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

.about-content blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid #c19750;
    font-style: italic;
    color: #666;
}

.about-content code {
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.about-content pre {
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.about-content pre code {
    background-color: transparent;
    padding: 0;
}

.about-editor {
    max-width: 800px;
    margin: 0 auto;
}

.markdown-editor {
    width: 100%;
    min-height: 500px;
    padding: 1rem;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid rgba(193,151,80,0.3);
    border-radius: 4px;
    resize: vertical;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Table Styling */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0 !important;
}

.sortable:hover {
    background-color: #0a4934;
}

.table-sort-button {
    display: block;
    width: 100%;
    min-height: 100%;
    padding: 1.25rem 1.75rem 1.25rem 1rem;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.table-sort-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.sortable.sorted::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.sortable.sorted.asc::after {
    border-width: 0 5px 8px 5px;
    border-color: transparent transparent white transparent;
}

.sortable.sorted.desc::after {
    border-width: 8px 5px 0 5px;
    border-color: white transparent transparent transparent;
}

.data-table .positive {
    color: #34c759;
}

.data-table .negative {
    color: #ff3b30;
}

/* ELO Change Indicators */
.elo-gain {
    color: #27ae60;
    font-weight: 600;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.elo-loss {
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Info Icon Tooltip */
.info-icon {
    display: inline-block;
    margin-left: 0.5rem;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    font-style: normal;
    font-size: 0.875rem;
}

.info-icon:hover {
    opacity: 1;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 4px;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

/* Game Types */
.tournament {
    background-color: #fff3cd;
}

.shootout {
    background-color: #d1ecf1;
}

.forfeit {
    background-color: #f8d7da;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .season-selector,
    .custom-select-season {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .rankings-status-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: baseline;
        gap: 0.75rem;
    }
    
    .header-controls {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 33.333%;
        min-width: 120px;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .results-header {
        display: flex;
        flex-direction: column;
    }

    .results-header h2 {
        white-space: normal;
    }

    .results-filters {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        width: 100%;
    }

    .results-filters #teamSearch,
    .results-filter-actions {
        grid-column: 1 / -1;
    }

    .results-filter-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .results-filter-actions .btn {
        width: 100%;
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
    }

    .rankings-filter-grid {
        grid-template-columns: 1fr;
    }

    .rankings-toolbar-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .rankings-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .rankings-toolbar-actions .btn {
        width: 100%;
    }
    
    /* Improve table scrolling on mobile */
    .table-container {
        margin: 0 -1rem; /* Extend to screen edges */
        padding: 0 1rem; /* Add padding back for content */
        border-radius: 0; /* Remove border radius on mobile */
    }
    
    /* Add visual indicator for scrollable tables */
    .table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    /* Ensure minimum width for readability */
    .data-table {
        min-width: 680px; /* Prevents columns from getting too cramped */
    }
}

/* Banner Notification System */
.banner-notification {
    background-color: #c19750;
    color: #003321;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 100;
}

.banner-notification-content {
    flex: 1;
    text-align: center;
}

.banner-notification-dismiss {
    background: none;
    border: none;
    color: #003321;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    font-weight: 600;
    line-height: 1;
}

.banner-notification-dismiss:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Mobile responsive banner */
@media (max-width: 768px) {
    .banner-notification {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        flex-direction: row;
        text-align: left;
    }

    .banner-notification-content {
        text-align: left;
    }

    .banner-notification-dismiss {
        font-size: 1.125rem;
        padding: 0.25rem;
        flex-shrink: 0;
    }
}
