/* ==========================================================================
   XDRIVE CLOUD DOWNLOADER - CORE DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  --bg-main: #080c15;
  --bg-card: rgba(16, 24, 40, 0.75);
  --bg-card-hover: rgba(22, 34, 56, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.25);
  
  --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --drive-gradient: linear-gradient(135deg, #4285F4 0%, #0F9D58 100%);
  --accent-purple: #8a2be2;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.18);
  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.45);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Background Ambient Glows */
.glow-bg {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: #00f2fe;
  top: -100px;
  left: 15%;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: #4facfe;
  top: 35%;
  right: -100px;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: #9d4edd;
  bottom: 50px;
  left: 10%;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography & Utilities */
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

/* Header */
.app-header {
  height: 76px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 12, 21, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.icon-plus {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.03em;
}

.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: -2px;
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-btn.active {
  color: #080c15;
  background: var(--primary-gradient);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: var(--transition);
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dark);
}

.status-pill.connected {
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
}

.status-pill.connected .status-indicator {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-pill.disconnected {
  border-color: rgba(245, 158, 11, 0.3);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

.status-pill.disconnected .status-indicator {
  background: var(--warning);
}

/* Icon Buttons */
.icon-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.primary-icon-btn {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
}

.primary-icon-btn:hover {
  background: rgba(0, 242, 254, 0.2);
}

.highlight-btn {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.35);
  color: #00f2fe;
}

.highlight-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

/* Alert Banner */
.alert-banner {
  background: rgba(16, 185, 129, 0.15);
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
  padding: 12px 20px;
  font-size: 14px;
}

.alert-banner.error {
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Hero Section */
.hero-section {
  padding: 55px 0 35px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-title {
  font-size: 44px;
  line-height: 1.18;
  margin-bottom: 18px;
}

.x-highlight {
  display: inline-block;
  padding: 0 4px;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.block-title {
  display: block;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* Search Form Box */
.search-box-wrapper {
  max-width: 780px;
  margin: 0 auto;
}

.search-form {
  display: flex;
  gap: 12px;
  background: rgba(13, 20, 36, 0.85);
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 254, 0.08);
  transition: var(--transition);
}

.search-form:focus-within {
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 242, 254, 0.25);
}

.input-container {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 14px;
  gap: 10px;
}

.input-icon {
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.url-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 15px;
  padding: 12px 0;
  font-family: inherit;
}

.url-input::placeholder {
  color: var(--text-dark);
}

.text-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: var(--transition);
}

.text-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
}

.submit-btn {
  background: var(--primary-gradient);
  color: #080c15;
  font-weight: 700;
  font-size: 15px;
  border: none;
  padding: 0 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
}

.submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.4);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #080c15;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.input-hints {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dark);
}

/* Video Preview Section */
.preview-section {
  margin: 30px 0;
  animation: fadeIn 0.4s ease;
}

.preview-card {
  padding: 28px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge, .quality-badge {
  position: absolute;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.duration-badge {
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}

.quality-badge {
  top: 10px;
  left: 10px;
  background: rgba(0, 242, 254, 0.8);
  color: #080c15;
}

.info-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.author-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.author-name {
  font-size: 18px;
  font-weight: 700;
}

.author-handle {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.author-handle:hover {
  color: var(--accent-cyan);
}

.tweet-link-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.tweet-link-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.tweet-caption {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

/* Quality Selection Pills */
.options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quality-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-pill {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 120px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: var(--transition);
}

.quality-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.quality-pill.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.pill-title {
  font-size: 14px;
  font-weight: 700;
}

.pill-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Toggle Switch */
.sync-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid rgba(66, 133, 244, 0.2);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.sync-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.sync-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.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: rgba(255, 255, 255, 0.15);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--accent-cyan);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Action Buttons Grid */
.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.full-span {
  grid-column: span 2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: 'Outfit', sans-serif;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #080c15;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.35);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-drive {
  background: var(--drive-gradient);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(66, 133, 244, 0.25);
}

.btn-drive:hover {
  box-shadow: 0 0 25px rgba(66, 133, 244, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-outline-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 12px;
  padding: 6px 14px;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Task Progress Section */
.progress-section {
  margin: 30px 0;
  animation: fadeIn 0.4s ease;
}

.progress-card {
  padding: 30px;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.task-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.spinner-pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(0, 242, 254, 0.2);
  border-top-color: var(--accent-cyan);
  animation: spin 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.task-status-title {
  font-size: 18px;
}

.task-step-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.task-percent-badge {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--accent-cyan);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  box-shadow: 0 0 14px var(--accent-cyan);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dark);
}

/* Stepper */
.task-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
}

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.step-item.active {
  color: var(--accent-cyan);
}

.step-item.active .step-dot {
  background: var(--accent-cyan);
  color: #080c15;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.step-item.completed {
  color: var(--success);
}

.step-item.completed .step-dot {
  background: var(--success);
  color: #fff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 12px;
}

.step-line.completed {
  background: var(--success);
}

/* Result Box */
.result-box {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.result-success-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.result-title {
  font-size: 20px;
  margin-bottom: 6px;
}

.result-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Features Section */
.features-section {
  padding: 60px 0;
}

.section-title {
  font-size: 28px;
  margin-bottom: 35px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-fast {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
}

.icon-drive {
  background: rgba(66, 133, 244, 0.1);
}

.icon-quality {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.feature-heading {
  font-size: 18px;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 13, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}

.history-card {
  max-width: 720px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 26px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.current-status-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.quick-login-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(66, 133, 244, 0.12);
  border: 1px solid rgba(66, 133, 244, 0.35);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

.quick-login-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}

.quick-login-text strong {
  color: #60a5fa;
}

.quick-login-text span {
  color: var(--text-muted);
  font-size: 12px;
}

.tab2-login-action {
  margin-top: 14px;
}

.full-width-btn {
  width: 100%;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-cyan);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
}

.helper-text {
  font-size: 12px;
  color: var(--text-dark);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin: 20px 0 16px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.guide-box {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.15);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.guide-box h4 {
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.guide-steps {
  padding-left: 20px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.6;
}

.guide-steps code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
  word-break: break-all;
}

.oauth-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.upload-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.02);
}

.upload-dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.04);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.service-account-section {
  margin-top: 18px;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dark);
  font-size: 14px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: var(--transition);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.history-thumb {
  width: 80px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.history-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.history-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(16, 24, 40, 0.95);
  border: 1px solid var(--border-subtle);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.info {
  border-left: 4px solid var(--accent-cyan);
}

/* Keyframes */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .hero-title {
    font-size: 32px;
  }
  
  .preview-grid {
    grid-template-columns: 1fr;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  .submit-btn {
    padding: 14px;
  }
  
  .action-buttons-grid {
    grid-template-columns: 1fr;
  }
  
  .full-span {
    grid-column: span 1;
  }
  
  .task-stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .step-line {
    display: none;
  }
}

/* ==========================================================================
   INTEGRATED VIDEO PLAYER & THUMBNAIL CUSTOMIZER STYLES
   ========================================================================== */

/* Media Mode Tabs */
.media-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.media-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.media-mode-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.media-mode-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
}

/* Video Player Wrapper */
.preview-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}

/* Play Overlay on Thumbnail */
.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 21, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.card-play-overlay:hover {
  background: rgba(8, 12, 21, 0.25);
}

.play-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.85);
  color: #080c15;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
  transition: transform 0.2s ease;
  padding-left: 4px;
}

.card-play-overlay:hover .play-circle {
  transform: scale(1.15);
  background: #00f2fe;
}

/* Thumbnail Toolbar */
.thumb-toolbar {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(13, 20, 36, 0.7);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thumb-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toolbar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.badge-status-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-status-chip.customized {
  background: rgba(16, 185, 129, 0.15);
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.4);
}

.thumb-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thumb-sec-extractor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.extractor-label {
  font-size: 12px;
  color: var(--text-muted);
}

.input-sec-sm {
  width: 65px;
  padding: 5px 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  text-align: center;
}

.btn-xs {
  padding: 5px 10px !important;
  font-size: 12px !important;
}

/* Result Video Player in completion box */
.result-player-container {
  margin: 18px 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.now-playing-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.result-video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-thumb-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Cinema Modal in Main Page */
.cinema-card {
  max-width: 900px;
  width: 95%;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cinema-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.cinema-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cinema-video-screen {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.cinema-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cinema-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Clear URL Button */
.clear-url-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-url-btn:hover {
  color: #fff;
  transform: scale(1.15);
}

/* Quick Sec Chips */
.quick-sec-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.sec-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sec-chip:hover {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-1px);
}


/* Extension Modal Styles */
.extension-card {
  max-width: 560px;
}

.extension-modal-body {
  padding: 20px;
}

.extension-intro {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.extension-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.extension-step-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.extension-step-title {
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  font-size: 13px;
}

.extension-step-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.extension-step-desc-code {
  margin-bottom: 6px;
}

.extension-code-inline {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  -webkit-user-select: all;
  user-select: all;
}

.extension-path-box {
  background: #060913;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  color: #38bdf8;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}

.extension-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-extension-zip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 18px;
}

/* ==========================================================================
   MODE SWITCHER (SINGLE VS BATCH)
   ========================================================================== */
.mode-switcher-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 20px auto;
  padding: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  width: fit-content;
  max-width: 90%;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.mode-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab-btn.active {
  background: var(--primary-gradient);
  color: #040914;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.35);
  font-weight: 700;
}

.mode-tab-btn.active svg {
  stroke: #040914;
}

.badge-pill-new {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: #ff3366;
  color: #fff;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.mode-tab-btn.active .badge-pill-new {
  background: #040914;
  color: #00f2fe;
}

/* ==========================================================================
   BATCH DOWNLOAD FORM STYLES
   ========================================================================== */
.batch-download-box {
  width: 100%;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.batch-input-card {
  background: rgba(16, 24, 40, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.batch-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.batch-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-icon {
  font-size: 18px;
}

.batch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.batch-counter-badge {
  font-size: 12px;
  font-weight: 600;
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.batch-textarea-wrapper {
  position: relative;
  width: 100%;
}

.batch-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 320px;
  resize: vertical;
  background: #080d1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px;
  color: #f1f5f9;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  transition: var(--transition);
}

.batch-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.22);
  background: #090f20;
}

.batch-quick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-left-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.batch-mini-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.batch-text-btn {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.batch-text-btn:hover {
  background: rgba(0, 242, 254, 0.1);
  text-decoration: underline;
}

.batch-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .batch-options-grid {
    grid-template-columns: 1fr;
  }
}

.batch-opt-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.batch-opt-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.batch-select {
  background: #090e1c;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.batch-select:focus {
  border-color: var(--accent-cyan);
}

.batch-drive-toggle-col {
  justify-content: center;
}

.switch-control-sm {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.switch-control-sm input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-sm {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background-color: #334155;
  transition: .3s;
  border-radius: 22px;
}

.slider-sm:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.switch-control-sm input:checked + .slider-sm {
  background: var(--drive-gradient);
}

.switch-control-sm input:checked + .slider-sm:before {
  transform: translateX(16px);
}

.switch-text-sm {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.batch-submit-row {
  display: flex;
  justify-content: center;
}

.batch-start-btn {
  width: 100%;
  max-width: 450px;
  font-size: 15px;
  padding: 14px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ==========================================================================
   BATCH DASHBOARD & TASK PROGRESS
   ========================================================================== */
.batch-dashboard-section {
  margin: 35px auto 45px auto;
  max-width: 980px;
  animation: fadeIn 0.4s ease-out;
}

.batch-dashboard-card {
  padding: 28px;
  background: rgba(16, 24, 40, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.batch-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.batch-dash-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.batch-status-icon-animated {
  font-size: 32px;
  animation: float 2.5s ease-in-out infinite;
}

.batch-dash-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.batch-dash-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.batch-dash-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.btn-primary-outline {
  background: transparent;
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary-outline:hover {
  background: rgba(0, 242, 254, 0.12);
}

.batch-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 640px) {
  .batch-stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.batch-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
}

.batch-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.batch-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.batch-stat-card.stat-downloading .batch-stat-value {
  color: var(--accent-cyan);
}

.batch-stat-card.stat-completed .batch-stat-value {
  color: var(--success);
}

.batch-stat-card.stat-error .batch-stat-value {
  color: var(--danger);
}

.batch-overall-progress {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.batch-overall-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.batch-progress-pct {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* ==========================================================================
   BATCH TASKS LIST & TASK CARDS
   ========================================================================== */
.batch-tasks-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.batch-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

.batch-task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(9, 14, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: var(--transition);
}

.batch-task-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
  background: rgba(14, 22, 42, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.batch-task-card.is-completed {
  border-left: 4px solid var(--success);
}

.batch-task-card.is-downloading {
  border-left: 4px solid var(--accent-cyan);
}

.batch-task-card.is-error {
  border-left: 4px solid var(--danger);
  opacity: 0.85;
}

.batch-task-card.is-cancelled {
  border-left: 4px solid var(--text-dark);
  opacity: 0.65;
}

.batch-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.batch-card-thumb-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-card-meta {
  min-width: 0;
  flex: 1;
}

.batch-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.batch-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.batch-card-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.batch-card-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.batch-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.batch-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.pill-queued {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.pill-downloading {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
}

.pill-uploading {
  background: rgba(66, 133, 244, 0.2);
  color: #60a5fa;
}

.pill-completed {
  background: rgba(16, 185, 129, 0.18);
  color: var(--success);
}

.pill-error {
  background: rgba(239, 68, 68, 0.18);
  color: var(--danger);
}

.pill-cancelled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dark);
}

.batch-card-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-item-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.batch-item-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}

.batch-item-btn.btn-drive-item:hover {
  background: rgba(66, 133, 244, 0.25);
  border-color: #4285f4;
}

.batch-item-btn.btn-cancel-item:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #f87171;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}


/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (UI/UX OPTIMIZATIONS)
   ========================================================================== */

/* Universal Touch & Ergonomics */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  touch-action: manipulation;
}

/* Tactile Active Feedback for Touch */
button:active,
.btn:active,
.mode-tab-btn:active,
.batch-mini-btn:active,
.batch-item-btn:active,
.sec-chip:active,
.quality-pill:active,
.mobile-nav-item:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* Prevent iOS Safari input auto-zoom */
@media (max-width: 768px) {
  input,
  select,
  textarea,
  .url-input,
  .batch-textarea,
  .batch-select,
  .input-sec-sm,
  .thumb-sec-input {
    font-size: 16px !important;
  }
}

/* Tablet & Intermediate Screens (<= 900px) */
@media (max-width: 900px) {
  .hero-title {
    font-size: 34px;
  }
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet & Large Mobile (<= 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .hero-title {
    font-size: 28px;
  }
  .hero-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .search-form {
    flex-direction: column;
  }
  .submit-btn {
    width: 100%;
    height: 48px;
    justify-content: center;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Mobile Devices & Phones (<= 640px) */
@media (max-width: 640px) {
  /* Safe Area & Bottom Nav Padding */
  .main-content {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
  }

  /* Compact Sticky Mobile App Bar */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 80;
    height: auto;
    padding: 10px 0;
    background: rgba(8, 12, 21, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-container {
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .logo-group {
    gap: 8px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 17px;
  }

  .brand-tag {
    display: none; /* Hide secondary tag on mobile to save space */
  }

  .nav-links {
    display: none; /* Handled smoothly by bottom nav bar */
  }

  .header-actions {
    gap: 6px;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 11px;
    gap: 5px;
    height: 32px;
  }

  .status-pill span:not(.status-indicator) {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Hide desktop icon buttons from top header; they are now in the bottom bar or modal */
  #open-history-btn,
  #open-settings-btn {
    display: none;
  }

  .header-actions .highlight-btn {
    padding: 5px 8px;
    font-size: 11px;
    height: 32px;
    gap: 4px;
  }

  .header-actions .highlight-btn span {
    display: inline;
  }

  /* Hero Section */
  .hero-section {
    padding: 18px 0 10px 0;
  }

  .hero-badge {
    font-size: 11px;
    padding: 4px 12px;
    margin-bottom: 14px;
    line-height: 1.4;
    white-space: normal;
  }

  .hero-title {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 0 6px;
  }

  /* Segmented Mode Switcher Tabs */
  .mode-switcher-container {
    width: 100%;
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    margin-bottom: 18px;
  }

  .mode-tab-btn {
    flex: 1;
    padding: 9px 8px;
    font-size: 12px;
    justify-content: center;
    border-radius: var(--radius-full);
    gap: 5px;
  }

  .mode-tab-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .badge-pill-new {
    display: none;
  }

  /* Search & Form Elements */
  .search-form {
    padding: 6px;
    border-radius: var(--radius-md);
    gap: 8px;
  }

  .input-container {
    padding: 0 8px;
    gap: 6px;
  }

  .url-input {
    padding: 12px 0;
  }

  .text-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .submit-btn {
    width: 100%;
    height: 50px;
    font-size: 15px;
    border-radius: var(--radius-md);
  }

  .input-hints {
    font-size: 11px;
    margin-top: 10px;
  }

  /* Preview Card */
  .preview-card {
    padding: 16px 14px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .media-mode-tabs {
    width: 100%;
  }

  .media-mode-btn {
    flex: 1;
    justify-content: center;
    padding: 8px;
    font-size: 12px;
  }

  .thumb-toolbar {
    padding: 12px;
    margin-top: 10px;
  }

  .thumb-toolbar-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .thumb-toolbar-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 11px;
    padding: 7px 8px;
  }

  .thumb-sec-extractor {
    margin-top: 10px;
  }

  .quick-sec-chips {
    flex-wrap: wrap;
    gap: 4px;
  }

  .sec-chip {
    padding: 4px 8px;
    font-size: 11px;
  }

  .author-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .tweet-link-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  .tweet-caption {
    font-size: 13px;
    padding: 10px 12px;
  }

  /* Quality Selector Pills */
  .quality-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .quality-pill {
    min-width: 0;
    padding: 8px 10px;
  }

  .quality-res {
    font-size: 13px;
  }

  .quality-meta {
    font-size: 10px;
  }

  .sync-option-card {
    padding: 12px;
    gap: 10px;
  }

  .sync-label {
    font-size: 13px;
  }

  .sync-desc {
    font-size: 11px;
  }

  .action-buttons-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .action-buttons-grid .btn {
    width: 100%;
    height: 48px;
    font-size: 14px;
    justify-content: center;
  }

  #btn-download-both {
    order: -1;
    height: 52px;
    font-size: 15px;
    font-weight: 700;
  }

  /* Batch Downloader Card */
  .batch-input-card {
    padding: 16px 14px;
  }

  .batch-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 10px;
  }

  .batch-counter-badge {
    align-self: flex-start;
  }

  .batch-textarea {
    min-height: 100px;
    padding: 10px;
  }

  .batch-quick-toolbar {
    margin-bottom: 14px;
    gap: 6px;
  }

  .batch-left-tools {
    flex-wrap: wrap;
    gap: 6px;
  }

  .batch-mini-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .batch-options-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .batch-start-btn {
    height: 48px;
    font-size: 14px;
    max-width: 100%;
  }

  /* Batch Dashboard */
  .batch-dashboard-card {
    padding: 16px 14px;
  }

  .batch-dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .batch-dash-actions {
    width: 100%;
    gap: 6px;
  }

  .batch-dash-actions button {
    flex: 1;
    justify-content: center;
    padding: 7px 8px;
    font-size: 11px;
  }

  .batch-stat-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

  .batch-stat-card {
    padding: 8px 10px;
  }

  .batch-stat-value {
    font-size: 20px;
  }

  .batch-task-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .batch-card-left {
    width: 100%;
    gap: 10px;
  }

  .batch-card-thumb-wrap {
    width: 48px;
    height: 48px;
  }

  .batch-card-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* Progress & Result */
  .progress-card {
    padding: 18px 14px;
  }

  .task-status-title {
    font-size: 16px;
  }

  .task-step-desc {
    font-size: 12px;
  }

  .progress-stats-row {
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
  }

  .task-stepper {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .step-line {
    display: none;
  }

  .step-item {
    gap: 10px;
    font-size: 12px;
  }

  .result-box {
    margin-top: 20px;
    padding-top: 18px;
  }

  .result-actions {
    flex-direction: column;
    gap: 10px;
  }

  .result-actions .btn {
    width: 100%;
    height: 46px;
    justify-content: center;
  }

  /* Mobile Bottom Sheet for Modals */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    z-index: 150;
  }

  .modal-card {
    border-radius: 24px 24px 0 0;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
    animation: slideUpSheet 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  }

  .modal-card::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: -8px auto 14px auto;
  }

  .modal-header {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .modal-title-group h3 {
    font-size: 16px;
  }

  .close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-size: 20px;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .history-thumb {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-sm);
  }

  .history-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .history-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 7px 10px;
  }

  /* Toast Notification on Mobile */
  .toast-container {
    bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    right: 14px;
    align-items: center;
  }

  .toast {
    width: 100%;
    justify-content: center;
  }
}

/* Very Small Mobile Screens (<= 400px, e.g. iPhone SE, Galaxy Fold cover) */
@media (max-width: 400px) {
  .hero-title {
    font-size: 21px;
  }
  .quality-pills {
    grid-template-columns: 1fr;
  }
  .batch-stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .batch-stat-card {
    padding: 6px 8px;
  }
  .batch-stat-value {
    font-size: 17px;
  }
  .header-actions .highlight-btn span {
    display: none; /* Icon only on ultra narrow screens */
  }
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(8, 12, 21, 0.94);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
    z-index: 95;
  }

  .mobile-nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: var(--transition);
  }

  .mobile-nav-item.active {
    color: var(--accent-cyan);
  }

  .mobile-nav-item.active .mobile-nav-icon svg {
    stroke: var(--accent-cyan);
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.6));
  }

  .mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
}

@keyframes slideUpSheet {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
