/* ═══════════════════════════════════════════════════
   Players Page
   ═══════════════════════════════════════════════════ */

/* ── Add Player Button ─────────────────────────── */

.btn-add {
    background: var(--green);
}

.btn-add:hover {
    background: #059669;
}

/* ── Progress ─────────────────────────────────── */

.progress-container {
    width: 100%;
    background: var(--surface-3);
    border-radius: var(--radius-xl);
    padding: 3px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 26px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-xl);
    text-align: center;
    line-height: 26px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Mobile helpers ───────────────────────────── */

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .player-name {
        font-weight: 600;
    }
}

/* ── Rating values ────────────────────────────── */

.rating {
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.rating-value {
    font-variant-numeric: tabular-nums;
}

.pdga-number {
    color: var(--text-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

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

.rating-change {
    font-weight: 600;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.refresh-section {
    display: inline-flex;
    align-items: center;
}

.predicted-value {
    position: relative;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.difference {
    font-weight: 600;
}

/* ── Chart ────────────────────────────────────── */

.chart-container {
    width: 100%;
    height: 300px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    overflow: hidden;
}

.chart-title {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.loading-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 13px;
}

.chart-tooltip {
    position: fixed;
    background: var(--navy-900);
    color: var(--text-inverse);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    pointer-events: none;
    z-index: 10000;
    display: none;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

/* ── Tooltips ─────────────────────────────────── */

.std-dev-tooltip {
    position: absolute;
    background: var(--navy-900);
    color: var(--text-inverse);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    pointer-events: none;
    z-index: 10000;
    display: none;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    font-weight: 400;
}

/* ── Debug Icon ───────────────────────────────── */

.debug-icon:hover {
    opacity: 1 !important;
    color: var(--accent) !important;
}

/* ── Debug Modal ──────────────────────────────── */

.debug-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
}

.debug-content {
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-overlay);
    position: relative;
}

.debug-header {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.debug-log {
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-line;
    color: var(--text-primary);
}

.debug-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    line-height: 1;
}

.debug-close:hover {
    color: var(--text-primary);
    background: var(--surface-3);
}

/* ── Add Player Modal ─────────────────────────── */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-overlay);
    position: relative;
    overflow: hidden;
}

.modal-header {
    font-weight: 700;
    font-size: 17px;
    padding: 20px 24px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.modal-body {
    padding: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--surface-2);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--surface-3);
}

.btn-cancel {
    background: var(--surface-3);
    color: var(--text-primary);
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-confirm {
    background: var(--green);
}

.btn-confirm:hover {
    background: #059669;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
        margin: 5px 0;
    }

    .chart-title {
        font-size: 13px;
    }
}
