/* ==========================================
   2180.info - Analysis Page Styles
   ========================================== */

/* Layout with evaluation bar */
.board-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex: 1;
    max-width: 600px;
    width: 100%;
}

/* Evaluation Bar */
.eval-bar-container {
    width: 24px;
    background: #262421; /* Black side default */
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.eval-bar-fill {
    width: 100%;
    background: #f1f1f1; /* White side default */
    height: 50%; /* Starts at 50% (equal chances) */
    transition: height 0.3s ease;
}

.eval-bar-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    z-index: 5;
    pointer-events: none;
}

/* Text positions depending on who is winning */
.eval-bar-text.white-winning {
    bottom: 6px;
    color: #101018;
}

.eval-bar-text.black-winning {
    top: 6px;
    color: #f1f1f1;
}

/* Sidebar Panels */
.sidebar-panel {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
    height: 600px; /* Match board max-height */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-glass);
}

.panel-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.panel-tab:hover {
    color: white;
}

.panel-tab.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    background: rgba(124, 58, 237, 0.03);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Moves list grid styling */
.moves-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.move-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    align-items: center;
}

.move-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.move-number-col {
    color: var(--color-text-muted);
    font-weight: 500;
}

.move-btn {
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.move-btn:hover {
    background: var(--bg-surface-hover);
}

.move-btn.active {
    background: var(--color-primary-glow);
    color: white;
    font-weight: 600;
}

/* Classification Badges */
.badge-classification {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
}

.badge-brilliant { background-color: #1baca6; color: white; }
.badge-great { background-color: #22ac38; color: white; }
.badge-best { background-color: #96bc4b; color: white; }
.badge-book { background-color: #a5753f; color: #ffd8a8; }
.badge-good { background-color: #8c8c8c; color: white; }
.badge-inaccuracy { background-color: #56b4e9; color: white; }
.badge-mistake { background-color: #e58f2a; color: white; }
.badge-miss { background-color: #ff3366; color: white; }
.badge-blunder { background-color: #ca3431; color: white; }

/* Game Summary Statistics */
.summary-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.accuracy-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.accuracy-circle {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) calc(var(--percent) * 1%), rgba(255,255,255,0.05) 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.accuracy-circle::after {
    content: '';
    position: absolute;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--bg-surface);
}

.accuracy-circle-text {
    position: relative;
    z-index: 5;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
}

.accuracy-label-box {
    flex: 1;
}

.accuracy-player {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

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

/* Table of move stats */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.stats-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.9rem;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stat-val {
    font-weight: 700;
    text-align: right;
}

/* Analysis Control Panel (Navigation) */
.analysis-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 1rem;
    border-top: 1px solid var(--border-glass);
}

.control-btn {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px;
    color: var(--color-text);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.control-btn:hover {
    background: rgba(255,255,255,0.08);
}

/* Evaluation swing graph */
.chart-container {
    width: 100%;
    height: 180px;
    margin-top: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--border-glass);
}

/* Code tags in coach commentary (move notations) */
#coach-commentary-text code {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    font-weight: 700;
    color: #e2b96e;
    white-space: nowrap;
}

