:root {
  --bg-primary: #0b0f19;
  --bg-card: rgba(23, 29, 45, 0.92);
  --bg-card-hover: rgba(30, 38, 60, 0.98);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: #6366f1;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-accent: #a5b4fc;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --success: #10b981;
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-family: 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ====================================================
   LIGHT THEME (উজ্জ্বল এবং পরিপাটি ডিজাইন)
   ==================================================== */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-active: #4f46e5;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-accent: #4f46e5;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.25);
}

[data-theme="light"] body {
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  color: #0f172a;
}

[data-theme="light"] .card {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  border-color: #e2e8f0;
}

[data-theme="light"] .app-header {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .dropzone {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .dropzone:hover,
[data-theme="light"] .dropzone.dragover {
  background: #eef2ff;
  border-color: #4f46e5;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-input-sm {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .tab-buttons {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .tab-btn {
  color: #64748b;
}

[data-theme="light"] .tab-btn:hover {
  color: #0f172a;
}

[data-theme="light"] .tab-btn.active {
  background: #4f46e5;
  color: #ffffff;
}

[data-theme="light"] .tag {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .slider-group {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .mode-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .mode-card.active {
  background: #eef2ff;
  border-color: #4f46e5;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
}

[data-theme="light"] .media-preview-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .advanced-details {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .advanced-summary {
  background: #f1f5f9;
  color: #1e293b;
}

[data-theme="light"] .placeholder-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .feature-item {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0;
}

[data-theme="light"] .btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

[data-theme="light"] .btn-action {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
}

[data-theme="light"] .progress-container {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* ====================================================
   BASE STYLES
   ==================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  padding: 24px 16px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* SVG Helpers */
.icon-svg {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 22px; height: 22px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 44px; height: 44px; }
.icon-xxl { width: 64px; height: 64px; }
.yt-color { color: #ff0000; }

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 18px 26px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

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

.logo-icon {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.logo-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 11px;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.logo-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

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

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

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.25s ease;
}

.step-card { margin-bottom: 24px; }

.step-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

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

.dropzone-main-text {
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-main-text strong {
  color: var(--text-accent);
  text-decoration: underline;
}

.dropzone-sub-text {
  font-size: 12px;
  color: var(--text-muted);
}

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

.upload-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #10b981);
  width: 0%;
  transition: width 0.2s ease;
}

/* Tabs */
.tab-buttons {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  transition: all 0.2s ease;
}

.tab-btn:hover { color: var(--text-main); }

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* YouTube Input */
.yt-input-container {
  display: flex;
  gap: 10px;
}

.input-with-icon {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  pointer-events: none;
  opacity: 0.6;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-family);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.hint-text {
  font-size: 12px;
  color: var(--text-accent);
  margin-top: 10px;
}

/* Media Previews */
.media-preview-card {
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
}

.video-preview-player {
  width: 100%;
  max-height: 220px;
  background: #000;
  border-radius: var(--radius-sm);
  outline: none;
}

.audio-preview-player {
  width: 100%;
  margin-top: 10px;
  height: 40px;
}

.media-meta { margin-top: 10px; }

.media-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.tag {
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  color: var(--text-muted);
}

.tag-audio {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.tag-success {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
}

.btn-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: #ef4444;
  color: white;
}

.music-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.music-source-badge {
  font-size: 12px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: 4px;
}

.music-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-icon-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.video-extracted-notice {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Sound Mode Selection */
.mode-selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.mode-card {
  position: relative;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-card input { display: none; }

.mode-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.18);
}

.mode-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mode-icon {
  color: var(--primary);
}

.mode-status-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
}

.mode-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sliders */
.volume-sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.slider-group {
  background: rgba(15, 23, 42, 0.4);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: opacity 0.2s;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.slider-val {
  font-weight: 600;
  color: var(--text-accent);
}

.range-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Advanced Accordion */
.advanced-details {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow: hidden;
}

.advanced-summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-accent);
  background: rgba(15, 23, 42, 0.6);
  user-select: none;
}

.advanced-content { padding: 16px; }

.checkbox-row { margin-bottom: 10px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.options-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.input-group label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.input-group small {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.form-input-sm {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-family);
}

/* Notice Helper */
.merge-helper-notice {
  font-size: 12px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  text-align: center;
  transition: all 0.2s;
}

.merge-helper-notice.ready {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-tertiary {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

.btn-tertiary:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 16px;
}

.btn-action {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-action:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-2px);
}

/* Status & Processing Card */
.status-card {
  border-color: rgba(99, 102, 241, 0.4);
}

.status-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.spinner-large {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

.status-title { font-size: 17px; }
.status-desc { font-size: 13px; color: var(--text-muted); }

.progress-container {
  height: 10px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Result Card */
.result-card {
  border-color: rgba(16, 185, 129, 0.4);
}

.result-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 14px;
}

.result-video-container {
  margin: 16px 0;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.result-video-player {
  width: 100%;
  max-height: 340px;
  display: block;
}

.result-buttons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

/* Placeholder Card */
.placeholder-card {
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--border-color);
  background: rgba(15, 23, 42, 0.3);
}

.placeholder-icon {
  color: var(--primary);
  margin-bottom: 12px;
}

.placeholder-card h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.guide-steps {
  text-align: left;
  max-width: 380px;
  margin: 0 auto 24px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
}

.features-highlight {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  margin: 0 auto;
}

.feature-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}
/* Small phones */
@media (max-width: 600px) {
  .app-header { flex-wrap: wrap; gap: 12px; }
  .logo-title { font-size: 1.25rem; }
  .step-badge { position: static; display: inline-block; margin-bottom: 10px; }
}
