/* KoUcuzGB — price board views (shared by index.html and rise-online.html).
 * Uses the variables aliased in /css/board-page.css (→ shared tokens in /css/kuz-ui.css). */

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

/* ===== buttons reset (tabs + price cells are real <button>s) ===== */
button.server-tab,
button.price-tag,
button.mini-price,
button.mx-price {
    -webkit-appearance: none; appearance: none;
    font: inherit; line-height: inherit;
    border: 1px solid transparent; background: transparent; cursor: pointer;
}
button.server-tab { font-family: var(--font-heading); font-weight: 600; color: var(--fg-muted); }
.server-tab.active { color: #fff; }
.server-tab.is-upcoming:not(.active) { color: var(--fg-dim); }
.server-tab:focus-visible,
.seg-btn:focus-visible,
.price-tag:focus-visible,
.mini-price:focus-visible,
.mx-price:focus-visible,
.hist-close:focus-visible,
.mx-scroll:focus-visible,
.hist-chart svg:focus-visible,
.sponsor-item:focus-visible,
.trust-how summary:focus-visible,
.site-name a:focus-visible,
.mini-site a:focus-visible,
.mx-site a:focus-visible {
    outline: 2px solid var(--k-focus, #C4B5FD);
    outline-offset: 2px;
}

/* ===== toolbar (Görünüm / Sırala) ===== */
.board-toolbar {
    display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap;
    gap: 8px; margin: 0 0 0 auto;
    min-height: 34px;
}
.seg {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 3px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
}
.seg-label {
    font-size: 0.72rem; font-weight: 600; color: var(--fg-dim);
    text-transform: uppercase; letter-spacing: 0.6px; padding: 0 6px 0 8px;
}
.seg-btn {
    -webkit-appearance: none; appearance: none;
    border: 0; background: transparent; color: var(--fg-muted);
    font: 600 0.8rem var(--font-heading); padding: 6px 10px; min-height: 30px;
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: var(--radius-xs); cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.seg-btn .ki { width: 14px; height: 14px; }
.seg-btn:hover { color: var(--fg); background: var(--bg-surface); }
.seg-btn.active { color: #fff; background: var(--primary); }

/* ===== price cells: shared states ===== */
.price-tag, .mini-price, .mx-price { position: relative; white-space: nowrap; }
.mini-price.sell, .mini-price.buy, .mx-price.sell, .mx-price.buy { color: var(--fg); }
.mini-price.no-data, .mx-price.no-data { color: var(--fg-dim); text-align: center; display: block; }
.price-tag:hover:not(.no-data), .mini-price:hover:not(.no-data), .mx-price:hover:not(.no-data) {
    box-shadow: inset 0 0 0 1px var(--border-accent);
}
/* stale: dimmed text (still AA), dashed outline + clock icon — never highlighted as best */
.price-tag.is-stale, .mini-price.is-stale, .mx-price.is-stale {
    color: var(--fg-dim); background: transparent; font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    outline: 1px dashed rgba(255, 255, 255, 0.22); outline-offset: -1px;
}
.stale-icon { vertical-align: -1px; margin-right: 3px; flex-shrink: 0; }
.price-row.row-stale .site-name a { color: var(--fg-muted); }

/* change flash */
.flash-arrow { font-size: 0.7em; margin-left: 3px; vertical-align: 1px; }
.price-flash.flash-good { color: var(--success) !important; box-shadow: inset 0 0 0 1px var(--success-border); }
.price-flash.flash-bad { color: var(--danger) !important; box-shadow: inset 0 0 0 1px var(--danger-border); }
@keyframes flashGood { 0% { background: rgba(34, 197, 94, 0.45); } 100% { background: var(--success-bg); } }
@keyframes flashBad { 0% { background: rgba(239, 68, 68, 0.45); } 100% { background: var(--danger-bg); } }
.price-flash.flash-good { animation: flashGood 2s ease-out both; }
.price-flash.flash-bad { animation: flashBad 2s ease-out both; }
@media (prefers-reduced-motion: reduce) {
    .price-flash.flash-good, .price-flash.flash-bad { animation: none; }
    .price-flash.flash-good { background: var(--success-bg); }
    .price-flash.flash-bad { background: var(--danger-bg); }
    .fade-in { animation: none !important; }
}

/* ===== single server rows: keep the clickable tags tidy ===== */
.price-row .price-tag { display: inline-flex; align-items: center; justify-content: center; width: 100%; }

/* ===== card view ===== */
.server-card .mini-price { width: 100%; }
.server-card-body .upcoming-box { margin: 10px; }

/* ===== upcoming server ===== */
.upcoming-box {
    padding: 22px 18px; text-align: center; color: var(--fg-muted);
    background: var(--bg-surface); border: 1px dashed var(--border-accent); border-radius: var(--radius);
    font-size: 0.9rem;
}
.upcoming-box strong { color: var(--fg); }
.upcoming-meta { margin-top: 8px; font-size: 0.82rem; }
.countdown {
    display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums;
    font-family: var(--font-heading); font-weight: 700; color: var(--warning);
}
.upcoming-when { color: var(--fg-dim); }

/* ===== matrix table ===== */
.board-matrix[hidden] { display: none; }
.mx-scroll {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card);
    max-width: 100%;
}
.mx-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.85rem; }
.mx-table th, .mx-table td { padding: 0; border-bottom: 1px solid var(--border); }
.mx-table tbody tr:last-child th, .mx-table tbody tr:last-child td { border-bottom: 0; }
.mx-table thead th {
    font-family: var(--font-heading); font-weight: 700; color: var(--fg);
    padding: 10px 8px; text-align: center; white-space: nowrap;
    background: var(--bg-elevated);
}
.mx-server { border-left: 1px solid var(--border); }
.mx-server.is-upcoming { color: var(--fg-muted); }
.mx-badge {
    display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px;
    font-size: 0.62rem; letter-spacing: 0.4px; vertical-align: 1px;
    background: var(--primary-glow); color: var(--secondary);
}
.mx-sub {
    font-size: 0.66rem !important; text-transform: uppercase; letter-spacing: 0.6px;
    padding: 6px 8px !important;
}
.mx-sub.mx-sell { color: var(--success) !important; border-left: 1px solid var(--border); }
.mx-sub.mx-buy { color: var(--buy, #FBBF24) !important; }
.mx-site {
    position: sticky; left: 0; z-index: 2;
    background: var(--bg-card);
    text-align: left; padding: 8px 12px !important;
    min-width: 104px; max-width: 140px;
    box-shadow: 1px 0 0 var(--border), 6px 0 8px -6px rgba(0, 0, 0, 0.6);
    font-family: var(--font-heading); font-weight: 600;
}
thead .mx-site { z-index: 3; background: var(--bg-elevated); }
.mx-corner { text-transform: uppercase; font-size: 0.7rem !important; letter-spacing: 1px; color: var(--fg-dim) !important; }
.mx-site a { color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.mx-site a:hover { color: var(--secondary); }
.mx-td { padding: 4px !important; text-align: right; border-left: 1px solid var(--border); }
.mx-td.mx-td-buy { border-left: 0; }
.mx-price {
    display: inline-flex; align-items: center; justify-content: flex-end;
    min-width: 72px; padding: 5px 8px; border-radius: 4px;
    font-family: var(--font-heading); font-weight: 700; font-size: 0.84rem;
}
.mx-price.best-sell { color: var(--success); background: var(--success-bg); }
.mx-price.best-buy { color: var(--buy, #FBBF24); background: var(--buy-bg, rgba(251, 191, 36, 0.12)); }
.mx-upcoming {
    text-align: center; vertical-align: middle; padding: 12px !important; min-width: 140px;
    color: var(--fg-muted); font-size: 0.8rem; border-left: 1px solid var(--border);
    background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.015) 8px, rgba(255, 255, 255, 0.015) 16px);
}
.mx-upcoming strong { color: var(--fg); }
.mx-empty { padding: 20px !important; color: var(--fg-muted); }
.mx-table tbody tr:hover td, .mx-table tbody tr:hover th { background-color: rgba(255, 255, 255, 0.02); }
.mx-table tbody tr:hover .mx-site { background: var(--bg-elevated); }

/* ===== sponsor ===== */
.sponsor-box { margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.sponsor-box[hidden] { display: none; }
.sponsor-label {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--fg-dim);
}
.sponsor-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--fg); text-decoration: none; transition: border-color 0.2s;
}
.sponsor-item:hover { border-color: var(--border-accent); }
.sponsor-item--placeholder { border-style: dashed; background: transparent; justify-content: center; text-align: center; }
.sponsor-item--placeholder .sponsor-text { align-items: center; }
.sponsor-img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; flex-shrink: 0; background: var(--bg-surface); }
.sponsor-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.sponsor-text strong { font-family: var(--font-heading); }
.sponsor-desc { font-size: 0.84rem; color: var(--fg-muted); }
.sponsor-go { color: var(--secondary); flex-shrink: 0; display: inline-flex; }

/* ===== trust strip ===== */
.trust-strip {
    margin: 16px 0 0; padding: 12px 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-surface);
    font-size: 0.82rem; color: var(--fg-muted); text-align: center;
}
.trust-strip[hidden] { display: none; }
.trust-line { margin: 0; }
.trust-how { margin-top: 6px; }
.trust-how summary {
    display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--secondary); font-weight: 600; list-style: none;
    padding: 4px 6px; border-radius: 4px;
}
.trust-how summary::-webkit-details-marker { display: none; }
.trust-how-body { text-align: left; margin-top: 8px; line-height: 1.6; }
.trust-how-body p { margin-bottom: 8px; }
.trust-how-body code { font-size: 0.8rem; padding: 1px 5px; border-radius: 4px; background: var(--bg-elevated); color: var(--fg); }

/* ===== history modal ===== */
html.hist-open, html.hist-open body { overflow: hidden; }
.hist-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(5, 5, 15, 0.72);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.hist-backdrop[hidden] { display: none; }
.hist-modal {
    width: 100%; max-width: 720px; max-height: calc(100vh - 32px); overflow-y: auto;
    background: var(--bg-base); border: 1px solid var(--border-accent); border-radius: var(--radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    padding: 18px;
}
.hist-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hist-title { font: 700 1.05rem/1.35 var(--font-heading); color: var(--fg); margin: 2px 0 0; overflow-wrap: anywhere; }
.hist-close {
    -webkit-appearance: none; appearance: none; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--fg); cursor: pointer;
}
.hist-close .ki { width: 18px; height: 18px; }
.hist-close:hover { background: var(--bg-elevated); }
.hist-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 14px 0 12px; }
.hist-body { min-height: 200px; }
.hist-empty {
    min-height: 200px; display: flex; align-items: center; justify-content: center; text-align: center;
    color: var(--fg-muted); padding: 24px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.hist-chart { position: relative; }
.hist-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; border-radius: var(--radius-xs); }
.hc-grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.hc-ylab, .hc-xlab { fill: var(--fg-dim); font-size: 11px; font-family: var(--font-body); }
.hc-band { fill: rgba(34, 197, 94, 0.16); }
.hc-line { fill: none; stroke: var(--success); stroke-width: 2; stroke-linejoin: round; }
.is-buy .hc-band { fill: rgba(251, 191, 36, 0.16); }
.is-buy .hc-line { stroke: var(--buy, #FBBF24); }
.hc-cursor { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 3 3; }
.hc-dot { fill: var(--fg); stroke: var(--bg-base); stroke-width: 2; }
.hc-tip {
    position: absolute; pointer-events: none; z-index: 2;
    padding: 6px 9px; border-radius: 6px; font-size: 0.78rem; line-height: 1.4; white-space: nowrap;
    background: var(--bg-elevated); border: 1px solid var(--border-accent); color: var(--fg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.hc-tip-sub { color: var(--fg-muted); }
.hist-legend { margin: 8px 0 12px; font-size: 0.74rem; color: var(--fg-dim); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.lg-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lg-band, .lg-line { display: inline-block; width: 14px; vertical-align: middle; }
.lg-band { height: 8px; background: rgba(34, 197, 94, 0.25); border-radius: 2px; }
.lg-line { height: 2px; background: var(--success); }
.is-buy ~ .hist-legend .lg-band { background: rgba(251, 191, 36, 0.25); }
.is-buy ~ .hist-legend .lg-line { background: var(--buy, #FBBF24); }
.hist-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hist-card {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
    border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border);
}
.hist-card .hc-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--fg-dim); }
.hist-card strong { font: 700 1rem var(--font-heading); color: var(--fg); font-variant-numeric: tabular-nums; }
.hist-card.good strong { color: var(--success); }
.hist-card.bad strong { color: var(--danger); }
.hist-sentence { margin: 12px 0 0; font-size: 0.9rem; color: var(--fg); line-height: 1.5; }

/* ===== responsive ===== */
@media (max-width: 640px) {
    .hist-modal { padding: 14px; }
    .hist-cards { grid-template-columns: repeat(2, 1fr); }
    .hist-backdrop { padding: 8px; align-items: flex-end; }
    .hist-modal { max-height: calc(100vh - 16px); }
    .mx-site { min-width: 92px; padding: 8px 8px !important; }
    .mx-price { min-width: 56px; font-size: 0.8rem; }
}
@media (max-width: 380px) {
    .seg-btn { padding: 6px 8px; }
}
