:root {
  --bg-main: #07090e;
  --bg-card: rgba(16, 21, 38, 0.7);
  --bg-card-hover: rgba(23, 30, 54, 0.85);
  --bg-input: rgba(11, 15, 28, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.4);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-main: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(7, 9, 14, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
  font-size: 22px;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-free {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-left: 6px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #6d28d9);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.api-status-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.api-status-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.api-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.api-dot.connected {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Main Container */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px 24px;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero section */
.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -1px;
}

.hero h1 span.gradient {
  background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* URL Input Box */
.url-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 24px;
  transition: border-color 0.3s;
}

.url-card:focus-within {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.15);
}

.url-input-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-icon-wrap {
  position: relative;
  flex: 1;
}

.input-icon-wrap svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.url-input {
  width: 100%;
  padding: 18px 20px 18px 52px;
  font-size: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn-paste {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn-primary {
  padding: 18px 32px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, #9333ea 0%, #4f46e5 100%);
}

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

/* Video Preview Card */
.video-preview-card {
  display: none;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.video-preview-card.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.preview-thumb {
  width: 140px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.preview-details {
  flex: 1;
}

.preview-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.preview-meta {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 16px;
}

/* Settings Drawer / Accordion */
.settings-drawer {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.drawer-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-icon {
  transition: transform 0.3s ease;
}

.drawer-header.open .drawer-icon {
  transform: rotate(180deg);
}

.drawer-body {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-select, .setting-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.setting-select:focus, .setting-input:focus {
  border-color: var(--primary);
}

/* Progress Box */
.progress-card {
  display: none;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--primary-glow);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 36px;
  text-align: center;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.15);
}

.progress-card.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.progress-header {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(139, 92, 246, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-step-text {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.progress-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #8b5cf6, #06b6d4, #10b981);
  height: 100%;
  width: 5%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.progress-percentage {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Steps Indicator */
.steps-timeline {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  position: relative;
}

.timeline-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  z-index: 2;
  transition: all 0.3s ease;
}

.timeline-step.active .timeline-dot {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.timeline-step.done .timeline-dot {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

.timeline-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-align: center;
}

.timeline-step.active .timeline-label {
  color: var(--text-main);
}

/* Clips Grid */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.clip-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.clip-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 45px rgba(139, 92, 246, 0.25);
}

/* 9:16 Video Player Container */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 177.77%; /* 9:16 aspect ratio */
  background: #000;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viral-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.duration-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.clip-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.clip-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: #fff;
}

.clip-hook {
  font-size: 13px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.clip-reason {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--primary);
}

.clip-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-action {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-action:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-download {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
}

.btn-download:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-delete {
  flex: 0 0 38px;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Settings View */
.settings-container {
  max-width: 680px;
  margin: 0 auto;
}

.settings-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.api-key-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
}

.api-key-title {
  font-size: 16px;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-key-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.api-key-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  font-weight: 600;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(16, 21, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

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

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .hero h1 {
    font-size: 32px;
  }
  .url-input-group {
    flex-direction: column;
  }
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ==================== CANCEL TASK BUTTON ==================== */
.btn-cancel {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.btn-cancel:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==================== YOUTUBE VIEW STYLES ==================== */
.yt-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
}

.yt-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease;
}

.yt-card:focus-within {
  border-color: rgba(239, 68, 68, 0.4);
}

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

.yt-card-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.yt-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.yt-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.yt-guide-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.yt-connected-box {
  animation: fadeIn 0.3s ease;
}

.yt-channel-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.yt-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.yt-channel-meta {
  flex: 1;
}

.yt-channel-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.yt-channel-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.yt-status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.yt-stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.yt-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}

.yt-stat-lbl {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Switches & Toggles */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.toggle-info {
  flex: 1;
}

.toggle-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

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

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  transition: 0.3s;
  border-radius: 34px;
}

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

input:checked + .slider {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

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

/* ==================== QUEUE STYLES ==================== */
.yt-queue-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.yt-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.yt-queue-title {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-counter {
  font-size: 12px;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 800;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.queue-item-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.queue-order-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.queue-item-meta {
  flex: 1;
  min-width: 0;
}

.queue-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.queue-item-time {
  font-size: 12px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-badge-status {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.queue-badge-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.queue-badge-status.uploading {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.queue-badge-status.published {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.queue-badge-status.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-youtube-action {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-youtube-publish {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-color: #ef4444;
}

.btn-youtube-publish:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Button to add clip to YouTube from card */
.btn-queue-yt {
  background: linear-gradient(135deg, #ef4444 0%, #c2410c 100%);
  border-color: #ef4444;
}

.btn-queue-yt:hover {
  background: linear-gradient(135deg, #dc2626 0%, #9a3412 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ==================== MULTI-CHANNEL YOUTUBE STYLES ==================== */
.yt-channels-nav-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.yt-channels-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.yt-channels-nav-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.channels-count-badge {
  font-size: 11px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 800;
}

.yt-channels-pills-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.yt-channel-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  user-select: none;
}

.yt-channel-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.yt-channel-pill.active {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.yt-channel-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.yt-channel-pill.active .yt-channel-pill-avatar {
  border-color: #ef4444;
}

.yt-channel-pill-info {
  display: flex;
  flex-direction: column;
}

.yt-channel-pill-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.yt-channel-pill-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.yt-channel-pill-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-weight: 700;
  margin-left: 4px;
}

.yt-channel-external-link {
  color: var(--accent-cyan);
  font-size: 15px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.yt-channel-external-link:hover {
  opacity: 0.8;
}

.yt-channel-actions-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
}

.yt-actions-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.yt-actions-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.btn-yt-action {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  color: #fff;
}

.btn-publish-next {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-publish-next:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.btn-publish-all {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-publish-all:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  transform: translateY(-1px);
}

.btn-add-history {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.btn-add-history:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

/* ==================== MODAL DIALOGS ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.modal-clip-preview {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.modal-channels-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px;
}

.modal-channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-channel-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.modal-channel-item.selected {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.modal-channel-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.modal-channel-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.modal-channel-subs {
  font-size: 12px;
  color: var(--text-dim);
}

/* History Picker Grid inside Modal */
.history-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.history-picker-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.history-picker-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.4);
}

.history-picker-thumb {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
}

.history-picker-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== CHANNEL BASE HASHTAGS BOX ==================== */
.yt-channel-tags-box {
  margin-top: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease;
}

.yt-channel-tags-box:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.yt-channel-tags-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.yt-channel-tags-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.yt-tags-subtext {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
}

.yt-tags-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.45;
}

.yt-tags-hint code {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
}

.yt-tags-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-save-channel-tags {
  white-space: nowrap;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
}

.btn-save-channel-tags:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.btn-save-channel-tags:active {
  transform: translateY(0);
}

.yt-tags-preview {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  min-height: 24px;
}

.yt-tag-pill {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 9px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.2px;
  animation: fadeIn 0.15s ease;
}

/* Source Mode Tabs & Drag-Drop Upload */
.source-mode-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.source-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.source-mode-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.source-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(6, 182, 212, 0.25) 100%);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.25);
}

.upload-zone-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
  margin-bottom: 24px;
  transition: all 0.25s ease;
}

.drop-area {
  border: 2px dashed rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(139, 92, 246, 0.03);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.drop-area:hover, .drop-area.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  transform: scale(1.005);
}

.drop-area-icon {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.12);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.drop-area-text h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.drop-area-text p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.btn-browse-file {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 2px;
}

.btn-browse-file:hover {
  color: #38bdf8;
}

.file-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.upload-progress-box {
  margin-top: 16px;
  padding: 16px;
  background: rgba(11, 15, 28, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.upload-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.upload-file-pct {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 14px;
}

.upload-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.upload-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.upload-status-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.upload-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}


