/**
 * Cross-Movie Barcode Visualization Styles
 */

/* ═══════════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════════ */

#barcode-section {
    margin-bottom: 2rem;
}

#barcode-section > .bg-body-tertiary {
    background: linear-gradient(
        180deg,
        var(--bs-tertiary-bg) 0%,
        var(--bs-body-bg) 100%
    ) !important;
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

#barcode-container {
    width: 100%;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 0;
}

.barcode-svg {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   MOVIE LABELS
   ═══════════════════════════════════════════════════════════════════ */

.barcode-label {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 500;
    fill: var(--bs-body-color);
    opacity: 0.85;
}

.barcode-count {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 500;
    fill: var(--bs-secondary-color);
    opacity: 0.7;
}

.movie-bar.focus-movie .barcode-label {
    font-weight: 700;
    opacity: 1;
}

.movie-bar.focus-movie .barcode-count {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   SCENE BARS
   ═══════════════════════════════════════════════════════════════════ */

.barcode-scene {
    cursor: pointer;
    transition: fill 0.15s ease;
}

.barcode-scene:hover {
    filter: brightness(1.2);
}

.barcode-scene.source {
    stroke: #fff;
    stroke-width: 2px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

.barcode-scene.locked {
    stroke: #ffd700;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.barcode-scene.comparison-locked {
    stroke: #c74554;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 8px rgba(199, 69, 84, 0.9)) drop-shadow(0 0 4px rgba(199, 69, 84, 0.6));
}

/* ═══════════════════════════════════════════════════════════════════
   INFO PANEL (in header)
   ═══════════════════════════════════════════════════════════════════ */

#barcode-info-panel {
    transition: opacity 0.15s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   CONTROLS
   ═══════════════════════════════════════════════════════════════════ */

#barcode-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#barcode-controls label {
    font-size: 13px;
    font-weight: 500;
    color: var(--bs-secondary-color);
}

#barcode-movie-select {
    min-width: 200px;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

#barcode-movie-select:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   LEGEND
   ═══════════════════════════════════════════════════════════════════ */

.barcode-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 11px;
    color: var(--bs-secondary-color);
    flex-wrap: wrap;
}

.barcode-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.barcode-legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.barcode-legend-swatch.strong {
    background: #48d78e;
}

.barcode-legend-swatch.moderate {
    background: #6b7db8;
}

.barcode-legend-swatch.source {
    background: #c74554;
    box-shadow: 0 0 6px rgba(199, 69, 84, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════════ */

#barcode-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--bs-secondary-color);
    gap: 12px;
}

#barcode-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   EXPLANATION TAGS
   ═══════════════════════════════════════════════════════════════════ */

.barcode-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.barcode-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bs-primary);
    color: #fff;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.barcode-tag:hover {
    opacity: 1;
}

/* Light mode adjustments */
[data-bs-theme="light"] .barcode-tag {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .barcode-tag {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    .barcode-tooltip {
        max-width: 260px;
        padding: 10px 14px;
        font-size: 12px;
    }

    #barcode-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    #barcode-movie-select {
        width: 100%;
    }

    .barcode-legend {
        gap: 16px;
    }
}
