/* ==================== Lab Editor Styles ==================== */
/* MAD SCIENTIST LABORATORY - Sleek, Elegant, Powerful */
/* Aesthetic: Sci-fi research facility meets music production */

:root {
  --lab-primary: #00ffaa;      /* Toxic green glow */
  --lab-secondary: #a855f7;    /* Purple accent */
  --lab-accent: #00d4ff;       /* Cyan highlight */
  --lab-danger: #ff3366;       /* Warning red */
  --lab-bg-dark: #0a0a12;
  --lab-bg-panel: #12121a;
  --lab-border: rgba(0, 255, 170, 0.2);
  --lab-glow: 0 0 20px rgba(0, 255, 170, 0.3);
}

/* ==================== Editor Container ==================== */
.lab-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  height: calc(100vh - 180px);
  overflow-y: auto;
  position: relative;
}

/* Grid background - REMOVED (Jobs audit: decorative) */

/* ==================== Header - Control Panel ==================== */
.lab-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--lab-bg-panel) 0%, rgba(0, 255, 170, 0.05) 100%);
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

/* Scanning line effect - REMOVED (Jobs audit: decorative) */

.lab-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lab-file-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px var(--lab-primary));
}

.lab-file-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--lab-primary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

.lab-detected-info {
  display: flex;
  gap: 24px;
}

.detected-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--lab-border);
  border-radius: 8px;
  position: relative;
}

.detected-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 2px;
  background: var(--lab-primary);
  border-radius: 0 0 2px 2px;
}

.detected-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.detected-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: bold;
  color: var(--lab-primary);
  text-shadow: 0 0 15px rgba(0, 255, 170, 0.6);
}

/* ==================== Waveform Container - Analysis Chamber ==================== */
.lab-waveform-container {
  background: linear-gradient(180deg, var(--lab-bg-panel) 0%, var(--lab-bg-dark) 100%);
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    var(--lab-glow);
}

/* Corner accents - REMOVED (Jobs audit: decorative) */

.lab-waveform {
  height: 140px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 170, 0.1);
}

.lab-timeline {
  height: 24px;
  margin-top: 12px;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.waveform-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  color: var(--lab-primary);
  font-size: 14px;
  font-family: var(--font-mono);
  opacity: 0.7;
  /* Pulse animation removed (Jobs audit: simplify) */
}

.waveform-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  color: var(--lab-danger);
  font-size: 14px;
}

/* ==================== Transport Controls - Command Center ==================== */
.lab-transport {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--lab-bg-panel);
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  position: relative;
}

/* Status indicator - simplified (Jobs audit: removed blink animation) */
.lab-transport::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--lab-primary);
  border-radius: 50%;
}

.transport-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--lab-border);
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.1) 0%, transparent 100%);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 20px;
}

.transport-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.3) 0%, rgba(0, 255, 170, 0.1) 100%);
  border-color: var(--lab-primary);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.4);
  transform: scale(1.1);
}

.transport-btn:active {
  transform: scale(0.95);
}

#lab-play-btn {
  width: 56px;
  height: 56px;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.2) 0%, rgba(0, 212, 255, 0.2) 100%);
  border-color: var(--lab-primary);
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

#lab-play-btn:hover {
  box-shadow: 0 0 30px rgba(0, 255, 170, 0.6);
}

.play-icon {
  margin-left: 3px;
  filter: drop-shadow(0 0 5px var(--lab-primary));
}

.transport-time {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--lab-accent);
  margin-left: auto;
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.time-separator {
  color: var(--text-muted);
}

.transport-zoom {
  display: flex;
  gap: 6px;
  margin-left: 16px;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--lab-border);
  background: rgba(0, 255, 170, 0.05);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zoom-btn:hover {
  background: rgba(0, 255, 170, 0.15);
  border-color: var(--lab-primary);
}

/* ==================== Tools Bar - Instrument Panel ==================== */
.lab-tools {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--lab-bg-panel);
  border: 1px solid var(--lab-border);
  border-radius: 12px;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 170, 0.1);
}

.tool-label {
  font-size: 10px;
  color: var(--lab-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-right: 8px;
  opacity: 0.8;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--lab-border);
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.05) 0%, transparent 100%);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.15) 0%, rgba(0, 255, 170, 0.05) 100%);
  border-color: var(--lab-primary);
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.2);
  transform: translateY(-2px);
}

.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.tool-btn.primary {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
  border-color: var(--lab-primary);
  color: var(--lab-primary);
  font-weight: 600;
}

.tool-btn.primary:hover {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.4) 0%, rgba(0, 212, 255, 0.2) 100%);
  box-shadow: 0 0 25px rgba(0, 255, 170, 0.4);
}

.tool-btn span:first-child {
  font-size: 16px;
}

/* ==================== Regions Panel - Sample Chamber ==================== */
.lab-regions-panel {
  flex: 1;
  min-height: 180px;
  background: var(--lab-bg-panel);
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.regions-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--lab-border);
  display: flex;
  align-items: center;
  background: rgba(0, 255, 170, 0.03);
}

.regions-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.region-count {
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 12px;
  font-size: 12px;
}

.regions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.regions-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
  gap: 8px;
}

.regions-empty::before {
  content: '✂️';
  font-size: 32px;
  opacity: 0.5;
}

/* ==================== Region Item - Sample Specimen ==================== */
.region-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.03) 0%, transparent 100%);
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.region-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lab-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.region-item:hover {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.08) 0%, rgba(0, 255, 170, 0.02) 100%);
  border-color: rgba(0, 255, 170, 0.4);
  transform: translateX(4px);
}

.region-item:hover::before {
  opacity: 1;
}

.region-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.region-name {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.region-name:focus {
  background: rgba(0, 255, 170, 0.1);
  outline: 1px solid var(--lab-primary);
  color: var(--lab-primary);
}

.region-time {
  font-size: 11px;
  color: var(--lab-accent);
  font-family: var(--font-mono);
  padding: 4px 8px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

.region-play,
.region-delete {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--lab-border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.region-play:hover {
  background: rgba(0, 255, 170, 0.2);
  border-color: var(--lab-primary);
  color: var(--lab-primary);
}

.region-delete:hover {
  background: rgba(255, 51, 102, 0.2);
  border-color: var(--lab-danger);
  color: var(--lab-danger);
}

/* ==================== Export Modal - Output Terminal ==================== */
.export-slices-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-slices-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.export-slices-modal .modal-content {
  position: relative;
  background: linear-gradient(180deg, var(--lab-bg-panel) 0%, var(--lab-bg-dark) 100%);
  border: 1px solid var(--lab-primary);
  border-radius: 20px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 
    0 0 60px rgba(0, 255, 170, 0.2),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.export-slices-modal h2 {
  margin: 0 0 24px 0;
  font-size: 20px;
  color: var(--lab-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(0, 255, 170, 0.5);
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--lab-border);
  background: rgba(0, 255, 170, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.export-option:hover {
  background: rgba(0, 255, 170, 0.1);
  border-color: var(--lab-primary);
  transform: translateX(8px);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.2);
}

.option-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px var(--lab-primary));
}

.option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--lab-primary);
}

.option-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.export-slices-modal .modal-close {
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid var(--lab-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.export-slices-modal .modal-close:hover {
  color: var(--lab-primary);
  border-color: var(--lab-primary);
}

/* ==================== Effects Panel Integration ==================== */
.lab-effects-toggle {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 16px 8px;
  background: var(--lab-bg-panel);
  border: 1px solid var(--lab-primary);
  border-right: none;
  border-radius: 12px 0 0 12px;
  color: var(--lab-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}

.lab-effects-toggle:hover {
  background: rgba(0, 255, 170, 0.1);
  padding-left: 12px;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .lab-editor-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .lab-tools {
    flex-direction: column;
  }
  
  .tool-group {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .lab-detected-info {
    gap: 12px;
  }
  
  .detected-item {
    padding: 6px 12px;
  }
  
  .transport-time {
    margin-left: 8px;
  }
  
  .transport-btn {
    margin-left: 12px;
  }
  
  .lab-transport::before {
    display: none;
  }
}

/* ==================== Scrollbar Styling ==================== */
.lab-editor::-webkit-scrollbar,
.regions-list::-webkit-scrollbar {
  width: 6px;
}

.lab-editor::-webkit-scrollbar-track,
.regions-list::-webkit-scrollbar-track {
  background: var(--lab-bg-dark);
}

.lab-editor::-webkit-scrollbar-thumb,
.regions-list::-webkit-scrollbar-thumb {
  background: var(--lab-primary);
  border-radius: 3px;
  opacity: 0.5;
}

.lab-editor::-webkit-scrollbar-thumb:hover,
.regions-list::-webkit-scrollbar-thumb:hover {
  background: var(--lab-accent);
}
