/* ==========================================================================
   Torch Analytics - Components
   Cards, badges, buttons, modals, tables, form elements
   ========================================================================== */

/* ==========================================================================
   Cards & Panels
   ========================================================================== */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.feature-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
    display: block;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h2 {
    margin: 0 0 0.5rem 0;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feature-card .card-link {
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover, var(--gold-bright)));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--gold-glow-md);
}

.secondary-btn {
    background: var(--card-bg);
    color: white;
    border: 1px solid var(--primary);
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--gold-bg-light);
}

/* Disabled button state */
.primary-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button system */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover, var(--gold-bright)));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--gold-glow-md);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-full {
    width: 100%;
}

/* Button Loading State */
.primary-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.primary-btn.loading .btn-text {
    opacity: 0;
}

.primary-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--white-30);
    border-top-color: var(--text-light);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.filter-btn {
    background: var(--white-10);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: background 0.2s;
    min-height: 44px;
    min-width: 44px;
}

.filter-btn:hover {
    background: var(--white-15);
}

.filter-btn.active {
    background: var(--primary);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.input-group {
    display: flex;
    gap: 1rem;
}

input[type="text"],
input[type="number"] {
    background: var(--container-bg-dim);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    width: 100%;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--gold-focus-ring);
}

select {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

select:focus {
    border-color: var(--primary);
}

.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Enhanced Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

.form-group input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--gold-focus-ring-sm);
}

.form-group input::placeholder {
    color: var(--gray-muted-placeholder);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-control::placeholder {
    color: var(--gray-muted-placeholder-med);
}

.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-dim);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    margin-top: 1.5rem;
}

.form-actions .primary-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
}

/* Form Control Disabled / Readonly State */
.form-control:disabled,
.form-control[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

select.form-control option {
    background: var(--card-bg);
    color: var(--text-main);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.25rem;
}

.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--white-10);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background-color 0.3s;
    width: 0%;
}

.password-strength-fill.weak {
    width: 25%;
    background-color: var(--danger);
}

.password-strength-fill.fair {
    width: 50%;
    background-color: var(--warning);
}

.password-strength-fill.good {
    width: 75%;
    background-color: var(--success);
}

.password-strength-fill.strong {
    width: 100%;
    background-color: var(--success);
}

.password-strength-label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white-10);
    border-radius: 26px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary-dim);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
    background: var(--primary);
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
.data-table-container {
    position: relative;
    overflow-x: auto;
    background: var(--white-03);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

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

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    background: var(--container-bg-dim);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
}

.data-table th:hover {
    color: white;
    background: var(--white-05);
}

.data-table tr:hover {
    background: var(--white-02);
}

.data-table td.numeric {
    text-align: right;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.summary-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .data-table {
        min-width: 600px;
    }

    .data-table-container::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        width: 26px;
        height: 100%;
        float: right;
        pointer-events: none;
        background: var(--table-fade-gradient);
    }
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.3rem;
}

.badge-star {
    background: var(--warning-bg-medium);
    color: var(--warning);
    border: 1px solid var(--warning-border-strong);
}

.badge-safe {
    background: var(--success-bg-light);
    color: var(--success);
    border: 1px solid var(--success-border-strong);
}

.badge-volatile {
    background: var(--danger-bg-medium);
    color: var(--danger);
    border: 1px solid var(--danger-border-strong);
}

.availability-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-active {
    background: var(--success-alt-bg-medium);
    color: var(--success);
}

.status-injured {
    background: var(--danger-alt-bg-medium);
    color: var(--danger);
}

.platform-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge-sleeper {
    background: var(--sleeper-bg);
    color: var(--success);
    border: 1px solid var(--success-dark);
}

.badge-espn {
    background: var(--danger-dim);
    color: var(--alert-danger-text);
    border: 1px solid var(--danger);
}

/* Position Badges (shared across all pages) */
.pos-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pos-qb {
    background: var(--danger-ef-bg);
    color: var(--danger);
    border: 1px solid var(--danger-ef-border);
}

.pos-rb {
    background: var(--info-bg-medium);
    color: var(--info);
    border: 1px solid var(--info-border-strong);
}

.pos-wr {
    background: var(--success-dark-bg);
    color: var(--success-dark);
    border: 1px solid var(--success-dark-border);
}

.pos-te {
    background: var(--badge-warning-bg);
    color: var(--warning);
    border: 1px solid var(--alert-warning-border);
}

.pos-k {
    background: var(--badge-primary-bg);
    color: var(--accent-teal);
    border: 1px solid var(--border-teal-medium);
}

.pos-def,
.pos-dst {
    background: var(--gray-bg);
    color: var(--accent-gray);
    border: 1px solid var(--gray-border);
}

/* Tags / Pills */
.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-success {
    background: var(--success-dim);
    color: var(--success);
}

.tag-danger {
    background: var(--danger-dim);
    color: var(--danger);
}

.tag-warning {
    background: var(--warning-dim);
    color: var(--warning);
}

.tag-info {
    background: var(--info-dim);
    color: var(--info);
}

.tag-primary {
    background: var(--primary-dim);
    color: var(--primary);
}

.tag-secondary {
    background: var(--secondary-dim);
    color: var(--secondary);
}

.tag-muted {
    background: var(--gray-muted-bg);
    color: var(--text-muted);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--overlay-light);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close-btn {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

/* Alert / Message Boxes */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: var(--success-dim);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-dim);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-dim);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: var(--info-dim);
    border: 1px solid var(--info);
    color: var(--info);
}

/* ==========================================================================
   Comparison Feature
   ========================================================================== */
.checkbox-cell {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    text-align: center;
}

.compare-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent-teal) 100%);
    color: var(--bg-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: var(--cyan-glow);
    cursor: pointer;
    z-index: 90;
    transform: translateY(100px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compare-fab.visible {
    transform: translateY(0);
}

.compare-modal-content {
    max-width: 1000px;
    width: 90%;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.player-card {
    background: var(--white-03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.player-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.player-card .sub-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 700;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 1.1rem;
}

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

/* ==========================================================================
   Help Button & Glossary
   ========================================================================== */
.help-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white-10);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid var(--border-color-medium);
    transition: all 0.2s;
}

.help-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.glossary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.glossary-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--secondary);
}

.glossary-item p {
    font-size: 0.9rem;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
}

.glossary-item ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.glossary-item li {
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   Player Detail Page
   ========================================================================== */
.player-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.player-info h1 {
    margin: 0;
    font-size: 2.5rem;
}

.player-meta {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
}

.big-rating {
    font-size: 4rem;
    font-weight: 900;
    color: var(--secondary);
    line-height: 1;
}

.percentile-container {
    margin-top: 1rem;
    background: var(--white-05);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.percentile-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--accent-purple));
    transition: width 1s ease-out;
}

.ai-card {
    background: var(--ai-card-gradient);
    border: 1px solid var(--gold-border-medium);
    padding: 2rem;
    border-radius: 16px;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.ai-card::before {
    content: "AI INSIGHT";
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--secondary);
    border: 1px solid var(--secondary);
    padding: 2px 8px;
    border-radius: 4px;
}

.injury-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.injury-item {
    padding: 1rem;
    background: var(--white-03);
    border-radius: 8px;
    border-left: 4px solid var(--danger);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: white;
}

@media (max-width: 768px) {
    .player-header {
        flex-direction: column;
        text-align: center;
    }

    .player-header>div:last-child {
        margin-left: 0;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   Draft Backtest Page
   ========================================================================== */
.draft-board {
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    gap: 2px;
    overflow-x: auto;
    margin-top: 1rem;
    padding-bottom: 1rem;
}

.draft-col {
    min-width: 100px;
}

.draft-pick {
    background: var(--white-05);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    margin-bottom: 2px;
    font-size: 0.75rem;
    height: 60px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.draft-pick.user-pick {
    border: 1px solid var(--primary);
    background: var(--gold-bg-light);
}

.draft-pick.active {
    border-color: var(--warning);
    box-shadow: var(--warning-glow);
}

.position-badge {
    font-weight: bold;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.player-pool {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.pool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pool-card:hover {
    border-color: var(--primary);
    background: var(--gold-bg-light);
}

.config-panel {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.score-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    text-align: center;
    margin: 1rem 0;
}

/* Draft Results Modal */
.draft-results-modal .result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.draft-results-modal .result-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.draft-results-modal .result-score {
    font-size: 3rem;
    font-weight: 900;
}

@media (max-width: 768px) {
    .draft-board {
        grid-template-columns: repeat(14, 90px);
    }

    .config-panel {
        margin: 1rem;
    }

    .ai-card>div {
        flex-direction: column;
    }

    .draft-results-modal .result-comparison {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Team Analysis Page
   ========================================================================== */
.team-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.team-logo {
    width: 120px;
    height: 120px;
    background: var(--card-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.team-info h1 {
    font-size: 3rem;
    margin: 0;
    font-weight: 800;
}

.top-performer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .team-header {
        flex-direction: column;
        text-align: center;
    }

    .team-header>div:last-child {
        margin-left: 0;
        text-align: center;
    }
}

/* ==========================================================================
   League Cards
   ========================================================================== */
.league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.league-card {
    background: var(--white-05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.league-card:hover {
    transform: translateY(-4px);
    background: var(--white-10);
    border-color: var(--primary);
}

.league-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.league-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   Error Banner
   ========================================================================== */
.error-banner {
    background: var(--danger-alt-bg);
    border: 1px solid var(--danger-alt-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: var(--danger);
}

.error-banner .error-message {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-banner .error-action {
    margin-top: 1rem;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.loading-text {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

.status-message {
    margin-top: 1rem;
    height: 20px;
    font-size: 0.9rem;
}

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

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.loading-spinner.lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Skeleton loader */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: 200px 0;
    }
}

.skeleton {
    background: var(--shimmer-gradient);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 120px;
    border-radius: 16px;
}

.skeleton-stat {
    height: 3rem;
    width: 80px;
    margin: 0 auto;
}

/* Toast notifications */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toast {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideUp 0.3s ease-out;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 400px;
}

.toast.success {
    background: var(--toast-success);
    color: var(--bg-color);
}

.toast.error {
    background: var(--toast-error);
    color: var(--text-light);
}

.toast.info {
    background: var(--toast-info);
    color: var(--text-light);
}

.toast.fading {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Toast Notification (fixed position, slide-in) */
.toast-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 4rem));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-notification.success {
    background: var(--toast-success-strong);
    color: var(--bg-color);
}

.toast-notification.error {
    background: var(--toast-error-strong);
    color: var(--text-light);
}

@media (max-width: 768px) {
    .toast-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==========================================================================
   Hero Section (Home Page)
   ========================================================================== */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.card-link-primary {
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.quick-lookup-section {
    margin-top: 4rem;
}

.quick-lookup-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

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

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 700px;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Filter Bar Enhancements
   ========================================================================== */
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Config / Setup Panels
   ========================================================================== */
.config-field {
    margin-bottom: 1rem;
}

.config-field label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.config-field select {
    margin-left: 0.5rem;
}

.config-field-lg {
    margin-bottom: 2rem;
}

.config-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==========================================================================
   Comparison View (Backtest Results)
   ========================================================================== */
.comparison-view {
    max-width: 900px;
    margin: 0 auto;
}

.comparison-header {
    text-align: center;
    margin-bottom: 2rem;
}

.comparison-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.comparison-card {
    background: var(--white-05);
}

.comparison-card-model {
    background: var(--gold-bg-light);
    border-color: var(--primary);
}

.comparison-card-title {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.comparison-card-title-model {
    color: var(--primary);
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.5rem;
}

.comparison-record {
    text-align: center;
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

.comparison-record-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comparison-footer {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==========================================================================
   Bracket / Season Simulation
   ========================================================================== */
.bracket-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bracket-match {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    background: var(--white-05);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.bracket-final {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    background: var(--gold-ffd-bg);
    border: 1px solid var(--primary);
    padding: 0.5rem;
    border-radius: 4px;
}

.matchup-card {
    cursor: pointer;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.matchup-card:hover {
    background: var(--white-08);
}

.matchup-team {
    font-weight: normal;
    color: inherit;
}

.matchup-team.winner {
    font-weight: bold;
    color: var(--success);
}

.matchup-score {
    font-size: 1.2rem;
}

.matchup-vs {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 1rem;
}

/* ==========================================================================
   Box Score Modal
   ========================================================================== */
.box-score-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    z-index: 1000;
    overflow-y: auto;
    display: none;
}

.box-score-container {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.box-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.box-score-header h2 {
    margin: 0;
}

.box-score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.box-score-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.box-score-close:hover {
    color: var(--text-main);
}

.box-score-team-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.box-score-team-header h3 {
    margin: 0;
}

.box-score-team-score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.box-score-section-title {
    color: var(--text-muted);
    margin: 1rem 0 0.5rem 0;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

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

/* ==========================================================================
   Draft Board Modal
   ========================================================================== */
.draft-board-modal-content {
    max-width: 95%;
    width: 1400px;
}

.draft-board-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.draft-board-modal-header h2 {
    margin: 0;
}

.draft-board-scroll {
    overflow-x: auto;
}

/* ==========================================================================
   Draft Room
   ========================================================================== */
.draft-room-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    height: calc(100vh - 200px);
    overflow: hidden;
}

.board-section {
    overflow-y: auto;
    padding-right: 1rem;
}

.analysis-section {
    background: var(--card-bg);
    border-left: var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: 100%;
    border-radius: 16px;
}

.player-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
}

.player-item {
    background: var(--white-05);
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.player-item:hover {
    background: var(--white-10);
}

.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.8rem;
}

.pick-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pick-card.filled {
    background: var(--gold-bg-strong);
    border-color: var(--primary);
}

.position-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .draft-room-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ==========================================================================
   Draft Results
   ========================================================================== */
.draft-result-subtitle {
    color: var(--text-muted);
}

.draft-result-verdict {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

/* ==========================================================================
   Player Detail Page Enhancements
   ========================================================================== */
.player-badges {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.player-rating-block {
    margin-left: auto;
    text-align: right;
}

.player-logo-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-logo-container img {
    max-width: 100%;
    max-height: 100%;
    filter: var(--logo-drop-shadow);
}

.ai-layout {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.ai-prediction-block {
    text-align: center;
}

.ai-prediction-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.ai-prediction-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--success);
}

.ai-prediction-sub {
    font-size: 0.8rem;
    color: var(--success);
}

.ai-details {
    border-left: 1px solid var(--border-color);
    padding-left: 2rem;
}

.ai-model-name {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ai-insight-text {
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.ai-badges {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.confidence-badge {
    background: var(--success-alt-bg);
    color: var(--success);
    border: 1px solid var(--success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.ai-features-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.percentile-label {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.reliance-gauge {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
}

.reliance-gauge-value {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    line-height: 80px;
}

.reliance-info {
    flex: 1;
}

.reliance-label {
    font-weight: 800;
    font-size: 1.1rem;
}

.reliance-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.injury-gauge {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.injury-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.4;
}

.data-attribution {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .ai-layout {
        flex-direction: column;
    }

    .ai-details {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-heading {
        font-size: 2rem;
    }

    .player-rating-block {
        margin-left: 0;
        text-align: center;
    }

    .matchup-vs {
        padding: 0;
    }
}

/* ==========================================================================
   Team Analysis Page Enhancements
   ========================================================================== */
.system-rating-block {
    margin-left: auto;
    text-align: right;
}

.system-rating-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
}

.team-logo img {
    max-width: 80%;
    max-height: 80%;
}

/* ==========================================================================
   My Leagues Page Enhancements
   ========================================================================== */
.leagues-sync-section {
    margin-bottom: 3rem;
}

.sync-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.espn-modal-panel {
    width: 500px;
    max-width: 95%;
}

.espn-field {
    margin-bottom: 1rem;
}

.espn-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.espn-field input {
    margin-top: 0.5rem;
}

.espn-field-lg {
    margin-bottom: 1.5rem;
}

.espn-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .espn-modal-panel {
        width: 95%;
    }
}

/* ==========================================================================
   Slot Analysis
   ========================================================================== */
.slot-analysis-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.slot-chart-panel {
    max-width: 1000px;
    margin: 0 auto;
}

/* ==========================================================================
   Season Details
   ========================================================================== */
.season-details-section {
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.week-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.week-selector-bar .section-title {
    margin: 0;
    margin-top: 2rem;
}

/* ==========================================================================
   Tab Navigation
   ========================================================================== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    position: relative;
    transition: color 0.2s;
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media (max-width: 768px) {
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }

    .page-header-row {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Progress / Meter Bars
   ========================================================================== */
.progress-bar {
    height: 8px;
    background: var(--white-08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.danger {
    background: var(--danger);
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.info {
    background: var(--info);
}

.progress-fill.primary {
    background: var(--primary);
}

/* ==========================================================================
   Weather Page Components
   ========================================================================== */
.weather-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.weather-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.weather-condition {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.condition-clear {
    background: var(--success-dim);
    color: var(--success);
}

.condition-rain {
    background: var(--info-dim);
    color: var(--info);
}

.condition-snow {
    background: var(--snow-bg);
    color: var(--alert-info-text);
}

.condition-wind {
    background: var(--warning-dim);
    color: var(--warning);
}

.condition-extreme {
    background: var(--danger-dim);
    color: var(--danger);
}

.impact-positive {
    color: var(--success);
}

.impact-negative {
    color: var(--danger);
}

.impact-neutral {
    color: var(--text-muted);
}

/* ==========================================================================
   Schedule / Matchup Components
   ========================================================================== */
.difficulty-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.difficulty-very-hard {
    background: var(--danger-ef-bg);
    color: var(--danger);
}

.difficulty-hard {
    background: var(--orange-bg);
    color: var(--accent-orange);
}

.difficulty-medium {
    background: var(--yellow-bg);
    color: var(--warning);
}

.difficulty-easy {
    background: var(--success-green-bg);
    color: var(--success);
}

.difficulty-very-easy {
    background: var(--success-dark-bg);
    color: var(--success-dark);
}

.win-prob-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--danger-dim);
}

.win-prob-fill {
    background: var(--success);
    transition: width 0.5s ease;
}

/* ==========================================================================
   Trade Analyzer Components
   ========================================================================== */
.trade-side {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.trade-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.trade-verdict {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.trade-verdict.fair {
    background: var(--success-dim);
    border: 1px solid var(--success);
}

.trade-verdict.unfair {
    background: var(--danger-dim);
    border: 1px solid var(--danger);
}

.trade-verdict.slight {
    background: var(--warning-dim);
    border: 1px solid var(--warning);
}

/* ==========================================================================
   Dynasty / Keeper Components
   ========================================================================== */
.dynasty-tier {
    margin-bottom: 1.5rem;
}

.dynasty-tier-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.trajectory-arrow {
    font-size: 1.2rem;
}

.trajectory-rising {
    color: var(--success);
}

.trajectory-stable {
    color: var(--info);
}

.trajectory-declining {
    color: var(--warning);
}

.trajectory-falling {
    color: var(--danger);
}

/* ==========================================================================
   Auction Components
   ========================================================================== */
.auction-budget-bar {
    background: var(--white-05);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.budget-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
}

.budget-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.value-tier {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.value-elite {
    background: var(--gold-bg-strong);
    color: var(--primary);
}

.value-starter {
    background: var(--success-dim);
    color: var(--success);
}

.value-bench {
    background: var(--warning-dim);
    color: var(--warning);
}

.value-filler {
    background: var(--gray-muted-bg);
    color: var(--text-muted);
}

/* ==========================================================================
   Superflex Components
   ========================================================================== */
.premium-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.premium-high {
    background: var(--danger-dim);
    color: var(--danger);
}

.premium-medium {
    background: var(--warning-dim);
    color: var(--warning);
}

.premium-low {
    background: var(--success-dim);
    color: var(--success);
}

/* ==========================================================================
   Notification Components
   ========================================================================== */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--card-bg-hover);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.notification-body {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Confidence Interval Components
   ========================================================================== */
.ci-bar {
    position: relative;
    height: 32px;
    background: var(--white-05);
    border-radius: var(--radius-sm);
    overflow: visible;
}

.ci-range {
    position: absolute;
    top: 4px;
    bottom: 4px;
    background: var(--primary-dim);
    border: 1px solid var(--primary);
    border-radius: 3px;
}

.ci-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--secondary);
}

/* ==========================================================================
   Scoring Format Toggle (site-wide component)
   ========================================================================== */
.scoring-toggle {
    display: inline-flex;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.scoring-toggle-btn {
    padding: 0.4rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all 0.2s;
}

.scoring-toggle-btn:hover {
    color: var(--text-main);
}

.scoring-toggle-btn.active {
    background: var(--primary);
    color: var(--text-light);
    box-shadow: var(--gold-glow-sm);
}

@media (max-width: 480px) {
    .scoring-toggle {
        width: 100%;
        display: flex;
    }

    .scoring-toggle-btn {
        flex: 1;
        text-align: center;
    }
}

/* ==========================================================================
   Pricing Page
   ========================================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: var(--content-max-width, 1440px);
    margin: 0 auto;
}

.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-dim);
}

.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-light);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 16px;
    border-radius: 99px;
    letter-spacing: 1px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 900;
    margin: 1rem 0;
    color: var(--text-main);
}

.pricing-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.pricing-features li::before {
    content: '\2713';
    color: var(--success);
    font-weight: 700;
}

.pricing-features li.disabled {
    color: var(--text-muted);
    opacity: 0.5;
}

.pricing-features li.disabled::before {
    content: '\2717';
    color: var(--danger);
}

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

@media (max-width: 480px) {
    .pricing-price {
        font-size: 2.2rem;
    }
}

/* ==========================================================================
   Blog Pages
   ========================================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.blog-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

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

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.05rem;
}

.blog-post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.blog-post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-post-content p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.blog-post-content code {
    background: var(--input-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--secondary);
}

.blog-post-content pre {
    background: var(--input-bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.blog-post-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

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

/* ==========================================================================
   Profile Page
   ========================================================================== */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-light);
}

.profile-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.profile-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* TEP-288 Phase 2 — danger-zone variant for irreversible actions
   (export data, delete account). Pairs with .danger-btn. */
.profile-section--danger {
    border-color: var(--alert-danger-border, var(--danger));
}

.profile-section--danger h2 {
    color: var(--danger);
}

.danger-btn {
    padding: 0.625rem 1.25rem;
    background: var(--danger);
    color: var(--text-on-danger, #fff);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold, 600);
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.danger-btn:hover {
    opacity: 0.9;
}

/* TEP-288 Phase 2 — toggle row used across Preferences /
   Notifications / Privacy tabs. Originally inline in settings.html
   (now deleted); promoted to a shared component. */
.setting-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle, var(--border-color));
}

.setting-toggle:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-toggle-info {
    flex: 1;
    padding-right: 1rem;
}

.setting-toggle-title {
    font-weight: var(--font-weight-semibold, 600);
    margin-bottom: 0.25rem;
}

.setting-toggle-description {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-muted);
}

/* ==========================================================================
   Subscription Plan Display
   ========================================================================== */
.subscription-plan {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--white-03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.subscription-plan.active-plan {
    background: var(--primary-dim);
    border-color: var(--primary);
}

/* ==========================================================================
   Features Checklist
   ========================================================================== */
.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-light);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li::before {
    content: '\2713';
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}

/* ==========================================================================
   Pro Feature Gate
   ========================================================================== */
.pro-gate-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-pro-gate);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 2rem;
}

.pro-gate-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.pro-gate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pro-gate-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.pro-gate-card>p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.pro-gate-features {
    text-align: left;
    margin-bottom: 2rem;
}

.pro-gate-feature {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-light);
    font-size: 0.9rem;
}

.pro-gate-feature::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.pro-gate-btn {
    width: 100%;
    display: block;
    text-align: center;
    font-size: 1.1rem;
    padding: 0.85rem 2rem;
}

.pro-gate-trial {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

.pro-gate-login {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.pro-gate-login a {
    color: var(--primary);
}

/* Content blur for gated features */
.pro-gated-content {
    filter: none;
    pointer-events: auto;
    user-select: auto;
    opacity: 1;
}

body.paywalls-on .pro-gated-content {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    opacity: 0.5;
}

/* ==========================================================================
   TADS — bogus &var(--token); cleanup: semantic list/section markers (no raw CSS in HTML text)
   ========================================================================== */
.tads-marker {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    vertical-align: 0.12em;
    flex-shrink: 0;
}

.tads-marker--card {
    width: 0.65rem;
    height: 0.65rem;
    vertical-align: 0.08em;
}

.tads-marker--embed {
    width: 0.85rem;
    height: 0.85rem;
    vertical-align: middle;
}

.tads-marker--accent-teal {
    color: var(--accent-teal);
}

.tads-marker--f1 {
    color: var(--sport-f1);
}

.tads-marker--mlb {
    color: var(--sport-mlb);
}

.tads-marker--nba {
    color: var(--sport-nba);
}

.tads-marker--esports {
    color: var(--sport-esports);
}

.tads-marker--tennis {
    color: var(--sport-tennis);
}

.tads-marker--soccer {
    color: var(--sport-soccer);
}

.tads-marker--ufc {
    color: var(--sport-ufc);
}

/* ---------------------------------------------------------------------------
   TEP-239 Phase 3 — Divergence callout primitive
   --------------------------------------------------------------------------- */

.torch-divergence {
    display: inline-flex;
    flex-direction: column;
    gap: var(--sp-2xs);
    min-width: 280px;
    padding: var(--sp-sm) var(--sp-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    color: var(--text-main);
}

.torch-divergence__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-md);
}

.torch-divergence__label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.torch-divergence__edge {
    font-size: var(--fs-md);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.torch-divergence__edge--pos { color: var(--success); }
.torch-divergence__edge--neg { color: var(--danger); }

.torch-divergence__gauge {
    position: relative;
    height: 8px;
    background: var(--card-bg-hover);
    border-radius: var(--radius-sm);
}

.torch-divergence__gap {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--primary-dim);
    border-radius: var(--radius-sm);
}

.torch-divergence__tick {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 14px;
    margin-left: -1px;
}

.torch-divergence__tick--model { background: var(--primary); }
.torch-divergence__tick--market { background: var(--text-muted-strong); }

.torch-divergence__legend {
    display: flex;
    align-items: baseline;
    gap: var(--sp-sm);
    font-size: var(--fs-2xs);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.torch-divergence__chip {
    padding: 1px var(--sp-xs);
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}

.torch-divergence__chip--model { color: var(--primary); background: var(--primary-dim); }
.torch-divergence__chip--market { color: var(--text-main); background: transparent; border: 1px solid var(--border-color); }

.torch-divergence__n { margin-left: auto; color: var(--text-muted); }
.torch-divergence__n--low { color: var(--warning); }

.torch-divergence__history {
    font-size: var(--fs-2xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   TEP-238 — Handoff chip component
   --------------------------------------------------------------------------- */

.torch-handoff-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: var(--sp-xs) var(--sp-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease;
}

.torch-handoff-chip:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.torch-handoff-chip:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.torch-handoff-chip:disabled,
.torch-handoff-chip[data-handoff-busy="1"] {
    opacity: 0.6;
    cursor: progress;
}

.torch-handoff-chip--sm { font-size: var(--fs-sm); padding: var(--sp-2xs) var(--sp-sm); }
.torch-handoff-chip--md { font-size: var(--fs-base); padding: var(--sp-xs) var(--sp-md); }

.torch-handoff-chip--ember {
    border-style: dashed;
}

.torch-handoff-chip__icon {
    font-family: inherit;
    line-height: 1;
}

.torch-handoff-chip__label {
    font-variant-numeric: tabular-nums;
}
