/* Analysis Workspace — mirrors desktop PostProcessApp layout */

/* ===================================================================
   1. WORKSPACE GRID LAYOUT
   =================================================================== */

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-right-width);
  grid-template-rows: 1fr var(--status-bar-height);
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Explicit grid placement for each column */
.workspace > .sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
}

.workspace > .canvas-column {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace > .sidebar-right {
  grid-column: 3;
  grid-row: 1 / -1;
}

/* ===================================================================
   2. SIDEBAR / CONTROL PANEL
   =================================================================== */

.sidebar {
  background: var(--color-surface);
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
  padding-bottom: var(--space-8);
  transition: transform var(--transition-normal);
  z-index: 200;
}

.sidebar-section {
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.sidebar-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.sidebar-card {
  background: var(--color-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: 0 var(--space-4) var(--space-2);
}

.sidebar-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.sidebar-row-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===================================================================
   2b. RIGHT SIDEBAR
   =================================================================== */

.sidebar-right {
  background: var(--color-surface);
  overflow-y: auto;
  border-left: 1px solid rgba(255,255,255,0.06);
  padding-bottom: var(--space-8);
  transition: transform var(--transition-normal);
  z-index: 200;
}

/* --- Sidebar toggle (hamburger, hidden on desktop) --- */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: calc(var(--header-height) + var(--space-3));
  left: var(--space-3);
  z-index: 250;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--color-surface-hover);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

/* --- Right sidebar toggle (hidden on wide desktop) --- */

.sidebar-toggle-right {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: background var(--transition-fast);
}

.sidebar-toggle-right:hover {
  background: var(--color-surface-hover);
}

.sidebar-toggle-right svg {
  width: 18px;
  height: 18px;
}

/* --- Sidebar backdrop (mobile click-to-close) --- */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===================================================================
   3. COLLAPSIBLE SIDEBAR SECTIONS (details/summary)
   =================================================================== */

.sidebar details {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sidebar details:last-of-type {
  border-bottom: none;
}

.sidebar details > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.sidebar details > summary::-webkit-details-marker {
  display: none;
}

/* Chevron indicator */
.sidebar details > summary::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(-45deg);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.sidebar details[open] > summary::before {
  transform: rotate(45deg);
}

.sidebar details > summary:hover {
  color: var(--color-text);
  background: rgba(255,255,255,0.03);
}

.sidebar details > .sidebar-card {
  animation: sidebar-expand 0.2s ease;
}

@keyframes sidebar-expand {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================================================
   4. SIDEBAR GROUPS
   =================================================================== */

.sidebar-group {
  padding: var(--space-2) 0;
  margin: var(--space-1) 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.sidebar-group:first-child {
  border-top: none;
  padding-top: 0;
}

.sidebar-group-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0 var(--space-2);
  margin-bottom: var(--space-2);
}

/* ===================================================================
   5. ANALYSIS BUTTON CLASSES
   =================================================================== */

/* 2-column button grid for sidebar sections */
.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Odd last child spans full width */
.btn-grid-2 > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* 3-column layout for compact button grids */
.btn-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.btn-grid-3 > :last-child:nth-child(3n+1) {
  grid-column: 1 / -1;
}
.btn-grid-3 > :last-child:nth-child(3n+2) {
  grid-column: span 2;
}

.btn-analysis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 6px 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  color: white;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  min-height: 32px;
}

.btn-analysis:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-analysis:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-analysis:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn-analysis svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Primary (blue/accent) */
.btn-analysis-primary {
  background: var(--color-accent);
}

.btn-analysis-primary:hover {
  background: var(--color-accent-hover);
}

/* Visualization (teal) */
.btn-analysis-viz {
  background: var(--color-line-teal);
}

.btn-analysis-viz:hover {
  background: #16a085;
}

/* Export (purple) */
.btn-analysis-export {
  background: var(--color-line-purple);
}

.btn-analysis-export:hover {
  background: #8e44ad;
}

/* Report (orange) */
.btn-analysis-report {
  background: var(--color-line-orange);
}

.btn-analysis-report:hover {
  background: #e67e22;
}

/* Undo/Redo (slate) — legacy, kept for compat */
.btn-analysis-undo {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--color-text-muted);
}

.btn-analysis-undo:hover {
  background: rgba(255,255,255,0.14);
  color: var(--color-text);
}

/* ===================================================================
   6. BREADCRUMB BAR
   =================================================================== */

.ws-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  min-height: 36px;
  flex-shrink: 0;
}

/* Push actions to the right of the breadcrumb bar */
.breadcrumb-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Compact icon-only toolbar buttons (undo/redo) */
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbar-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-text);
}

.toolbar-btn:active {
  background: rgba(255,255,255,0.15);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.ws-breadcrumb-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.ws-breadcrumb-back:hover {
  background: rgba(255,255,255,0.08);
  color: var(--color-text);
}

.ws-breadcrumb-back svg {
  width: 16px;
  height: 16px;
}

.ws-breadcrumb-sep {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.ws-breadcrumb-project {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* ===================================================================
   7. CANVAS AREA
   =================================================================== */

.canvas-area {
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  overflow: hidden;
}

.canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.canvas-container canvas {
  display: block;
  cursor: crosshair;
}

/* ===================================================================
   8. TIMELINE
   =================================================================== */

.video-playback-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 6px var(--space-4);
  background: var(--color-surface);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.playback-center-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.playback-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.playback-icon-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  color: var(--color-text);
}

.playback-icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.playback-play-btn {
  width: 44px;
  height: 44px;
  background: var(--color-accent);
  color: #fff;
}

.playback-play-btn:hover:not(:disabled) {
  background: var(--color-accent-hover, var(--color-accent));
  filter: brightness(1.15);
  color: #fff;
}

.timeline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.timeline-time {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-dim);
  flex-shrink: 0;
}

.timeline-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  background: var(--color-tertiary);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(59,130,246,0.4);
}

.timeline-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(59,130,246,0.4);
}

.timeline-slider::-moz-range-track {
  height: 6px;
  background: var(--color-tertiary);
  border-radius: 3px;
}

.timeline-frame {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-dim);
  flex-shrink: 0;
  text-align: right;
}

/* Quality selector (inside timeline bar) */
.quality-selector {
  display: flex;
  gap: 2px;
  margin-left: var(--space-2);
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.quality-btn {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.quality-btn:hover {
  color: var(--color-text);
  background: rgba(255,255,255,0.08);
}
.quality-btn.active {
  color: white;
  background: var(--color-accent);
}

/* Timeline event markers */
.timeline-markers {
  position: relative;
  flex: 1;
}
.timeline-markers .timeline-slider {
  position: relative;
  z-index: 2;
}
.timeline-marker-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.timeline-marker {
  position: absolute;
  width: 3px;
  height: 10px;
  top: -3px;
  border-radius: 1px;
  opacity: 0.7;
}
.timeline-marker.crossing { background: #3498db; }
.timeline-marker.stationary { background: #e67e22; }

/* ===================================================================
   9. STATUS BAR
   =================================================================== */

.status-bar {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0 var(--space-4);
}

.status-item {
  flex: 1;
  text-align: center;
  padding: var(--space-2) 0;
}

.status-item-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}

.status-item-icon svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

.status-item-value {
  font-size: var(--text-lg);
  font-weight: 700;
}

.status-item-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Primary status items — larger and more prominent */
.status-item-primary .status-item-value {
  font-size: var(--text-xl);
  font-weight: 800;
}

.status-item-primary .status-item-label {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  font-weight: 500;
}

.status-item-primary {
  flex: 1.3;
}

/* Status bar colors */
.status-frame .status-item-value { color: var(--color-line-blue); }
.status-tracks .status-item-value { color: var(--color-line-purple); }
.status-active .status-item-value { color: var(--color-success); }
.status-lines .status-item-value { color: var(--color-warning); }
.status-zones .status-item-value { color: var(--color-danger); }
.status-crossings .status-item-value { color: var(--color-line-teal); }
.status-time .status-item-value { color: var(--color-line-orange); }

/* ===================================================================
   10. PLAYBACK CONTROLS
   =================================================================== */

.playback-controls {
  display: flex;
  gap: var(--space-2);
}

.playback-controls .btn {
  flex: 1;
}

.speed-selector {
  display: flex;
  gap: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  padding: 2px;
}

.speed-btn {
  padding: 4px 8px;
  font-size: var(--text-xs);
  background: transparent;
  color: var(--color-text-dim);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.speed-btn.active {
  background: var(--color-accent);
  color: white;
}

/* ===================================================================
   11. DISPLAY OPTIONS
   =================================================================== */

.display-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

/* ===================================================================
   12. RESULTS BOX / COUNTING LINES
   =================================================================== */

.results-box {
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-dim);
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ===================================================================
   12b. LINE / ZONE EDIT LIST
   =================================================================== */

.lines-zones-list {
  margin-top: var(--space-2);
  max-height: 220px;
  overflow-y: auto;
}

.line-zone-item {
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.line-zone-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.lz-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lz-name:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.lz-count {
  font-size: var(--text-lg);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-accent);
  min-width: 32px;
  text-align: right;
}

.lz-details {
  display: flex;
  gap: var(--space-3);
  margin-top: 2px;
}

.lz-dir-label {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  font-family: var(--font-mono);
}

.lz-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.lz-dir-select {
  font-size: 11px;
  padding: 2px 4px;
  background: var(--color-primary);
  color: var(--color-text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 1;
}

.lz-dir-select:focus {
  border-color: var(--color-accent);
  outline: none;
}

.lz-controls .btn {
  padding: 2px 6px;
  min-width: 0;
}

/* ===================================================================
   13. INSPECTOR PANEL
   =================================================================== */

.inspector-content {
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  line-height: 1.8;
}

.inspector-content strong {
  color: var(--color-text);
  margin-right: var(--space-2);
}

/* ===================================================================
   14. SLIDER WITH LABEL
   =================================================================== */

.slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--color-tertiary);
  border-radius: 2px;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
}

.slider-label {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  min-width: 35px;
  text-align: right;
  font-family: var(--font-mono);
}

/* ===================================================================
   15. VIDEO LOADING OVERLAY
   =================================================================== */

.video-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  gap: var(--space-3);
  background: rgba(10,10,10,0.6);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.video-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.video-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: vl-spin 0.8s linear infinite;
}

@keyframes vl-spin {
  to { transform: rotate(360deg); }
}

.video-loading-label {
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  background: rgba(0,0,0,0.5);
  padding: 4px 14px;
  border-radius: var(--radius-md);
}

/* ===================================================================
   16. WELCOME SCREEN
   =================================================================== */

.welcome-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-dim);
  gap: var(--space-4);
}

.welcome-overlay h2 {
  color: var(--color-accent);
  font-size: var(--text-2xl);
}

.welcome-overlay p {
  font-size: var(--text-sm);
  max-width: 400px;
  line-height: 1.8;
}

/* ===================================================================
   17. MODAL SIZE IMPROVEMENTS
   =================================================================== */

/* Wide modal for data-heavy views (OD matrix, statistics, charts) */
.modal-wide {
  max-width: 900px;
  width: 95%;
}

/* Table styling within modals */
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--space-4) 0;
}

.modal-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-table th {
  background: var(--color-primary);
  color: var(--color-text-dim);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}

.modal-table td {
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.modal-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.modal-table td:first-child {
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-weight: 500;
}

/* ===================================================================
   18. KEYBOARD SHORTCUT HINT BAR
   =================================================================== */

.shortcut-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-1) var(--space-4);
  background: var(--color-primary);
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 10px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-dim);
  background: var(--color-tertiary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  text-transform: uppercase;
}

.shortcut-desc {
  color: var(--color-text-muted);
}

/* ===================================================================
   19. GOOGLE DRIVE BUTTON
   =================================================================== */

.btn-gdrive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  color: white;
  background: #1a73e8;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-gdrive:hover {
  background: #1557b0;
}

.btn-gdrive:active {
  background: #12489c;
}

.btn-gdrive:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-gdrive svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===================================================================
   20. PROGRESS BAR COMPONENT
   =================================================================== */

.progress-bar-container {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  height: 6px;
  margin-top: var(--space-1);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar-fill-success {
  background: var(--color-success);
}

.progress-bar-fill-warning {
  background: var(--color-warning);
}

.progress-bar-label {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  margin-bottom: 2px;
}

/* Indeterminate progress animation */
.progress-bar-fill-indeterminate {
  width: 30%;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ===================================================================
   21. NOTIFICATION BELL / BADGE
   =================================================================== */

.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notif-bell:hover {
  background: rgba(255,255,255,0.06);
  color: var(--color-text);
}

.notif-bell svg {
  width: 20px;
  height: 20px;
}

.notif-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-body);
  color: white;
  background: var(--color-danger);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  transform: translate(25%, -25%);
  box-shadow: 0 0 0 2px var(--color-surface);
}

.notif-bell-badge:empty {
  display: none;
}

/* ===================================================================
   22. RESPONSIVE DESIGN
   =================================================================== */

/* Large desktop — both sidebars shrink slightly */
@media (max-width: 1400px) {
  .workspace {
    grid-template-columns: 280px 1fr 280px;
  }
}

/* Tablet — right sidebar collapses to overlay */
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 280px 1fr;
  }

  .sidebar-toggle-right {
    display: flex;
  }

  .sidebar-right {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 85vw;
    transform: translateX(100%);
    box-shadow: none;
    z-index: 200;
  }

  .sidebar-right.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-backdrop {
    display: block;
  }
}

/* Mobile / narrow breakpoint — both sidebars become slide-out panels */
@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  /* Show hamburger toggles */
  .sidebar-toggle {
    display: flex;
  }

  .sidebar-toggle-right {
    display: flex;
  }

  /* Left sidebar as overlay panel */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 340px;
    max-width: 85vw;
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Right sidebar as overlay panel */
  .sidebar-right {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 85vw;
    transform: translateX(100%);
    box-shadow: none;
    z-index: 200;
  }

  .sidebar-right.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Show backdrop when either sidebar is open */
  .sidebar-backdrop {
    display: block;
  }

  /* Breadcrumb left padding to avoid hamburger overlap */
  .ws-breadcrumb {
    padding-left: calc(var(--space-3) + 48px);
  }

  /* Shortcut bar: scroll on small screens */
  .shortcut-bar {
    justify-content: flex-start;
    padding: var(--space-1) var(--space-3);
    gap: var(--space-3);
  }

  /* Status bar: allow wrapping */
  .status-bar {
    flex-wrap: wrap;
    padding: var(--space-1) var(--space-2);
  }

  .status-item {
    min-width: 60px;
    padding: var(--space-1) 0;
  }

  .status-item-value {
    font-size: var(--text-sm);
  }

  .status-item-primary .status-item-value {
    font-size: var(--text-lg);
  }
}

/* Tablet (768px) — narrower sidebars, toolbar/playback wrapping */
@media (max-width: 768px) {
  /* Narrow the overlay sidebars for tablets */
  .sidebar {
    width: 300px;
  }

  .sidebar-right {
    width: 300px;
  }

  /* Playback bar wraps on small screens */
  .video-playback-bar {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .timeline {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  /* Quality selector stacks below timeline on narrow screens */
  .quality-selector {
    margin-left: 0;
  }
}

/* Small phone — single column, smaller fonts */
@media (max-width: 480px) {
  /* Single-column button grids */
  .btn-grid-2 {
    grid-template-columns: 1fr;
  }

  .btn-grid-3 {
    grid-template-columns: 1fr;
  }

  .btn-grid-2 > :last-child:nth-child(odd),
  .btn-grid-3 > :last-child:nth-child(3n+1),
  .btn-grid-3 > :last-child:nth-child(3n+2) {
    grid-column: auto;
  }

  /* Display grid to single column */
  .display-grid {
    grid-template-columns: 1fr;
  }

  /* Smaller font sizes */
  .sidebar-section-title {
    font-size: 10px;
  }

  .sidebar-card {
    padding: var(--space-2) var(--space-3);
    margin: 0 var(--space-2) var(--space-2);
  }

  .btn-analysis {
    font-size: 11px;
    padding: 5px 8px;
    min-height: 28px;
  }

  /* Playback controls compact */
  .playback-icon-btn {
    width: 30px;
    height: 30px;
  }

  .playback-play-btn {
    width: 36px;
    height: 36px;
  }

  /* Timeline time labels smaller */
  .timeline-time,
  .timeline-frame {
    font-size: 10px;
  }

  /* Status bar compact */
  .status-item-value {
    font-size: var(--text-xs);
  }

  .status-item-primary .status-item-value {
    font-size: var(--text-sm);
  }

  .status-item-label {
    font-size: 9px;
  }

  /* Breadcrumb project name truncates earlier */
  .ws-breadcrumb-project {
    max-width: 140px;
  }

  /* Shortcut bar hidden on very small screens */
  .shortcut-bar {
    display: none;
  }
}

/* Extra small screens */
@media (max-width: 640px) {
  .sidebar {
    width: 100vw;
    max-width: 100vw;
  }

  .sidebar-right {
    width: 100vw;
    max-width: 100vw;
  }

  .modal-wide {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: var(--space-2);
  }

  .modal-table {
    font-size: var(--text-xs);
  }

  .modal-table th,
  .modal-table td {
    padding: var(--space-1) var(--space-2);
  }
}

/* ===================================================================
   EXPORT PROGRESS BAR (top bar)
   =================================================================== */

.export-progress-bar {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 6px 12px;
}

.export-progress-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

.export-progress-track {
  flex: 1;
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  max-width: 200px;
}

.export-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

/* File Selector Overlay */
.file-selector-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--color-primary, #021342);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-selector-content {
  max-width: 560px;
  width: 100%;
  padding: 32px;
}

.file-selector-title {
  font-size: var(--text-xl);
  color: var(--color-text);
  margin: 0 0 4px;
}

.file-selector-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 20px;
}

.file-selector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-selector-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.file-selector-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.file-selector-card-icon {
  flex-shrink: 0;
}

.file-selector-card-info {
  flex: 1;
  min-width: 0;
}

.file-selector-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-selector-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.file-selector-card-badge {
  font-size: 10px;
  color: var(--color-accent);
  background: rgba(0, 209, 178, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.file-selector-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.file-selector-delete-btn:hover {
  color: var(--color-error);
  background: rgba(255, 107, 107, 0.1);
}
