/**
 * BPE (Byte Pair Encoding) Visualizer Styles
 * Visualization-specific styles only. Common styles are in visualizations.css.
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --bpe-char-bg: #e3f2fd;
    --bpe-char-border: #1976d2;
    --bpe-char-text: #1565c0;
    --bpe-merged-bg: #e8f5e9;
    --bpe-merged-border: #43a047;
    --bpe-merged-text: #2e7d32;
    --bpe-active-bg: #fff3e0;
    --bpe-active-border: #ff8c00;
    --bpe-active-text: #e65100;
    --bpe-active-glow: rgba(255, 140, 0, 0.4);
    --bpe-eow-bg: #f5f5f5;
    --bpe-eow-border: #bdbdbd;
    --bpe-eow-text: #9e9e9e;
    --bpe-bar-fill: #42a5f5;
    --bpe-bar-highlight: #ff8c00;
    --bpe-bar-bg: #e0e0e0;
    --bpe-arrow-color: #ff8c00;
    --bpe-arrow-glow: rgba(255, 140, 0, 0.3);
    --bpe-vocab-pill-bg: #e8f5e9;
    --bpe-vocab-pill-border: #66bb6a;
    --bpe-vocab-pill-text: #2e7d32;
    --bpe-vocab-new-bg: #fff3e0;
    --bpe-vocab-new-border: #ff8c00;
    --bpe-vocab-new-text: #e65100;
    --bpe-rule-text: #555;
    --bpe-rule-highlight: #ff8c00;
    --bpe-section-title: #666;
    --bpe-label-color: #555;
    --bpe-canvas-text: #333;
}

[data-theme="gruvbox-dark"] {
    --bpe-char-bg: rgba(131, 165, 152, 0.2);
    --bpe-char-border: #83a598;
    --bpe-char-text: #83a598;
    --bpe-merged-bg: rgba(184, 187, 38, 0.15);
    --bpe-merged-border: #b8bb26;
    --bpe-merged-text: #b8bb26;
    --bpe-active-bg: rgba(254, 128, 25, 0.25);
    --bpe-active-border: #fe8019;
    --bpe-active-text: #fe8019;
    --bpe-active-glow: rgba(254, 128, 25, 0.4);
    --bpe-eow-bg: rgba(168, 153, 132, 0.15);
    --bpe-eow-border: #928374;
    --bpe-eow-text: #928374;
    --bpe-bar-fill: #83a598;
    --bpe-bar-highlight: #fe8019;
    --bpe-bar-bg: rgba(168, 153, 132, 0.2);
    --bpe-arrow-color: #fe8019;
    --bpe-arrow-glow: rgba(254, 128, 25, 0.3);
    --bpe-vocab-pill-bg: rgba(184, 187, 38, 0.15);
    --bpe-vocab-pill-border: #b8bb26;
    --bpe-vocab-pill-text: #b8bb26;
    --bpe-vocab-new-bg: rgba(254, 128, 25, 0.2);
    --bpe-vocab-new-border: #fe8019;
    --bpe-vocab-new-text: #fe8019;
    --bpe-rule-text: #a89984;
    --bpe-rule-highlight: #fe8019;
    --bpe-section-title: #a89984;
    --bpe-label-color: #a89984;
    --bpe-canvas-text: #ebdbb2;
}

/* ============================================
   Canvas
   ============================================ */
#bpe-canvas {
    display: block;
    width: 100%;
    cursor: default;
    background: var(--viz-canvas-bg);
}

/* ============================================
   Controls Panel
   ============================================ */
.bpe-controls-panel {
    display: flex;
    gap: 20px;
}

.bpe-options-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bpe-actions-col {
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.bpe-actions-col .btn-toolbar {
    display: flex;
    gap: 6px;
    flex-direction: column;
}

.bpe-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bpe-input-row label {
    white-space: nowrap;
    margin: 0;
    font-weight: 600;
    font-size: 12px;
    min-width: 85px;
}

.bpe-input-row .form-control {
    flex: 1;
}

.bpe-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bpe-stepper .btn {
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.4;
}

.bpe-stepper .stepper-value {
    min-width: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

#custom-corpus-row {
    display: none;
}

#custom-corpus-row.visible {
    display: flex;
}

/* ============================================
   Speed Control
   ============================================ */
.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--viz-text-muted);
}

/* ============================================
   Legend Overrides
   ============================================ */
.legend-color.bpe-char-token {
    background-color: var(--bpe-char-bg);
    border: 2px solid var(--bpe-char-border);
}

.legend-color.bpe-merged-token {
    background-color: var(--bpe-merged-bg);
    border: 2px solid var(--bpe-merged-border);
}

.legend-color.bpe-active-token {
    background-color: var(--bpe-active-bg);
    border: 2px solid var(--bpe-active-border);
}

.legend-color.bpe-eow-token {
    background-color: var(--bpe-eow-bg);
    border: 2px solid var(--bpe-eow-border);
}

.legend-dot.bpe-freq-bar {
    background-color: var(--bpe-bar-fill);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .bpe-controls-panel {
        flex-direction: column;
    }

    .bpe-actions-col {
        width: 100%;
    }

    .bpe-actions-col .btn-toolbar {
        flex-direction: row;
        justify-content: center;
    }
}
