/* ═══════════════════════════════════════════════
   SKAK.GL — Analyse Panel CSS
   Bruges af spil/parti.php og partier/parti.php
   ═══════════════════════════════════════════════ */

/* ─── Analyse-knap ───────────────────────────── */
.analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #1a1a2e;
    color: white;
    border: 2px solid #1a1a2e;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
    justify-content: center;
}
.analysis-btn:hover { background: #c62828; border-color: #c62828; }
.analysis-btn:disabled { opacity: .5; cursor: not-allowed; }
.analysis-btn.running { background: #e67e22; border-color: #e67e22; }

/* ─── Panel wrapper ──────────────────────────── */
#analysis-panel {
    display: none;
    margin-top: 0;
}
.analysis-box {
    background: white;
    border: 2px solid #e0e0e0;
}
.analysis-box-head {
    background: #1a1a2e;
    color: white;
    padding: 8px 14px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.analysis-box-body {
    padding: 12px 14px;
}

/* ─── Eval Bar (vertikal) ────────────────────── */
.analysis-eval-wrap {
    position: relative;
    width: 28px;
    height: 400px;
    background: #333;
    flex-shrink: 0;
    overflow: hidden;
}
.analysis-eval-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: white;
    transition: height .4s ease;
}
.analysis-eval-text {
    position: absolute;
    top: 4px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 9px;
    font-weight: 900;
    color: white;
    z-index: 1;
    text-shadow: 0 0 3px rgba(0,0,0,.5);
}

/* Eval bar horizontaal (for under bræt) */
.analysis-eval-horizontal {
    height: 6px;
    background: #333;
    position: relative;
    overflow: hidden;
}
.analysis-eval-horizontal .eval-white {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: white;
    width: 50%;
    transition: width .4s ease;
}

/* ─── Progress bar ───────────────────────────── */
.analysis-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.analysis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c62828, #e67e22);
    transition: width .3s;
    border-radius: 3px;
}
.analysis-progress-text {
    font-size: 11px;
    color: #999;
    font-weight: 600;
}

/* ─── Accuracy boxes ─────────────────────────── */
.analysis-accuracy-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.analysis-accuracy-box {
    text-align: center;
    padding: 12px 8px;
    background: #f7f3ed;
    border: 1px solid #e0e0e0;
}
.accuracy-label {
    font-size: 12px;
    font-weight: 800;
    color: #0b1a22;
    margin-bottom: 4px;
}
.accuracy-pct {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
}
.accuracy-acpl {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    margin-top: 2px;
}
.accuracy-errors {
    font-size: 11px;
    margin-top: 6px;
    font-weight: 600;
}

/* ─── Trækdetaljer ───────────────────────────── */
.analysis-moves-detail {
    max-height: 250px;
    overflow-y: auto;
}
.analysis-move-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.analysis-move-item:hover { background: #fafafa; }
.amove-num { color: #999; font-weight: 700; font-family: 'Courier New', monospace; min-width: 28px; }
.amove-san { font-weight: 800; font-family: 'Courier New', monospace; min-width: 48px; }
.amove-cls { font-weight: 700; font-size: 11px; flex: 1; }
.amove-cpl { font-size: 10px; color: #999; font-family: 'Courier New', monospace; }

/* ─── Save status ────────────────────────────── */
#analysis-save-status {
    font-size: 10px;
    color: #2ecc71;
    font-weight: 600;
    text-align: right;
    padding: 4px 14px;
}

/* ─── Depth selector ─────────────────────────── */
.analysis-depth-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 11px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}
.analysis-depth-row input[type="range"] {
    flex: 1;
    accent-color: #c62828;
}
.analysis-depth-row .depth-val {
    font-weight: 800;
    color: #0b1a22;
    min-width: 20px;
    text-align: center;
}

/* ─── Trækfortegnelse med analyse-markering ──── */
.move-list .move[style*="border-left"] {
    padding-left: 5px;
    margin-left: -3px;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 860px) {
    .analysis-eval-wrap { display: none; }
    .analysis-accuracy-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
    .analysis-accuracy-box { padding: 8px 4px; }
    .accuracy-pct { font-size: 22px; }
}

/* ─── Dark mode ──────────────────────────────── */
[data-theme="dark"] .analysis-box { background: #1a1a2e; border-color: #2a2a40; }
[data-theme="dark"] .analysis-box-head { background: #16213e; }
[data-theme="dark"] .analysis-box-body { background: #1a1a2e; }
[data-theme="dark"] .analysis-accuracy-box { background: #16213e; border-color: #2a2a40; }
[data-theme="dark"] .accuracy-label { color: #e8e8f0; }
[data-theme="dark"] .analysis-move-item { border-bottom-color: #2a2a40; }
[data-theme="dark"] .analysis-move-item:hover { background: #16213e; }
[data-theme="dark"] .analysis-progress-bar { background: #2a2a40; }
[data-theme="dark"] .analysis-btn { background: #16213e; border-color: #2a2a40; }
[data-theme="dark"] .analysis-btn:hover { background: #c62828; border-color: #c62828; }
[data-theme="dark"] .analysis-depth-row { border-bottom-color: #2a2a40; color: #a0a0b8; }
[data-theme="dark"] .analysis-depth-row .depth-val { color: #e8e8f0; }