/* Panda Project Page - Event Visualization Styles */

.event-display {
    background: var(--bg-white);
}

.event-viewer-container {
    background: var(--bg-section);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-light);
}

.event-controls-top {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.controls-left {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.control-group select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}

.control-group select:focus {
    outline: none;
    border-color: var(--lavender);
}

.control-group input[type="range"] {
    width: 100px;
    accent-color: var(--lavender-darker);
}

/* Two panel layout */
.panels-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    background: var(--lavender-light);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'EB Garamond', 'Noto Serif', Georgia, serif;
}

.panel-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.toggle-buttons {
    display: flex;
    gap: 2px;
    background: var(--bg-white);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.toggle-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    color: var(--text-primary);
    background: var(--lavender-light);
}

.toggle-btn.active {
    background: var(--lavender);
    color: var(--text-primary);
}

.truth-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 0.75rem;
}

.truth-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.truth-toggle-switch.active {
    background: var(--lavender-darker);
}

.truth-toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.truth-toggle-switch.active::after {
    left: 18px;
}

.truth-toggle-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    transition: opacity 0.2s;
}

.event-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
}

.event-canvas {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16162a 100%);
    cursor: grab;
}

.event-canvas:active {
    cursor: grabbing;
}

.event-canvas.panning {
    cursor: move;
}

/* Hover tooltip */
.hover-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(26, 26, 46, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.15s;
    max-width: 200px;
    border: 1px solid var(--lavender-dark);
}

.hover-tooltip.visible {
    opacity: 1;
}

.hover-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.hover-tooltip .tooltip-label {
    color: var(--lavender-light);
}

.hover-tooltip .tooltip-value {
    font-weight: 600;
}

.hover-tooltip .confidence-bar-mini {
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.hover-tooltip .confidence-fill-mini {
    height: 100%;
    background: var(--lavender);
    border-radius: 2px;
}

.panel-legend {
    padding: 12px 16px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    min-height: 60px;
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-color.circle {
    border-radius: 50%;
}

.energy-gradient {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.energy-gradient-bar {
    flex: 1;
    height: 12px;
    border-radius: 6px;
}

.energy-gradient span {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Controls hint */
.controls-hint {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--lavender-light);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.controls-hint-left {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.controls-hint span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.controls-hint kbd {
    background: var(--bg-white);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    border: 1px solid var(--border-light);
}

/* Responsive */
@media (max-width: 1000px) {
    .panels-container {
        grid-template-columns: 1fr;
    }
    
    .event-canvas-wrapper {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .event-controls-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .event-canvas-wrapper {
        height: 350px;
    }
    
    .panel-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .panel-controls {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .toggle-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .truth-toggle {
        flex-shrink: 0;
    }
}

