:root {
  --bg-dark: #27354f;
  --bg-card: rgba(53, 72, 107, 0.85);
  --bg-card-hover: rgba(64, 86, 126, 0.92);
  --bg-input: rgba(38, 52, 79, 0.95);
  --border-color: rgba(255, 255, 255, 0.25);
  --border-focus: #a5b4fc;
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --accent-primary: #a5b4fc;
  --accent-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  --accent-glow: rgba(165, 180, 252, 0.55);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.28);
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: clip;
  position: relative;
  padding: 2rem 1rem;
}

/* Background Ambient Orbs - Luminous Vibrant Glow */
.bg-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.65;
  animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 550px;
  height: 550px;
  background: #818cf8;
  top: -100px;
  left: -80px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: #d8b4fe;
  bottom: -150px;
  right: -80px;
  animation-delay: -7s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: #f472b6;
  top: 35%;
  left: 55%;
  animation-delay: -14s;
  opacity: 0.45;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}

/* Master Page Wrapper with Side Ads */
.page-wrapper {
  width: 100%;
  max-width: 1360px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2.25rem;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

/* Sidebar Ad Columns */
.ad-sidebar {
  width: 160px;
  min-width: 160px;
  position: sticky;
  top: max(1.5rem, calc(50vh - 300px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 10;
  align-self: flex-start;
}

.ad-left {
  /* 160x600 banner */
  min-height: 600px;
}

.ad-card {
  width: 160px;
  background: rgba(53, 72, 107, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.ad-content-160x600 {
  width: 160px;
  height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-leaderboard-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -0.25rem 0 0.25rem 0;
}

.ad-card-728x90 {
  width: 728px;
  max-width: 100%;
  height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* Layout */
.app-container {
  width: 100%;
  max-width: 860px;
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header */
.app-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.logo-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  white-space: nowrap;
}

.logo-badge {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.4rem 1.15rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.logo-badge .logo-icon {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-badge .logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.logo-icon {
  width: 46px;
  height: 46px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--accent-glow);
  flex-shrink: 0;
}

.logo-icon svg {
  width: 26px;
  height: 26px;
  stroke: white;
}

.logo-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  line-height: 1.5;
}

/* Glass Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  transition: border-color 0.3s ease;
}

/* Batch Input Section */
.batch-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.batch-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input-label svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-primary);
}

.input-actions-top {
  display: flex;
  gap: 0.5rem;
}

/* Universal Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  white-space: nowrap;
  line-height: 1.2;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.btn:hover svg {
  transform: scale(1.05);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(40%);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

/* Primary Button (Glowing Gradient) */
.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(165, 180, 252, 0.7);
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* Secondary Button (Glass Outline) */
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

/* Large Button */
.btn-large {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  font-weight: 700;
}

.btn-large svg {
  width: 20px;
  height: 20px;
}

/* Small Button */
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

/* Icon-Only Button */
.btn-icon-only {
  padding: 0.4rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Danger Button */
.btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.batch-input-container textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 80px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.batch-input-container textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.batch-button-row {
  display: flex;
  justify-content: flex-end;
}

/* Options Grid & Custom Select */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-item label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--accent-primary);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.select-wrapper select,
#quality-select {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 2.25rem 0 1rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.select-wrapper select:focus,
#quality-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.select-wrapper select option,
#quality-select option {
  background: #27354f;
  color: #ffffff;
  padding: 8px 12px;
}

.save-folder-btn {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary) !important;
  font-size: 0.88rem;
  justify-content: flex-start;
  padding: 0 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  gap: 0.6rem;
}

.save-folder-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.15);
}

.save-folder-btn.active-dir {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399 !important;
}

.save-folder-btn.active-dir svg {
  stroke: #34d399;
}

.status-badge-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ad-splicer-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
  color: #34d399;
  font-weight: 500;
  height: 42px;
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-dot-red {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulseRed 1s infinite;
}

@keyframes pulseRed {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Capturer Active Deck */
.capturer-deck {
  background: rgba(38, 52, 79, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease;
}

.deck-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.capture-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.capture-live-indicator .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
}

.capture-live-indicator.status-recording {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.capture-live-indicator.status-recording .live-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseRed 1s infinite;
}

.capture-live-indicator.status-ad_paused {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.capture-live-indicator.status-ad_paused .live-dot {
  background: #f59e0b;
}

.capture-live-indicator.status-encoding {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.capture-live-indicator.status-encoding .live-dot {
  background: #8b5cf6;
}

.capture-live-indicator.status-downloaded {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.capture-live-indicator.status-downloaded .live-dot {
  background: #10b981;
}

.deck-track-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.current-track-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.current-track-channel {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Embedded YouTube Player Framing */
.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 220px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-wrapper iframe, .player-wrapper #yt-player-container {
  width: 100%;
  height: 100%;
  border: none;
}

.player-shield {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: transparent;
  cursor: default;
}

.ad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeIn 0.25s ease;
}

.ad-overlay-content {
  text-align: center;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ad-overlay-content h4 {
  font-size: 1.1rem;
  color: #fbbf24;
}

.ad-overlay-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 280px;
}

.spinner-ad {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.25rem;
}

/* Capture Progress & Visualizer */
.capture-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.capture-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.visualizer-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.visualizer-bars .bar {
  width: 3px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: height 0.1s ease, background-color 0.2s ease;
}

.visualizer-bars.active .bar {
  background: var(--accent-primary);
  animation: wave 0.8s ease-in-out infinite alternate;
}

.visualizer-bars.active .bar:nth-child(1) { animation-delay: 0.0s; }
.visualizer-bars.active .bar:nth-child(2) { animation-delay: 0.15s; }
.visualizer-bars.active .bar:nth-child(3) { animation-delay: 0.3s; }
.visualizer-bars.active .bar:nth-child(4) { animation-delay: 0.45s; }
.visualizer-bars.active .bar:nth-child(5) { animation-delay: 0.2s; }
.visualizer-bars.active .bar:nth-child(6) { animation-delay: 0.35s; }
.visualizer-bars.active .bar:nth-child(7) { animation-delay: 0.1s; }

@keyframes wave {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* Deck Controls */
.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}



/* Queue List Section */
.queue-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideUp 0.3s ease;
}

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

.queue-title-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.queue-title-badge svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-primary);
}

.queue-title-badge h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.queue-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.queue-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(38, 52, 79, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  transition: all 0.25s ease;
}

.queue-card:hover {
  background: rgba(38, 52, 79, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.queue-card.active-track {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 12px var(--accent-glow);
}

.queue-card-index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  font-weight: 600;
}

.queue-card-thumb {
  width: 60px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.queue-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.queue-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.queue-card-channel {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.queue-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-card-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge-queued {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.badge-recording {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.badge-encoding {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

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

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.queue-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  height: 145px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111;
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

.preview-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.video-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.meta-dot {
  color: var(--text-muted);
}

/* SponsorBlock Box */
.sponsor-info-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sponsor-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #34d399;
}

.sponsor-header svg {
  width: 16px;
  height: 16px;
}

.sponsor-desc {
  font-size: 0.78rem;
  color: #a7f3d0;
}

.segments-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.segment-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.preview-actions {
  margin-top: 0.5rem;
}

/* Progress Section */
.progress-section {
  animation: slideUp 0.4s ease;
}

.progress-card {
  background: rgba(38, 52, 79, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-percent {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent-primary);
}

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

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  box-shadow: 0 0 12px var(--accent-glow);
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Result Section */
.result-section {
  animation: slideUp 0.4s ease;
}

.result-card {
  background: rgba(38, 52, 79, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
}

.success-badge svg {
  width: 18px;
  height: 18px;
}

.result-title {
  font-size: 1.35rem;
  font-weight: 700;
  max-width: 90%;
}

.result-filesize {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.audio-player-container {
  width: 100%;
  max-width: 520px;
  margin: 0.5rem 0;
}

.audio-player-container audio {
  width: 100%;
  height: 46px;
  border-radius: var(--radius-sm);
  outline: none;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Features Footer */
.app-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-item {
  background: rgba(53, 72, 107, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.feature-icon {
  font-size: 1.4rem;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feature-text strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.feature-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Bottom Center Legal Footer & Disclaimers */
.app-footer {
  margin-top: 2rem;
  padding: 1.75rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-mission-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 500;
  max-width: 680px;
}

.footer-warning-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 680px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.footer-links a:hover,
.footer-links a.active {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

.footer-dot {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Legal Pages Styling */
.legal-container {
  max-width: 780px;
}

.legal-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  animation: fadeIn 0.4s ease;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legal-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-section p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.legal-section ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-section li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.legal-section strong {
  color: var(--text-primary);
}

.legal-warning-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.legal-warning-box h2 {
  color: #fca5a5;
}

.legal-warning-box p {
  color: #fecaca;
}

.legal-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.contact-email-link {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.contact-email-link:hover {
  color: #a5b4fc;
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

/* Responsive & Mobile-Friendly Styles */
@media (max-width: 1240px) {
  .ad-sidebar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .main-layout {
    padding: 1.25rem 0.85rem;
    gap: 1.25rem;
  }

  .app-container {
    max-width: 100%;
    gap: 1.25rem;
  }

  .glass-panel {
    padding: 1.25rem;
  }

  /* Ads on Mobile */
  .ad-leaderboard-container,
  .ad-sidebar {
    display: none !important;
  }

  /* Header & Logo */
  .logo-title {
    font-size: 1.7rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .logo-icon svg {
    width: 22px;
    height: 22px;
  }

  .tagline {
    font-size: 0.88rem;
  }

  /* Options Bar & Controls */
  .options-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .options-left {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
  }

  .custom-select-wrapper,
  .custom-select-trigger,
  .save-folder-btn {
    width: 100%;
    min-height: 44px;
  }

  .save-folder-btn {
    justify-content: center;
  }

  #add-queue-btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  /* Capturer Deck & Player */
  .capturer-deck {
    padding: 1.15rem;
    gap: 1rem;
  }

  .deck-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .player-wrapper {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .deck-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.65rem;
  }

  .deck-controls .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  /* Queue List & Cards */
  .queue-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .queue-card {
    padding: 0.75rem;
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  .queue-card-thumb {
    width: 52px;
    height: 38px;
    flex-shrink: 0;
  }

  .queue-card-info {
    flex: 1 1 calc(100% - 95px);
  }

  .queue-card-title {
    font-size: 0.88rem;
  }

  .queue-card-meta {
    flex: 1 0 auto;
    justify-content: flex-start;
  }

  .queue-card-actions {
    margin-left: auto;
  }

  /* Features Grid */
  .app-features {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Footer & Legal */
  .footer-mission-banner {
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.85rem;
  }

  .footer-dot {
    display: none;
  }

  .footer-links a {
    padding: 0.35rem 0.5rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .legal-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .main-layout {
    padding: 0.85rem 0.5rem;
  }

  .glass-panel {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .capturer-deck {
    padding: 0.95rem 0.75rem;
  }

  .logo-title {
    font-size: 1.45rem;
  }

  .logo-wrapper {
    gap: 0.6rem;
  }

  .batch-input-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .input-actions-top {
    width: 100%;
    justify-content: flex-end;
  }

  .current-track-title {
    font-size: 1.05rem;
  }
}
