/**
 * Caster - Dubbing Selection App
 * Modern dark theme with cinema vibes
 */

/* ============ CSS VARIABLES ============ */
:root {
  /* Colors - Deep cinema theme */
  --bg-primary: #0d0d12;
  --bg-secondary: #15151d;
  --bg-tertiary: #1c1c28;
  --bg-elevated: #242432;
  --bg-hover: #2a2a3c;
  
  /* Accent - Warm gold/amber */
  --accent: #e6a548;
  --accent-hover: #f0b860;
  --accent-soft: rgba(230, 165, 72, 0.15);
  --accent-glow: rgba(230, 165, 72, 0.3);
  
  /* Secondary accent - Teal */
  --accent2: #4ecdc4;
  --accent2-soft: rgba(78, 205, 196, 0.15);
  
  /* Text */
  --text-primary: #f5f5f7;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  
  /* Status */
  --success: #4ecdc4;
  --warning: #f0b860;
  --error: #e6486e;
  
  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Typography */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-soft) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 100%, var(--accent2-soft) 0%, transparent 40%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 100px,
      rgba(255,255,255,0.01) 100px,
      rgba(255,255,255,0.01) 101px
    );
  pointer-events: none;
  z-index: -1;
}

/* ============ APP LAYOUT ============ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ HEADER ============ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left, .header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-icon {
  font-size: 1.75rem;
}

.movie-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.select-movie {
  padding: var(--space-sm) var(--space-md);
  padding-right: var(--space-xl);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  min-width: 200px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0b0' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, background 0.2s;
}

.select-movie:hover {
  border-color: var(--border-light);
  background-color: var(--bg-hover);
}

.select-movie:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-light);
}

.btn-danger {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #ff5a7d;
  border-color: #ff5a7d;
}

.btn-large {
  padding: var(--space-md) var(--space-lg);
  font-size: 1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-delete:hover:not(:disabled) {
  background: rgba(230, 72, 110, 0.15);
  border-color: var(--error);
  color: var(--error);
}

.btn-new:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ============ MAIN CONTENT ============ */
.main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ============ WELCOME STATE ============ */
.welcome-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.welcome-content {
  text-align: center;
  max-width: 400px;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 1.1rem;
}

/* ============ EDITOR STATE ============ */
.editor-state {
  flex: 1;
  display: flex;
  gap: 0;
  min-height: 0;
}

/* ============ PANELS ============ */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
}

.panel:last-child {
  border-right: none;
  border-left: 1px solid var(--border);
}

.panel-left {
  width: 280px;
  flex-shrink: 0;
}

.panel-right {
  width: 300px;
  flex-shrink: 0;
}

.panel-center {
  flex: 1;
  background: var(--bg-primary);
  border: none;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.panel-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.panel-toggle {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  user-select: none;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.panel-content.collapsed {
  display: none;
}

/* ============ UPLOAD SECTIONS ============ */
.upload-section {
  margin-bottom: var(--space-lg);
}

.upload-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-tertiary);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.upload-zone svg {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Uploaded file display */
.uploaded-file {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.uploaded-file .file-icon {
  font-size: 1.25rem;
}

.uploaded-file .file-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: rgba(230, 72, 110, 0.15);
  color: var(--error);
}

/* Audio list */
.audio-list {
  list-style: none;
  margin-top: var(--space-sm);
}

.audio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
  font-size: 0.85rem;
}

.audio-name {
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-remove-audio {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
  opacity: 0.6;
  transition: all 0.2s;
}

.audio-item:hover .btn-remove-audio {
  opacity: 1;
}

.btn-remove-audio:hover {
  background: rgba(230, 72, 110, 0.15);
  color: var(--error);
}

/* ============ VIDEO PLAYER ============ */
.player-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #000;
}

.no-video-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: var(--space-md);
}

.no-video-state svg {
  width: 80px;
  height: 80px;
  opacity: 0.3;
}

.no-video-state p {
  font-size: 1rem;
}

#videoPlayer {
  flex: 1;
  width: 100%;
  max-height: calc(100vh - 280px);
  object-fit: contain;
  background: #000;
}

/* Current Cast Display */
.current-cast {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  background: linear-gradient(to bottom, #000 0%, var(--bg-primary) 100%);
  min-height: 60px;
}

.current-cast:empty {
  display: none;
}

.cast-line {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.cast-line .voice-name {
  color: var(--accent);
  font-weight: 600;
}

.cast-line .char-name {
  color: var(--text-primary);
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 13, 18, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  z-index: 50;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: var(--accent);
  width: 30%;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Player controls */
.player-controls {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: var(--space-md) var(--space-lg);
}

.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  margin-bottom: var(--space-md);
}

.progress-played {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-bar:hover .progress-handle,
.progress-bar:active .progress-handle {
  opacity: 1;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

.ctrl-btn svg {
  width: 20px;
  height: 20px;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: var(--space-sm);
}

.volume-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: var(--space-xs);
}

.volume-slider {
  width: 100px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  appearance: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
  background: var(--accent);
}

/* ============ VOICE SELECTION PANEL ============ */
.voice-selectors {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.voice-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.voice-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.voice-select {
  padding: var(--space-sm) var(--space-md);
  padding-right: var(--space-xl);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0b0' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all 0.2s;
}

.voice-select:hover:not(:disabled) {
  border-color: var(--border-light);
  background-color: var(--bg-hover);
}

.voice-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.voice-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.voice-select option:disabled {
  color: var(--text-muted);
}

/* Selection summary */
.selection-summary {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.selection-summary h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-char {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summary-voice {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.summary-voice.empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

/* Email section */
.email-section {
  margin-bottom: var(--space-lg);
}

.email-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-xs);
}

.email-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
  transition: all 0.2s;
}

.email-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.email-input::placeholder {
  color: var(--text-muted);
}

/* Send button */
.btn-send {
  width: 100%;
  padding: var(--space-md);
  font-size: 1rem;
}

/* ============ MODALS ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.modal.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-small {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Form elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input::placeholder {
  color: var(--text-muted);
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

.char-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.warning-text {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.client-link-preview {
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============ CLIENT MODE ============ */
/* Hide studio-only elements when in client mode */
.mode-client .panel-left,
.mode-client .movie-selector,
.mode-client #btnSettings,
.mode-client .welcome-state {
  display: none !important;
}

.mode-client .header-center {
  justify-content: center;
  margin-left: 2em;
}

.mode-client .header-left {
  flex: 0;
}

/* Show movie title in client mode */
.client-movie-title {
  display: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mode-client .client-movie-title {
  display: block;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
  position: fixed;
  top: 80px;
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 360px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-error {
  border-left: 3px solid var(--error);
}

.toast-message {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .editor-state {
    flex-direction: column;
  }
  
  .panel-left,
  .panel-right {
    width: 100%;
    max-height: 300px;
  }
  
  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .panel-right {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  
  .panel-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .upload-section {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .header {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .header-left,
  .header-center,
  .header-right {
    flex: none;
    width: auto;
  }
  
  .header-center {
    order: 3;
    width: 100%;
  }
  
  .select-movie {
    width: 100%;
  }
  
  .modal-content {
    width: 95%;
    margin: var(--space-md);
  }
  
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
  }
  
  .toast {
    max-width: none;
  }
}
