/* VoiceLayer — Premium Dark Production Studio Theme */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Harmonious Dark Palette */
  --bg-app: #111214;
  --bg-sidebar: #161719;
  --bg-card: #1e2023;
  --bg-input: #121315;
  --bg-hover: #26292e;
  
  /* Electric Accent (Violet) */
  --accent: #7B61FF;
  --accent-hover: #9680FF;
  --accent-glow: rgba(123, 97, 255, 0.15);
  --accent-border: rgba(123, 97, 255, 0.3);
  
  /* System States */
  --success: #00E5A0; /* Premium electric teal for successes */
  --danger: #FF4d4d;
  --warning: #FFA500;
  
  /* Typography */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Layout Metrics */
  --sidebar-w: 300px;
  --navbar-h: 60px;
  --border: 1px solid rgba(255, 255, 255, 0.08);
  --border-focus: 1px solid rgba(123, 97, 255, 0.5);
  --radius: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Elements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: #e2e8f0;
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Top Navigation Bar */
.top-nav {
  height: var(--navbar-h);
  background-color: var(--bg-sidebar);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background-color: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 10px rgba(123, 97, 255, 0.4);
}

.nav-tabs {
  display: flex;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius);
  border: var(--border);
}

.nav-tab {
  padding: 8px 16px;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab:hover {
  color: #fff;
}

.nav-tab.active {
  background-color: var(--bg-card);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  font-family: var(--font-mono);
}

.user-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--success);
}

/* App Main Layout */
.app-container {
  flex: 1;
  display: flex;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}

/* Persistent Sidebar (Voice Library) */
.sidebar {
  width: var(--sidebar-w);
  background-color: var(--bg-sidebar);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Voice Profile Card inside Sidebar */
.voice-card {
  background-color: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.voice-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: transparent;
  transition: var(--transition);
}

.voice-card:hover {
  border-color: var(--accent-border);
  background-color: var(--bg-hover);
  transform: translateY(-2px);
}

.voice-card.selected {
  border-color: var(--accent);
  background-color: var(--accent-glow);
}

.voice-card.selected::before {
  background-color: var(--accent);
}

.voice-card-title {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-card-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-card-wps {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wps-tag {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.voice-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 8px;
}

.voice-card-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.voice-card-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.voice-card-btn.delete-btn:hover {
  color: var(--danger);
  background-color: rgba(255, 77, 77, 0.1);
}

.sidebar-footer {
  padding: 16px;
  border-top: var(--border);
}

.add-voice-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius);
  background-color: rgba(123, 97, 255, 0.1);
  border: 1px dashed var(--accent-border);
  color: var(--accent-hover);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.add-voice-btn:hover {
  background-color: var(--accent);
  color: #fff;
  border-style: solid;
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  color: #64748b;
  flex: 1;
}

.empty-state i {
  font-size: 32px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.15);
}

.empty-state p {
  font-size: 13px;
  line-height: 1.5;
}

/* Main Workspace Panels */
.workspace-content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

.tab-panel {
  display: none;
  min-height: 100%;
  padding: 24px;
}

.tab-panel.active {
  display: block;
}

/* ========================================== */
/* SECTION 1: VOICE STUDIO WORKSPACE          */
/* ========================================== */

.voice-studio-card {
  max-width: 640px;
  margin: 20px auto;
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.studio-title-section {
  text-align: center;
  margin-bottom: 28px;
}

.studio-title-section h1 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.studio-title-section p {
  font-size: 14px;
  color: #94a3b8;
}

.studio-step {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: var(--border);
}

.studio-step:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-label {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-number {
  background-color: var(--accent);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* Form inputs styling */
.text-input-wrapper {
  position: relative;
}

.text-input {
  width: 100%;
  background-color: var(--bg-input);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: #fff;
  transition: var(--transition);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.input-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

/* Sample File Upload Grids */
.upload-slots-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .upload-slots-container {
    grid-template-columns: 1fr;
  }
}

.upload-slot {
  background-color: var(--bg-input);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.upload-slot:hover {
  border-color: var(--accent);
  background-color: rgba(123, 97, 255, 0.04);
}

.upload-slot.has-file {
  border-color: var(--success);
  border-style: solid;
  background-color: rgba(0, 229, 160, 0.02);
}

.upload-icon {
  font-size: 20px;
  color: #64748b;
  margin-bottom: 8px;
  transition: var(--transition);
}

.upload-slot:hover .upload-icon {
  color: var(--accent);
}

.upload-slot.has-file .upload-icon {
  color: var(--success);
}

.upload-label {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 4px;
}

.file-info {
  font-size: 11px;
  color: #64748b;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.checkmark-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--success);
  font-size: 14px;
  display: none;
}

.upload-slot.has-file .checkmark-badge {
  display: block;
}

.hidden-file-input {
  display: none;
}

/* Clone Action button */
.studio-actions {
  margin-top: 12px;
}

.btn-primary {
  width: 100%;
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  box-shadow: 0 0 16px rgba(123, 97, 255, 0.4);
}

.btn-primary:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  color: #64748b;
  cursor: not-allowed;
}

/* Spinners */
.spinner {
  animation: rotate 1s linear infinite;
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

/* Calibration Area */
.calibration-container {
  background-color: var(--bg-input);
  border: var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
}

.calibration-alert {
  display: flex;
  gap: 12px;
  background-color: var(--accent-glow);
  border: 1px solid var(--accent-border);
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.calibration-alert i {
  color: var(--accent-hover);
  font-size: 16px;
  margin-top: 2px;
}

.transcript-area {
  width: 100%;
  background-color: var(--bg-app);
  border: var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 12px;
}

.transcript-area:focus {
  outline: none;
  border-color: var(--accent);
}

.cal-wps-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 12px;
}

.cal-wps-tag {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}

.studio-success-state {
  text-align: center;
  padding: 20px 0;
}

.studio-success-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(0, 229, 160, 0.1);
  border: 1px solid rgba(0, 229, 160, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 28px;
  margin: 0 auto 20px;
  box-shadow: 0 0 20px rgba(0, 229, 160, 0.15);
}

.success-details {
  background-color: var(--bg-input);
  border: var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px auto;
  max-width: 400px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.success-details-row {
  display: flex;
  justify-content: space-between;
}

.success-details-row span:first-child {
  color: #64748b;
}

.success-details-row span:last-child {
  color: #fff;
  font-family: var(--font-mono);
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border: var(--border);
  color: #e2e8f0;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}


/* ========================================== */
/* SECTION 2: PRODUCTION DESK WORKSPACE       */
/* ========================================== */

.production-desk {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  height: calc(100vh - var(--navbar-h) - 48px); /* subtract padding */
}

@media (max-width: 1024px) {
  .production-desk {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Left Column: Player & Subtitle Preview sticky wrapper */
.desk-left-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0; /* allows box to shrink inside grid */
}

/* Custom Video Player Component */
.player-container {
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.video-dropzone {
  aspect-ratio: 16/9;
  background-color: var(--bg-input);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  padding: 32px;
  transition: var(--transition);
}

.video-dropzone:hover {
  border-color: var(--accent);
  background-color: rgba(123, 97, 255, 0.02);
}

.video-dropzone i {
  font-size: 40px;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 16px;
}

.video-dropzone h3 {
  font-family: var(--font-title);
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}

.video-dropzone p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

.video-aspect-tag {
  font-size: 10px;
  color: var(--accent-hover);
  font-family: var(--font-mono);
}

.video-element-wrapper {
  aspect-ratio: 16/9;
  background-color: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  width: auto;
  height: 450px;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: aspect-ratio 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-element-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Custom Styled Playback controls */
.player-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-scrub-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Monospace scrubbing range */
.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.timeline-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: transparent;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  cursor: pointer;
  margin-top: -3px; /* centers on track */
  transition: transform 0.15s ease;
}

.timeline-slider:hover::-webkit-slider-thumb {
  transform: scale(1.3);
}

.desktop-hide {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    z-index: 20;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* ========================================== */
/* SETTINGS / ACCOUNT DASHBOARD LAYOUT        */
/* ========================================== */

.settings-dashboard {
  display: flex;
  gap: 32px;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.settings-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 16px;
  border-right: var(--border);
}

.settings-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-left: 12px;
}

.settings-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-item {
  padding: 8px 12px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.settings-nav-item i {
  width: 16px;
  text-align: center;
}

.settings-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.settings-nav-item.active {
  background-color: var(--accent-glow);
  color: var(--accent-hover);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 40px;
  padding-right: 16px;
}

.settings-section-header {
  margin-bottom: 24px;
}

.settings-section-header h2 {
  font-family: var(--font-title);
  font-size: 24px;
  color: #fff;
  margin-bottom: 6px;
}

.settings-section-header p {
  color: #94a3b8;
  font-size: 14px;
}

.settings-card {
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(123, 97, 255, 0.1);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent-hover);
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-details strong {
  font-size: 16px;
  color: #fff;
}

.profile-details span {
  font-size: 13px;
  color: #64748b;
  font-family: var(--font-mono);
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.credit-pack-card {
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}

.credit-pack-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.credit-pack-card.recommended {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.recommended-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background-color: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.credit-pack-card h3 {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.credit-amount {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.credit-price {
  font-size: 14px;
  color: #4ade80;
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .settings-dashboard {
    flex-direction: column;
  }
  .settings-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: var(--border);
    padding-bottom: 16px;
  }
}

/* Floating Timeline Tooltip on Hover */
.timeline-tooltip {
  position: absolute;
  bottom: 18px;
  left: 0;
  transform: translateX(-50%);
  background-color: var(--bg-card);
  border: var(--border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  display: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.player-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.control-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  color: #fff;
  background-color: rgba(255,255,255,0.06);
}

.control-btn.play-pause-btn {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(123, 97, 255, 0.2);
}

.control-btn.play-pause-btn:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 12px rgba(123, 97, 255, 0.4);
}

.time-readout {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  gap: 6px;
}

.time-readout span:first-child {
  color: #fff;
  font-weight: 500;
}

.player-right-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.copy-timestamp-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: var(--border);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.copy-timestamp-btn:hover {
  border-color: var(--accent-border);
  color: #fff;
  background-color: rgba(123, 97, 255, 0.04);
}

.copy-timestamp-btn.copied {
  background-color: var(--success);
  border-color: var(--success);
  color: var(--bg-app);
}

.replace-video-link {
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.replace-video-link:hover {
  color: var(--accent-hover);
}

/* Sticky Bottom Subtitle Preview Canvas Box */
.subtitle-preview-container {
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.subtitle-preview-header {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
}

.subtitle-preview-note {
  font-size: 11px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* Subtitle overlay — sized/positioned by JS to match the <video> element exactly */
.subtitle-video-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.subtitle-video-overlay.is-hidden {
  display: none;
}

.subtitle-overlay-inner.dragging {
  cursor: grabbing;
}

.subtitle-overlay-inner {
  cursor: grab;
  position: absolute;
  max-width: 90%;
  text-align: center;
  pointer-events: auto;
  transform-origin: center bottom;
  will-change: left, top;
}

.subtitle-overlay-text,
.preview-text {
  display: inline-block;
  text-align: center;
  max-width: 100%;
  font-weight: 600;
  line-height: 1.35;
  word-wrap: break-word;
  color: #fff;
  text-shadow: 1px 1px 1px #000, -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000, 0 2px 4px rgba(0,0,0,0.8);
  transform-origin: center bottom;
  position: relative;
  cursor: move;
  user-select: none;
  transition: opacity 0.2s ease, text-shadow 0.2s ease;
}

.subtitle-overlay-text.dragging,
.preview-text.dragging {
  text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-hover), 1px 1px 1px #000, -1px -1px 1px #000;
}

.subtitle-overlay-text.is-hidden {
  opacity: 0;
}

.preview-word {
  display: inline;
  margin-right: 0.28em;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.preview-word.visible {
  opacity: 1;
}

.preview-word.active {
  opacity: 1;
}

.preview-word.karaoke-sung {
  opacity: 1;
}


/* Subtitle ASS simulation animations */
.subtitle-preview-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.subtitle-preview-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.subtitle-preview-details strong {
  color: #94a3b8;
  font-weight: 500;
}

/* ========================================== */
/* SUBTITLE EFFECTS KEYFRAMES & UTILS         */
/* ========================================== */

/* Fade Effect — approximates \\fad(200,200) */
.effect-fade {
  animation: subFade 2.5s ease-in-out infinite;
}
@keyframes subFade {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}



/* Karaoke chunk-level legacy sweep (kept for chunk-mode fallback) */
.effect-karaoke {
  background-image: linear-gradient(
    to right,
    var(--kar-effect-color) 50%,
    var(--kar-text-color) 50%
  );
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: subKaraoke 4s linear infinite;
  text-shadow: none !important;
}
@keyframes subKaraoke {
  0%, 15% { background-position: 100% 0; }
  85%, 100% { background-position: 0% 0; }
}

/* Word Stack: active word pulses with the chosen effect color */
.effect-word_stack {
  animation: subWordStack 0.18s ease-out forwards;
}
@keyframes subWordStack {
  from { opacity: 0.5; transform: scale(0.95); }
  to   { opacity: 1;   transform: scale(1); }
}


/* Right Column: Narration Sets & Configuration */
.desk-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 100%;
  padding-right: 4px;
}

/* Global Settings Panel */
.global-settings-bar {
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.global-settings-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-settings-info i {
  color: var(--accent);
  font-size: 18px;
}

.global-settings-title {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.global-settings-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Custom YES/NO toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 24px;
  border: var(--border);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-glow);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
  background-color: var(--accent-hover);
}

/* Auto-fill banner info */
.autofill-banner {
  background-color: rgba(123, 97, 255, 0.08);
  border: 1px solid rgba(123, 97, 255, 0.15);
  color: #c084fc;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: bannerFadeIn 0.3s ease-out;
}

@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.autofill-banner-dismiss {
  cursor: pointer;
  color: #64748b;
  transition: var(--transition);
}

.autofill-banner-dismiss:hover {
  color: #fff;
}

/* Narration Sets Card List */
.narration-sets-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card layout & collapses */
.set-card {
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
}

.set-card.focused {
  border-color: var(--accent-border);
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.08);
}

.set-card.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.1);
}

.set-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background-color: rgba(255,255,255,0.02);
  user-select: none;
}

.set-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  min-width: 0; /* lets text ellipsis work */
}

.set-number-badge {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.set-timestamp-pill {
  font-family: var(--font-mono);
  background-color: rgba(123, 97, 255, 0.1);
  color: var(--accent-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid rgba(123, 97, 255, 0.15);
}

.set-card.has-error .set-timestamp-pill {
  background-color: rgba(255, 77, 77, 0.1);
  color: var(--danger);
  border-color: rgba(255, 77, 77, 0.15);
}

.set-preview-text {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.set-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.set-remove-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
  padding: 4px;
  border-radius: 4px;
}

.set-remove-btn:hover {
  color: var(--danger);
  background-color: rgba(255, 77, 77, 0.1);
}

.set-expand-icon {
  font-size: 12px;
  color: #64748b;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.set-card.expanded .set-expand-icon {
  transform: rotate(180deg);
}

.set-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid transparent;
}

.set-card.expanded .set-body {
  max-height: 1000px; /* high value for expansion height */
  border-top-color: var(--border);
}

.set-fields-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 500px) {
  .set-fields-grid {
    grid-template-columns: 1fr;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group.full-width {
  grid-column: span 2;
}

@media (max-width: 500px) {
  .field-group.full-width {
    grid-column: span 1;
  }
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.field-action-link {
  font-size: 11px;
  color: var(--accent-hover);
  text-decoration: none;
  cursor: pointer;
}

.field-action-link:hover {
  text-decoration: underline;
}

/* Custom styled dropdowns, inputs */
.set-select, .set-input {
  width: 100%;
  background-color: var(--bg-input);
  border: var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  transition: var(--transition);
}

.set-select:focus, .set-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.set-input.mono {
  font-family: var(--font-mono);
}

.set-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  resize: vertical;
  min-height: 70px;
  transition: var(--transition);
}

.set-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* Color input and sync hex wrapper */
.color-sync-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-picker-native {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-picker-native::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-native::-webkit-color-swatch {
  border: var(--border);
  border-radius: 6px;
}

.color-hex-input {
  flex: 1;
}

/* Inline Duration Estimation bar */
.duration-estimate-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.duration-estimate-bar i {
  color: var(--accent-hover);
}

.duration-val {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Pick Voice from Library Dropdown Select */
.voice-picker-relative {
  position: relative;
}

.voice-picker-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: var(--border);
  color: #94a3b8;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.voice-picker-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.voice-picker-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: var(--bg-card);
  border: var(--border);
  border-radius: 6px;
  width: 220px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 10;
}

.voice-picker-menu.open {
  display: block;
}

.voice-picker-item {
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-picker-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.voice-picker-item .vp-title {
  color: #fff;
  font-weight: 500;
}

.voice-picker-item .vp-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

/* Action button at bottom of list */
.list-actions {
  margin-top: 8px;
  margin-bottom: 80px; /* leave space for sticky footer */
}

.add-set-btn {
  width: 100%;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  color: #94a3b8;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.add-set-btn:hover {
  border-color: var(--accent);
  color: #fff;
  background-color: rgba(123, 97, 255, 0.04);
}


/* ========================================== */
/* SECTION 2.6: SUBMIT STICKY FOOTER          */
/* ========================================== */

.submit-sticky-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-sidebar);
  border-top: var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 5;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.submit-meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #94a3b8;
}

.submit-meta-info i {
  color: var(--accent);
}

.submit-meta-info strong {
  color: #fff;
}

.btn-submit {
  background-color: var(--success);
  color: var(--bg-app);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-submit:hover:not(:disabled) {
  background-color: #00ffb3;
  box-shadow: 0 0 16px rgba(0, 229, 160, 0.4);
}

.btn-submit:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  color: #64748b;
  cursor: not-allowed;
}


/* ========================================== */
/* OVERLAYS & STATE MODALS                    */
/* ========================================== */

/* Processing fullscreen loading screen */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(17, 18, 20, 0.95);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.processing-card {
  max-width: 480px;
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.processing-cog-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.cog-large {
  font-size: 48px;
  color: var(--accent);
  position: absolute;
  top: 10px;
  left: 10px;
  animation: cogRotateClockwise 4s linear infinite;
}

.cog-small {
  font-size: 24px;
  color: var(--success);
  position: absolute;
  bottom: 10px;
  right: 10px;
  animation: cogRotateCounter 2.5s linear infinite;
}

@keyframes cogRotateClockwise {
  100% { transform: rotate(360deg); }
}

@keyframes cogRotateCounter {
  100% { transform: rotate(-360deg); }
}

.processing-card h2 {
  font-family: var(--font-title);
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}

.processing-card p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
  font-weight: 500;
}

/* Success Fullscreen Overlay */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(17, 18, 20, 0.95);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
  backdrop-filter: blur(10px);
}

.success-card {
  max-width: 500px;
  background-color: var(--bg-sidebar);
  border: var(--border);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Dismiss / close button for processing & success overlays */
.overlay-dismiss-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.overlay-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Danger / destructive action button */
.btn-danger {
  background-color: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.25);
  color: var(--danger);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.3);
}

.success-card-icon {
  width: 64px;
  height: 64px;
  background-color: rgba(0, 229, 160, 0.1);
  border: 1px solid rgba(0, 229, 160, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 32px;
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(0, 229, 160, 0.2);
}

.success-card h2 {
  font-family: var(--font-title);
  font-size: 22px;
  color: #fff;
  margin-bottom: 12px;
}

.success-card p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Dialog Warning Confirmation Modal */
.modal-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-confirm-card {
  width: 400px;
  max-width: 90%;
  background-color: var(--bg-card);
  border: var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-confirm-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-confirm-title i {
  color: var(--warning);
}

.modal-confirm-body {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}


/* ========================================== */
/* VALIDATION TOAST SYSTEMS                   */
/* ========================================== */

.toast-wrapper {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: rgba(30, 32, 35, 0.85);
  border: var(--border);
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
  min-width: 280px;
  max-width: 400px;
  animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.3s, opacity 0.3s;
}

@keyframes toastSlideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

.toast i {
  font-size: 16px;
}

.toast-error i { color: var(--danger); }
.toast-success i { color: var(--success); }
.toast-warning i { color: var(--warning); }

.toast-dismiss {
  margin-left: auto;
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  transition: var(--transition);
}

.toast-dismiss:hover {
  color: #fff;
}

/* Script Header Row and Control Pill Buttons */
.script-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.script-header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tag-insert-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  user-select: none;
}

.tag-insert-btn i {
  font-size: 10px;
}

.tag-insert-btn.active-insert-btn {
  border-color: rgba(0, 229, 160, 0.2);
}
.tag-insert-btn.active-insert-btn:hover {
  background-color: rgba(0, 229, 160, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.tag-insert-btn.passive-insert-btn {
  border-color: rgba(255, 165, 0, 0.2);
}
.tag-insert-btn.passive-insert-btn:hover {
  background-color: rgba(255, 165, 0, 0.1);
  border-color: var(--warning);
  color: var(--warning);
}

/* Highlighted Script Preview Box */
.script-preview-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.script-preview-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.script-preview-highlighted {
  width: 100%;
  background-color: var(--bg-input);
  border: var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 48px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-body);
  transition: var(--transition);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* Expression Highlights Badges */
.tag-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  margin: 0 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.tag-active {
  background-color: rgba(0, 229, 160, 0.12);
  border: 1px solid rgba(0, 229, 160, 0.35);
  color: var(--success);
  text-shadow: 0 0 8px rgba(0, 229, 160, 0.2);
}

.tag-passive {
  background-color: rgba(255, 165, 0, 0.12);
  border: 1px solid rgba(255, 165, 0, 0.35);
  color: var(--warning);
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.2);
}

/* Safety Warning Note Alert */
.safety-warning-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background-color: rgba(255, 165, 0, 0.04);
  border: 1px dashed rgba(255, 165, 0, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  margin-top: 4px;
}

.safety-warning-note i {
  color: var(--warning);
  margin-top: 1px;
  font-size: 12px;
}

/* Subtitle Position Offset Tuner Widget Styles */
.subtitle-position-tuner {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
  margin-top: 12px;
}

.position-controls-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background-color: rgba(255, 255, 255, 0.015);
  border: var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
}

@media (max-width: 500px) {
  .position-controls-wrapper {
    grid-template-columns: 1fr;
  }
}

.position-control-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.position-control-item label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.position-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pos-num-input {
  text-align: center;
  padding: 6px !important;
  font-size: 12px !important;
  flex: 1;
}

.pos-step-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 6px 8px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.pos-step-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent-hover);
  color: #fff;
}

/* Visual Subtitle Effect Simulations Keyframes */
.effect-uppercase {
  text-transform: uppercase;
}

.effect-lowercase {
  text-transform: lowercase;
}

/* Word Pop Effect — scales active word up and down quickly */
.effect-word_pop {
  display: inline-block;
  animation: previewWordPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes previewWordPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Phrase Slide Effect — slides entire chunk up 40px over 250ms */
.effect-phrase_slide {
  animation: previewPhraseSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes previewPhraseSlide {
  0% { transform: translateY(40px); }
  100% { transform: translateY(0); }
}

/* Auth modal */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.auth-header-btn {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: var(--border);
  background: var(--bg-input);
  color: #cbd5e1;
  cursor: pointer;
}

.auth-header-btn:hover {
  background: var(--bg-hover);
}

.auth-header-btn-accent {
  border-color: var(--accent-border);
  color: var(--accent-hover);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-card-header i {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
}

.auth-card-header h2 {
  font-family: var(--font-title);
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-card-header p {
  font-size: 13px;
  color: #94a3b8;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  cursor: pointer;
  font-weight: 500;
}

.auth-tab.active {
  border-color: var(--accent-border);
  background: var(--accent-glow);
  color: var(--accent-hover);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-form label {
  font-size: 12px;
  color: #94a3b8;
}

.auth-form input {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: var(--border);
  background: var(--bg-input);
  color: #fff;
  width: 100%;
  box-sizing: border-box;
  transition: var(--transition);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.auth-submit {
  margin-top: 12px;
  width: 100%;
}

.auth-message {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  color: #94a3b8;
}

.auth-message.success {
  color: var(--success);
}

.auth-message.error {
  color: var(--danger);
}

.auth-sign-out-btn {
  margin-left: 8px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
}

.auth-sign-out-btn:hover {
  color: var(--danger);
  background: rgba(255, 77, 77, 0.1);
}

/* ========================================== */
/* TWO-PHASE WAITING PROGRESS TRACKER STYLES */
/* ========================================== */

.job-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 24px;
}

.job-status-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #cbd5e1;
}

.job-status-title i {
  font-size: 16px;
}

.btn-copy-id {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-copy-id:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.progress-steps-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 28px;
  text-align: left;
}

.progress-step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 10px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.progress-step-item.active {
  background: rgba(255, 255, 255, 0.02);
}

.pstep-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.pstep-indicator i.fa-circle-notch {
  color: var(--accent);
}

.pstep-indicator i.fa-circle-check {
  color: var(--success, #22c55e);
}

.pstep-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pstep-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.pstep-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.progress-step-item.active .pstep-desc {
  color: #94a3b8;
}

.progress-step-item.completed .pstep-desc {
  color: #64748b;
}

/* Custom progress bar within Step 2 */
.step-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  width: 100%;
}

.step-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.step-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent, #3b82f6) 0%, var(--success, #10b981) 100%);
  border-radius: 4px;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.step-progress-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  min-width: 32px;
  text-align: right;
}

.job-waiting-footer {
  font-size: 12px;
  color: #64748b;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.5;
  text-align: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 16px;
  width: 100%;
}



/* ============================================================ */
/* LANDING PAGE                                                  */
/* ============================================================ */

#panel-landing {
  min-height: calc(100vh - 64px);
  padding: 0 0 80px;
  overflow-y: auto;
  background: var(--bg-app);
}

/* ---- Hero ---- */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 24px 80px;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(123, 97, 255, 0.18) 0%, transparent 70%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.landing-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(123, 97, 255, 0.12);
  border: 1px solid rgba(123, 97, 255, 0.3);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
}

.landing-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 20px;
  max-width: 780px;
}

.landing-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero-sub {
  font-size: 18px;
  color: #94a3b8;
  max-width: 600px;
  line-height: 1.65;
  margin: 0 0 40px;
}

.landing-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 0 0 rgba(123, 97, 255, 0.4);
}
.landing-cta-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123, 97, 255, 0.35);
}

.landing-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.landing-cta-secondary:hover {
  border-color: rgba(255,255,255,0.28);
  color: #fff;
  background: rgba(255,255,255,0.04);
}

/* ---- Feature Cards ---- */
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 64px auto 0;
  padding: 0 24px;
}

.landing-feature-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 32px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.landing-feature-card:hover {
  border-color: rgba(123, 97, 255, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.landing-feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 16px 0 10px;
}
.landing-feature-card p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

.landing-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(123, 97, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent-hover);
}

/* ---- How it Works ---- */
.landing-steps {
  max-width: 1100px;
  margin: 80px auto 0;
  padding: 0 24px;
  text-align: center;
}

.landing-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 48px;
}

.landing-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  text-align: left;
}

.landing-step {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 32px 28px 28px;
}

.landing-step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 40px;
  font-weight: 700;
  color: rgba(123, 97, 255, 0.18);
  line-height: 1;
  margin-bottom: 16px;
  user-select: none;
}

.landing-step h4 {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 8px;
}

.landing-step p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

/* ---- Footer CTA ---- */
.landing-footer-cta {
  max-width: 520px;
  margin: 80px auto 0;
  text-align: center;
  padding: 0 24px;
}
.landing-footer-cta h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}
.landing-footer-cta p {
  color: #64748b;
  font-size: 15px;
  margin: 0 0 28px;
}
