/* ==========================================================================
   YTStream Pro - Master Stylesheet
   Modern Glassmorphism Design System & Ultra-Responsive Layout
   (Mobile First & Fluid Breakpoints: Phone, Tablet, Laptop, Desktop)
   ========================================================================== */

:root {
  /* Color Palette - Deep Midnight Glow */
  --bg-dark: #060813;
  --bg-dark-secondary: #0c1024;
  --card-bg: rgba(16, 22, 46, 0.72);
  --card-bg-hover: rgba(24, 32, 64, 0.82);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-border-glow: rgba(129, 140, 248, 0.45);

  /* Vibrant Accent Gradients */
  --accent-gradient: linear-gradient(135deg, #ff3b30 0%, #ff007a 50%, #7928ca 100%);
  --accent-cyan-purple: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6366f1 100%);
  --btn-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #9333ea 100%);
  --btn-gradient-hover: linear-gradient(135deg, #fb7185 0%, #f43f5e 50%, #a855f7 100%);

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Status Colors */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transitions & Shadows */
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(22px);
  --box-shadow-card: 0 12px 40px -12px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page Layout Wrapper */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Ambient Floating Background Glows
   ========================================================================== */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: floatAmbient 18s ease-in-out infinite alternate;
}

.glow-1 {
  width: clamp(260px, 45vw, 500px);
  height: clamp(260px, 45vw, 500px);
  background: radial-gradient(circle, rgba(244, 63, 94, 0.35) 0%, transparent 70%);
  top: -80px;
  right: -60px;
}

.glow-2 {
  width: clamp(300px, 50vw, 550px);
  height: clamp(300px, 50vw, 550px);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  top: 35%;
  left: -100px;
  animation-delay: -6s;
}

.glow-3 {
  width: clamp(250px, 40vw, 450px);
  height: clamp(250px, 40vw, 450px);
  background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, transparent 70%);
  bottom: 0px;
  right: 10%;
  animation-delay: -12s;
}

@keyframes floatAmbient {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, 30px) scale(1.06); }
  100% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ==========================================================================
   Glassmorphism Surfaces
   ========================================================================== */
.glassmorphism {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  box-shadow: var(--box-shadow-card);
}

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 8, 19, 0.75);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--btn-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #fb7185 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 20px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  display: inline-block;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--status-success);
  animation: pulseDot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 1.5rem);
  width: 100%;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  text-align: center;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 30px;
  color: #a5b4fc;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  font-weight: 600;
  margin-bottom: 1.25rem;
  animation: fadeInDown 0.6s ease-out;
}

.badge-pill i {
  color: #fbbf24;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 5.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.75px;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  max-width: 640px;
  margin: 0 auto clamp(1.5rem, 3vw, 2.25rem);
  padding: 0 0.5rem;
}

/* ==========================================================================
   Search / Input Card
   ========================================================================== */
.search-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 0.65rem;
  border-radius: 18px;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  transition: var(--transition-smooth);
}

.search-card:focus-within {
  border-color: var(--card-border-glow);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(7, 10, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.3rem 0.75rem;
  gap: 0.6rem;
  position: relative;
  min-width: 0; /* Prevents flex children from overflowing */
}

.input-icon {
  color: var(--text-dim);
  font-size: 1rem;
  flex-shrink: 0;
}

#yt-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-family: var(--font-body);
  padding: 0.55rem 0;
  min-width: 0;
  width: 100%;
}

#yt-url-input::placeholder {
  color: var(--text-dim);
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

.icon-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  min-height: 34px;
}

.icon-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.icon-action-btn:active {
  transform: scale(0.96);
}

/* Primary Button */
.primary-btn {
  background: var(--btn-gradient);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 46px;
  -webkit-tap-highlight-color: transparent;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(244, 63, 94, 0.45);
  background: var(--btn-gradient-hover);
}

.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

.primary-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Quick Features / Tags */
.quick-features {
  display: flex;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  padding: 0 0.5rem;
}

.feature-tag {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.feature-tag i {
  color: #38bdf8;
}

/* ==========================================================================
   Result Section (Video Overview & Formats)
   ========================================================================== */
.result-section {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  animation: fadeInUp 0.45s ease-out forwards;
}

.result-card {
  border-radius: 20px;
  padding: clamp(1.25rem, 3.5vw, 2rem);
  overflow: hidden;
}

/* Video Overview */
.video-overview {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(1.25rem, 3vw, 1.75rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.thumbnail-wrapper {
  position: relative;
  width: 290px;
  min-width: 290px;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background: #000;
  flex-shrink: 0;
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.thumbnail-wrapper:hover img {
  transform: scale(1.03);
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.platform-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #fff;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.badge-youtube {
  background: rgba(225, 29, 72, 0.85);
  border: 1px solid rgba(244, 63, 94, 0.5);
}

.badge-tiktok {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.85) 0%, rgba(244, 63, 94, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.badge-tiktok-tag {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.tag-tiktok i {
  color: #00f2fe !important;
}

.tag-youtube i {
  color: #f43f5e !important;
}

.thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.thumbnail-wrapper:hover .thumbnail-overlay {
  opacity: 1;
}

.thumbnail-overlay i {
  font-size: 2.2rem;
  color: #fff;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.video-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.video-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.video-meta {
  display: flex;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.meta-item i {
  color: #818cf8;
}

/* Tabs */
.tabs-container {
  display: flex;
  gap: 0.5rem;
  background: rgba(9, 13, 28, 0.7);
  padding: 0.3rem;
  border-radius: 12px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(0.825rem, 2vw, 0.9rem);
  padding: 0.55rem 1.15rem;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition-smooth);
  min-height: 38px;
  -webkit-tap-highlight-color: transparent;
}

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

.tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-btn:active {
  transform: scale(0.97);
}

/* Format Selection Grid */
.format-selection-area {
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.formats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.format-card {
  background: rgba(10, 15, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  transition: var(--transition-smooth);
}

.format-card:hover {
  background: var(--card-bg-hover);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.format-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.format-quality {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.format-tag-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-fhd {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-hd {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-sd {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.badge-audio {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.format-ext {
  font-size: 0.725rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.format-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.download-action-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.download-action-btn:hover {
  background: var(--btn-gradient);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.35);
}

.download-action-btn:active {
  transform: scale(0.98);
}

.download-action-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Download Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  max-width: 460px;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 3.5vw, 2rem);
  border-radius: 20px;
  text-align: center;
}

.modal-icon {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(244, 63, 94, 0.2);
  border-top-color: #f43f5e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.download-icon-pulse {
  font-size: 1.6rem;
  color: #fb7185;
  animation: pulseIcon 1.5s infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.modal-desc {
  color: var(--text-muted);
  font-size: clamp(0.825rem, 2vw, 0.9rem);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.progress-bar-container {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.35rem;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--btn-gradient);
  border-radius: 10px;
  transition: width 0.3s ease, background 0.3s ease;
}

.progress-bar-fill.indeterminate {
  width: 50%;
  animation: indeterminateBar 1.5s infinite ease-in-out;
}

@keyframes indeterminateBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.modal-actions {
  display: flex;
  justify-content: center;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  min-height: 40px;
}

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

.secondary-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Feature Showcase Grid
   ========================================================================== */
.features-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.feature-box {
  padding: clamp(1.25rem, 3vw, 1.85rem);
  border-radius: 18px;
  transition: var(--transition-smooth);
}

.feature-box:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
}

.box-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
}

.icon-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

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

.icon-pink {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.feature-box h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.feature-box p {
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2vw, 0.925rem);
  line-height: 1.55;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.5rem);
  padding-bottom: calc(clamp(1.75rem, 4vw, 2.5rem) + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  text-align: center;
  background: rgba(4, 7, 18, 0.85);
}

.footer-content {
  max-width: 580px;
  margin: 0 auto;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.65rem;
}

.footer-brand i {
  color: #f43f5e;
}

.disclaimer {
  color: var(--text-dim);
  font-size: clamp(0.725rem, 1.8vw, 0.8rem);
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.copyright {
  color: var(--text-muted);
  font-size: clamp(0.725rem, 1.8vw, 0.8rem);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  max-width: 380px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(14, 20, 40, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideToast 0.3s ease-out;
  line-height: 1.4;
}

.toast-error {
  border-left: 4px solid var(--status-danger);
}
.toast-error i {
  color: var(--status-danger);
}

.toast-success {
  border-left: 4px solid var(--status-success);
}
.toast-success i {
  color: var(--status-success);
}

.toast-info {
  border-left: 4px solid #38bdf8;
}
.toast-info i {
  color: #38bdf8;
}

/* ==========================================================================
   Utility Classes & Animations
   ========================================================================== */
.hidden {
  display: none !important;
}

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

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

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

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

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet View (Max 1024px) */
@media (max-width: 1024px) {
  .main-content {
    padding: 2rem 1.25rem;
  }

  .video-overview {
    gap: 1.5rem;
  }

  .thumbnail-wrapper {
    width: 260px;
    min-width: 260px;
  }

  .formats-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Tablet Portrait & Large Phones (Max 840px) */
@media (max-width: 840px) {
  .navbar {
    padding: 0.85rem 1.25rem;
  }

  .video-overview {
    flex-direction: column;
    align-items: stretch;
  }

  .thumbnail-wrapper {
    width: 100%;
    min-width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .video-details {
    margin-top: 1.25rem;
  }

  .tabs-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab-btn {
    width: 100%;
  }

  .features-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Devices (Max 640px) */
@media (max-width: 640px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .brand-badge {
    display: none; /* Keep header clean on small screens */
  }

  .status-indicator span.status-text {
    display: none; /* Show only dot on phone */
  }

  .main-content {
    padding: 1.25rem 0.85rem;
  }

  .search-card {
    flex-direction: column;
    padding: 0.55rem;
    gap: 0.55rem;
  }

  .input-wrapper {
    width: 100%;
    padding: 0.35rem 0.65rem;
  }

  .primary-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  .quick-features {
    gap: 0.5rem 0.85rem;
  }

  .feature-tag {
    font-size: 0.75rem;
  }

  .result-card {
    padding: 1.15rem 0.9rem;
    border-radius: 16px;
  }

  .thumbnail-wrapper {
    max-width: 100%;
    border-radius: 12px;
  }

  .video-meta {
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .formats-grid {
    grid-template-columns: 1fr; /* Single column card stack for perfect mobile reading */
    gap: 0.85rem;
  }

  .format-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .features-showcase {
    grid-template-columns: 1fr;
    margin-top: 2.25rem;
    gap: 1rem;
  }

  .feature-box {
    padding: 1.25rem 1rem;
    border-radius: 14px;
  }

  /* Modal on Mobile */
  .modal-backdrop {
    padding: 1rem;
  }

  .modal-card {
    padding: 1.5rem 1.15rem;
    border-radius: 18px;
  }

  .modal-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 1rem;
  }

  /* Toast notification on mobile sticks to bottom full width */
  .toast-container {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
  }

  .toast {
    padding: 0.75rem 1rem;
    font-size: 0.825rem;
  }
}

/* Small Phone Screens (Max 380px, e.g. iPhone SE) */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .icon-action-btn span {
    display: none; /* Show only paste icon on extra small screens */
  }

  .format-quality {
    font-size: 1rem;
  }
}
