/* analysis_style.css (shared by Corner & LCTR analysis) */

/* --- Analysis Panel & Undo Button --- */
#analysis-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    padding: 15px;
    font-family: inherit;
    color: inherit;
    font-size: 14px;
    overflow-y: auto;
    display: none; /* Hidden by default */
    z-index: 100;
}

#analysis-container.visible {
    display: block;
}

/* Analysis header styling */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid currentColor;
    padding-bottom: 5px;
}

.analysis-header h3 {
    margin: 0;
    font-size: 16px;
    color: inherit;
}

/* Analysis info button styling */
#analysis-info-btn {
    font-size: 14px;
    padding: 4px 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

#analysis-info-btn:hover {
    opacity: 1;
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--orange, #FF6B35);
    transform: scale(1.05);
}

#analysis-container p {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
}

#analysis-container .label {
    opacity: 0.7;
}

#undo-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    padding: 10px 15px;
    background: rgba(40, 40, 40, 0.8);
    color: #FFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    display: none; /* Hidden by default */
    z-index: 100;
}

#undo-btn.visible {
    display: block;
}

/* --- On-Hover Highlighting --- */
.tile.winning-move-highlight {
    background-color: rgba(76, 175, 80, 0.5) !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
}

.tile.blunder-move-highlight {
    background-color: rgba(244, 67, 54, 0.5) !important;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.8);
}

.tile.neutral-move-highlight {
    background-color: rgba(33, 150, 243, 0.5) !important;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.8);
}

/* --- Chart Container Styling --- */
.chart-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid currentColor;
    height: flex;
}

.chart-container .label {
    display: block;
    margin-bottom: 8px;
    opacity: 0.7;
}

#g-number-chart {
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: block;
    margin: 0 auto;
}

/* --- Optimal Moves Styling --- */
.optimal-moves-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid currentColor;
}

.optimal-moves-container .label {
    display: block;
    margin-bottom: 8px;
    opacity: 0.7;
}

.optimal-moves-list {
    font-family: 'JetBrains Mono', 'Source Code Pro', monospace;
    font-size: 12px;
    line-height: 1.4;
    max-height: 80px;
    overflow-y: auto;
    word-wrap: break-word;
    opacity: 0.9;
}

.optimal-moves-list .move-option {
    padding: 2px 0;
    border-bottom: 1px solid currentColor;
}

.optimal-moves-list .move-option:last-child {
    border-bottom: none;
}

/* --- Analysis Toggle Button --- */
.analysis-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 101;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Move the button when analysis panel is visible */
.analysis-toggle-btn.panel-visible {
    right: 320px; /* Move to the left of the analysis panel */
}

.analysis-toggle-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.analysis-toggle-btn.active {
    background: var(--accent-color);
    color: var(--bg-primary);
    border-color: var(--accent-color);
}

.analysis-toggle-btn.active::after {
    content: '>';
}

.analysis-toggle-btn.active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

