:root {
  --bg-color: #0c0c0e;
  --panel-bg: #141417;
  --panel-border: #26262e;
  --text-main: #f4f4f6;
  --text-muted: #8e8e9a;
  --accent: #ff5500;
  --accent-hover: #e04b00;
  --accent-light: rgba(255, 85, 0, 0.12);
  --success: #00e676;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  letter-spacing: 1px;
  border-radius: 2px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-title span {
  color: var(--accent);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Panel */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 14px;
}

.panel-header h2 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--panel-border);
  border-radius: 4px;
  padding: 32px 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 12px;
}

.drop-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.drop-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.file-name {
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-muted);
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.lang-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lang-btn {
  background: #1a1a20;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 12px 14px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  border-color: #3e3e4a;
}

.lang-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: #fff;
}

/* Toggle Switch */
.toggle-group {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: #1a1a20;
  padding: 14px 16px;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 260px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #33333d;
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

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

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 14px 20px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 16px;
  font-size: 12px;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  width: 100%;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.btn-icon:hover {
  color: #fff;
}

/* Status Card */
.status-card {
  background: #101013;
  border: 1px solid var(--panel-border);
  padding: 16px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.progress-bar-container {
  height: 4px;
  background: #22222a;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.log-console {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-height: 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  line-height: 1.4;
}

/* Right Column: Preview */
.preview-panel {
  min-height: 600px;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: #101013;
  padding: 4px;
  border-radius: 4px;
}

.toggle-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
}

.toggle-tab.active {
  background: var(--panel-bg);
  color: var(--text-main);
  font-weight: 600;
}

/* Video Player */
.player-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

@media (max-width: 768px) {
  .player-container {
    grid-template-columns: 1fr;
  }
}

.video-box {
  background: #08080a;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 420px;
  overflow: hidden;
}

.video-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 10;
  border-radius: 2px;
}

.video-box video {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

/* Transcript Container */
.transcript-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.transcript-column h3 {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.transcript-box {
  background: #08080a;
  border: 1px solid var(--panel-border);
  padding: 16px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 380px;
  max-height: 480px;
  overflow-y: auto;
}

/* Export Bar */
.export-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}

.result-meta {
  display: flex;
  gap: 12px;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  background: #1a1a20;
  padding: 4px 8px;
  border-radius: 2px;
  color: var(--text-muted);
}

/* Voice Catalog Grid */
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.voice-grid::-webkit-scrollbar {
  width: 4px;
}

.voice-grid::-webkit-scrollbar-thumb {
  background: #2e2e3a;
  border-radius: 2px;
}

@media (max-width: 600px) {
  .voice-grid {
    grid-template-columns: 1fr;
    max-height: 320px;
  }
}

.voice-card {
  background: #1a1a20;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 72px;
}

.voice-card:hover {
  border-color: #3e3e4a;
}

.voice-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.voice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
}

.voice-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.voice-badge.star {
  background: rgba(255, 85, 0, 0.2);
  color: var(--accent);
  font-weight: 700;
}

.voice-badge.female {
  background: rgba(236, 64, 122, 0.2);
  color: #ec407a;
}

.voice-badge.bold {
  background: rgba(156, 39, 176, 0.2);
  color: #ab47bc;
}

.voice-badge.tech {
  background: rgba(0, 188, 212, 0.2);
  color: #00bcd4;
}

.voice-badge.luxury {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.voice-badge.hype {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.voice-badge.youth {
  background: rgba(139, 195, 74, 0.2);
  color: #8bc34a;
}

.voice-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Mode Switcher Header */
.mode-toggle {
  display: flex;
  background: #15151a;
  border-radius: 4px;
  padding: 3px;
  border: 1px solid var(--panel-border);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Batch Queue Container */
.batch-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.batch-dropzone {
  border: 2px dashed #2e2e3a;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  background: #141418;
  transition: border-color 0.2s;
}

.batch-dropzone:hover {
  border-color: var(--accent);
}

.batch-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

.batch-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: #f44336;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.batch-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.batch-empty-msg {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  border: 1px dashed var(--panel-border);
  border-radius: 4px;
}

/* Batch Item Card */
.batch-item-card {
  background: #18181f;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.batch-item-card.processing {
  border-color: var(--accent);
}

.batch-item-card.success {
  border-color: #4caf50;
}

.batch-item-card.error {
  border-color: #f44336;
}

.batch-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-item-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.batch-item-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.batch-item-badge.pending { color: #ffb74d; }
.batch-item-badge.processing { color: var(--accent); font-weight: bold; }
.batch-item-badge.done { color: #81c784; font-weight: bold; }
.batch-item-badge.err { color: #e57373; }

.batch-item-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.batch-select {
  background: #111116;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-body);
}

.batch-item-extra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.batch-mask-label {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.batch-mask-check {
  accent-color: var(--accent);
  cursor: pointer;
}

.btn-cancel {
  background: transparent;
  border: 1px solid #f44336;
  color: #f44336;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-heading);
}

.btn-cancel:hover {
  background: rgba(244, 67, 54, 0.1);
}

.export-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.export-actions .btn {
  flex: 1;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .app-container {
    padding: 12px;
    gap: 12px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
  }

  .brand-title {
    font-size: 18px;
  }

  .panel {
    padding: 16px;
    gap: 16px;
  }

  .btn {
    min-height: 48px;
    font-size: 15px;
  }

  .lang-btn {
    min-height: 48px;
  }

  .video-box {
    min-height: 320px;
  }

  .transcript-container {
    grid-template-columns: 1fr;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* Batch Console Giant */
.batch-console-container { display: flex; flex-direction: column; flex: 1; min-height: 500px; }
.batch-console-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.giant-console { flex: 1; font-size: 0.95rem; line-height: 1.6; max-height: none; height: 100%; border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

