/* ========================================
   VidDownload — Premium Video Downloader UI
   ======================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 58, 237, 0.3);

  --text-primary: #f0f0f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-purple: #7C3AED;
  --accent-pink: #EC4899;
  --accent-blue: #3B82F6;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-orange: #F59E0B;

  --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  --gradient-secondary: linear-gradient(135deg, #3B82F6 0%, #7C3AED 100%);
  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-width: 260px;
  --header-height: 64px;
  --footer-height: 48px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

input, textarea {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0; /* iOS Safari default radius fix */
  opacity: 1; /* iOS Safari disabled opacity fix */
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
  /* Android Chrome backdrop-filter paste menu bug fixes */
  position: relative;
  z-index: 10;
}

input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  transform: translateZ(0);
}

/* --- Animated Background --- */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-bg);
  z-index: 0;
  pointer-events: none;
}

.bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(124, 58, 237, 0.3);
  border-radius: 50%;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* --- Container --- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  max-width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Hamburger Button --- */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  padding: 0;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-purple);
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Logo --- */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-smooth);
}

.logo:hover .logo-icon {
  transform: scale(1.1) rotate(-5deg);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* --- Pro Badge --- */
.pro-badge {
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid var(--accent-purple);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pro-badge .status-dot {
  background: var(--accent-purple);
  animation: pulse-dot 2s infinite;
}

/* --- Profile Avatar --- */
.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent-purple);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
  object-fit: cover;
  display: block;
  margin: 0 auto 20px;
  transition: transform var(--transition-normal);
}
.profile-avatar:hover {
  transform: scale(1.05);
}


.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--accent-green);
}

.status-dot.offline {
  background: var(--accent-red);
  animation: none;
}

/* --- Pro Avatar Ring (Gemini-style) --- */
.pro-avatar-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(
    #7C3AED, #EC4899, #3B82F6, #10B981, #F59E0B, #7C3AED
  );
  animation: avatar-ring-spin 3s linear infinite;
  flex-shrink: 0;
}
.pro-avatar-ring img {
  border: 2px solid #0a0a0f !important;
}
@keyframes avatar-ring-spin {
  from { background: conic-gradient(from 0deg, #7C3AED, #EC4899, #3B82F6, #10B981, #F59E0B, #7C3AED); }
  to   { background: conic-gradient(from 360deg, #7C3AED, #EC4899, #3B82F6, #10B981, #F59E0B, #7C3AED); }
}


@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* --- Proxy Badge --- */
.proxy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  transition: all var(--transition-normal);
}

.proxy-badge.active {
  color: var(--accent-purple);
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.12);
}

.proxy-badge:hover {
  background: rgba(124, 58, 237, 0.15);
}

.proxy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--transition-normal);
}

.proxy-dot.online {
  background: var(--accent-purple);
  box-shadow: 0 0 6px rgba(124, 58, 237, 0.5);
}

/* ========================================
   APP LAYOUT (Sidebar + Main)
   ======================================== */
.app-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: var(--footer-height);
  width: var(--sidebar-width);
  background: rgba(12, 12, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --- Sidebar Items --- */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(124, 58, 237, 0.12);
  color: var(--text-primary);
  border-color: rgba(124, 58, 237, 0.2);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
}

.sidebar-item.sub-item {
  padding-left: 44px;
  font-size: 0.85rem;
}

.sidebar-item.sub-item.active::before {
  left: 12px;
  width: 3px;
  height: 20px;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.7;
}

.sidebar-item.active .sidebar-icon {
  opacity: 1;
  color: var(--accent-purple);
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Sidebar Section (Tools) --- */
.sidebar-section {
  margin-top: 8px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.sidebar-section-header:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-section-icon {
  opacity: 0.5;
}

.sidebar-chevron {
  margin-left: auto;
  transition: transform 0.3s ease;
  opacity: 0.5;
}

.sidebar-section-header.collapsed .sidebar-chevron {
  transform: rotate(-90deg);
}

/* --- Sidebar Submenu --- */
.sidebar-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: 800px; /* Increased to allow more items and group titles */
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  padding-top: 4px;
}

.sidebar-submenu.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
}

.sidebar-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px 4px 44px;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.sidebar-footer p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
  flex: 1;
  margin-left: 0;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Desktop Sidebar Collapsed State --- */
body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}
body.sidebar-collapsed .main-content {
  margin-left: 0;
}
body.sidebar-collapsed .footer {
  left: 0;
}

/* --- Page Sections --- */
.page-section {
  display: none;
  flex: 1;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

/* ========================================
   HERO
   ======================================== */
.hero {
  text-align: center;
  padding: 50px 0 36px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

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

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
}

/* ========================================
   VidDownload Page Styles (existing)
   ======================================== */

/* --- URL Input Section --- */
.input-section {
  margin-bottom: 24px;
}

.input-card {
  padding: 8px;
}

.url-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.input-wrapper:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.input-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  padding: 12px 0;
  width: 100%;
}

.url-input::placeholder {
  color: var(--text-muted);
}

select.url-input option {
  background-color: #1e293b; /* Dark background to match the modal */
  color: #f8fafc; /* White text for visibility */
}

.paste-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.paste-btn:hover {
  color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.1);
}

.fetch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-width: 160px;
}

.fetch-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.fetch-btn:hover::before {
  opacity: 1;
}

.fetch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.fetch-btn:active {
  transform: translateY(0);
}

.fetch-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* --- Error Message --- */
.error-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  color: #FCA5A5;
  font-size: 0.9rem;
  margin-bottom: 24px;
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Video Info Card --- */
.video-info {
  margin-bottom: 24px;
  animation: fade-up 0.5s ease-out;
}

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

.video-card {
  padding: 24px;
}

.video-preview {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.thumbnail-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
  aspect-ratio: 16/9;
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.video-details {
  flex: 1;
  min-width: 0;
}

.video-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.source-badge {
  padding: 3px 10px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-full);
  color: #B794F4;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Quality Selection --- */
.quality-section {
  margin-bottom: 20px;
}

.quality-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quality-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-btn {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.quality-btn:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
}

.quality-btn.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent-purple);
  color: white;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
}

.quality-btn .quality-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.quality-btn .quality-size {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.quality-btn.active .quality-size {
  color: rgba(255, 255, 255, 0.6);
}

.quality-btn.best-quality {
  border-color: rgba(236, 72, 153, 0.3);
}

.quality-btn.best-quality.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.2));
  border-color: var(--accent-pink);
}

.quality-btn.audio-quality {
  border-color: rgba(16, 185, 129, 0.3);
}

.quality-btn.audio-quality.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-green);
}

/* --- Download Section --- */
.download-section {
  text-align: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.download-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.download-btn:hover:not(:disabled)::before {
  left: 100%;
}

.download-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
}

.download-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.download-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Download Progress --- */
.download-progress {
  margin-bottom: 24px;
  animation: fade-up 0.4s ease-out;
}

.progress-card {
  padding: 40px;
  text-align: center;
}

.progress-icon {
  margin-bottom: 20px;
}

.download-animation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.1);
  border: 2px solid rgba(124, 58, 237, 0.2);
  color: var(--accent-purple);
  animation: bounce-gentle 2s ease-in-out infinite;
}

@keyframes bounce-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.progress-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.progress-bar-wrapper {
  max-width: 400px;
  margin: 0 auto;
}

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

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  width: 0%;
  animation: progress-indeterminate 2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% { width: 0%; margin-left: 0%; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

/* --- Supported Sites --- */
.supported-sites {
  padding: 50px 0 30px;
  text-align: center;
}

.sites-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.sites-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.site-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-normal);
}

.site-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.site-icon {
  font-size: 1rem;
}

.more-chip {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.2);
  color: var(--accent-purple);
}

/* ========================================
   TOOLS — Shared Styles
   ======================================== */

.tool-section {
  margin-bottom: 24px;
}

.tool-card {
  padding: 24px;
}

/* --- Drop Zone --- */
.drop-zone {
  position: relative;
  border: 2px dashed rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: rgba(124, 58, 237, 0.03);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.1);
}

.drop-zone.drag-over {
  transform: scale(1.01);
}

.drop-zone-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-content {
  pointer-events: none;
}

.drop-zone-icon {
  color: var(--accent-purple);
  opacity: 0.6;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.drop-zone-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.drop-zone-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.drop-zone-formats {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- File List --- */
.file-list {
  margin-top: 20px;
  animation: fade-up 0.3s ease-out;
}

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

.file-list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.clear-files-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-full);
  color: #FCA5A5;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.clear-files-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

/* --- File Preview Grid --- */
.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.file-preview-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  aspect-ratio: 1;
  transition: all var(--transition-normal);
}

.file-preview-item:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.file-preview-item img,
.file-preview-item canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-preview-item .preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-item .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.file-preview-item:hover .remove-btn {
  opacity: 1;
}

.file-preview-item .download-page-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.85);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.file-preview-item:hover .download-page-btn {
  opacity: 1;
}

/* --- Convert Button --- */
.tool-action {
  margin-top: 20px;
  text-align: center;
}

.convert-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.convert-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.convert-btn:hover::before {
  left: 100%;
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4);
}

.convert-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Tool Loading --- */
.tool-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
}

.tool-loading p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Word Preview --- */
.word-preview-content {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.word-preview-content h1,
.word-preview-content h2,
.word-preview-content h3 {
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.word-preview-content p {
  margin-bottom: 8px;
}

.word-preview-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.word-preview-content td,
.word-preview-content th {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

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

/* ========================================
   DONATE BUTTON & MODAL
   ======================================== */
.donate-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(236, 72, 153, 0.1);
  color: #EC4899;
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.donate-btn:hover {
  background: rgba(236, 72, 153, 0.2);
  transform: translateY(-1px);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 90%;
  max-width: 360px;
  text-align: center;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-title {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.qr-container {
  background: white;
  padding: 1rem;
  border-radius: 1rem;
  display: inline-block;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.qr-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
}

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

/* Binance Section */
.binance-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.binance-title {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.binance-id-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-family: monospace;
  font-size: 1.1rem;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 0.4rem;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.1);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  z-index: 1000;
  background: rgba(12, 12, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Tablet and below */
@media (max-width: 768px) {

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.active {
    pointer-events: all;
  }

  .main-content {
    margin-left: 0;
  }

  .footer {
    left: 0;
  }

  .footer .container {
    justify-content: center !important;
  }

  .footer-extra, .footer-visitors {
    display: none !important;
  }

  .status-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  .proxy-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .donate-btn span {
    display: none;
  }

  .hero {
    padding: 36px 0 24px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .url-form {
    flex-direction: column;
  }

  .input-wrapper {
    width: 100%;
  }

  .fetch-btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
  }

  .video-preview {
    flex-direction: column;
  }

  .thumbnail-wrapper {
    width: 100%;
  }

  .video-card {
    padding: 16px;
  }

  .quality-options {
    justify-content: center;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
    padding: 16px;
  }

  .file-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .tool-card {
    padding: 16px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .header-inner {
    padding: 0 12px;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .container {
    padding: 0 16px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .status-badge {
    display: none;
  }

  .donate-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* ========================================
   Contact Us & Privacy Policy Pages
   ======================================== */
.contact-card, .privacy-card {
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: all var(--transition-normal);
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.text-content h2 {
  font-size: 1.4rem;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #fff;
}

.text-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.text-content strong {
  color: #fff;
}

/* --- Profile Dropdown --- */
.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  min-width: 220px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
  z-index: 1000;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform-origin: top right;
  animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: scale(0.95) translateY(-5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.profile-dropdown-header {
  padding: 12px 12px;
}

.profile-name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 1rem;
}

.profile-email {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin: 4px 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s;
}

.profile-dropdown-item svg {
  color: #94a3b8;
  transition: color 0.2s;
}

.profile-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.profile-dropdown-item:hover svg {
  color: #fff;
}

.profile-dropdown-item.upgrade {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.1);
}
.profile-dropdown-item.upgrade svg {
  color: #c084fc;
}
.profile-dropdown-item.upgrade:hover {
  background: rgba(192, 132, 252, 0.2);
  color: #d8b4fe;
}
.profile-dropdown-item.upgrade:hover svg {
  color: #d8b4fe;
}

.profile-dropdown-item.admin {
  color: #fca5a5;
}
.profile-dropdown-item.admin svg {
  color: #fca5a5;
}
.profile-dropdown-item.admin:hover {
  background: rgba(239, 68, 68, 0.15);
}

.profile-dropdown-item.logout {
  color: #f87171;
}
.profile-dropdown-item.logout svg {
  color: #f87171;
}
.profile-dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* --- Light Mode Overrides --- */
.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --border-color: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(124, 58, 237, 0.1);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.05) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.1);
}

/* Theme Toggle Icons Consistency across all pages */
.light-mode #themeIconDark {
  display: block !important;
}
.light-mode #themeIconLight {
  display: none !important;
}
html:not(.light-mode) #themeIconDark {
  display: none !important;
}
html:not(.light-mode) #themeIconLight {
  display: block !important;
}

/* Update text colors in light mode where necessary */
.light-mode .glass-card h3,
.light-mode .section-title,
.light-mode h1,
.light-mode h2,
.light-mode h3,
.light-mode h4,
.light-mode strong,
.light-mode b,
.light-mode .docs-title,
.light-mode .doc-section h2,
.light-mode .logo-link span,
.light-mode .price,
.light-mode .pricing-card h3,
.light-mode span[style*="color: white"] {
  color: var(--text-primary) !important;
  text-shadow: none !important;
}

.light-mode p,
.light-mode .glass-card p,
.light-mode .doc-section p,
.light-mode .doc-section li,
.light-mode .docs-subtitle,
.light-mode .plan-features li {
  color: var(--text-secondary) !important;
}

/* Header and top bar */
.light-mode .header {
  background: rgba(255, 255, 255, 0.85) !important;
}
.light-mode header nav a {
  color: var(--text-secondary) !important;
  background: rgba(0,0,0,0.05) !important;
  border-color: rgba(0,0,0,0.1) !important;
}
.light-mode header nav a:hover {
  background: rgba(0,0,0,0.1) !important;
  color: var(--text-primary) !important;
}

/* Header Widgets (Storage, Pro Status) */
.light-mode .header-widget {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode .header-widget .widget-label {
  color: var(--text-secondary) !important;
}
.light-mode .header-widget .widget-value {
  color: var(--text-primary) !important;
}

/* History List Items */
.hist-download-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #cbd5e1;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hist-group-download-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #cbd5e1;
  padding: 6px;
  border-radius: 6px;
}

.light-mode .hist-download-btn,
.light-mode .hist-group-download-btn {
  background: rgba(0,0,0,0.05) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: var(--text-secondary) !important;
}

.light-mode .history-job-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode .history-job-title,
.light-mode .history-group-title {
  color: var(--text-primary) !important;
}

.light-mode .header-widget svg .circle-bg {
  stroke: rgba(0, 0, 0, 0.1) !important;
}

/* Pricing cards */
.light-mode .pricing-card {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode .pricing-card.pro {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(124, 58, 237, 0.05) 100%) !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
}
.light-mode .pricing-card:not(.pro) .plan-name,
.light-mode .pricing-card .plan-price {
  color: var(--text-primary) !important;
}
.light-mode .pricing-card .feature-item {
  color: var(--text-secondary) !important;
}
.light-mode .pricing-card .plan-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--text-primary) !important;
}
.light-mode .pricing-card.pro .plan-btn {
  background: linear-gradient(135deg, #7c3aed, #ec4899) !important;
  color: white !important;
  border: none !important;
}

/* Docs and Steps */
.light-mode .doc-step {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

/* Dropdown */
.light-mode .profile-dropdown {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-lg) !important;
}

.light-mode .profile-dropdown-item {
  color: var(--text-primary) !important;
}

.light-mode .profile-name {
  color: var(--text-primary) !important;
}

.light-mode .profile-email {
  color: var(--text-secondary) !important;
}

.light-mode .profile-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.light-mode .profile-dropdown-divider {
  border-top-color: var(--border-color) !important;
}

/* Fix generic inline "color: white" across inputs and buttons */
.light-mode input,
.light-mode textarea,
.light-mode select {
  color: var(--text-primary) !important;
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode select option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}
.light-mode .fetch-btn,
.light-mode button[type="submit"] {
  color: white !important; /* Keep primary buttons text white for contrast against dark button backgrounds */
}

/* Settings Form Elements */
.light-mode label[style*="color: #cbd5e1"],
.light-mode p[style*="color: #94a3b8"] {
  color: var(--text-secondary) !important;
}
.light-mode #cancelSettingsBtn {
  color: var(--text-primary) !important;
  border-color: rgba(0,0,0,0.2) !important;
  background: rgba(0,0,0,0.05) !important;
}
.light-mode #cancelSettingsBtn:hover {
  background: rgba(0,0,0,0.1) !important;
}

.light-mode .footer-link:hover {
  color: #a855f7 !important;
}

/* Video AI Form Elements */
.light-mode .engine-option {
  color: var(--text-secondary) !important;
}

/* AI Relaxing Video Light Mode Overrides */
.light-mode #relaxingVideoForm label[style*="color: #94a3b8"],
.light-mode #relaxingVideoForm label[style*="color: #cbd5e1"],
.light-mode #relaxingVideoForm span[style*="color: #cbd5e1"],
.light-mode #relaxingVideoForm label[style*="color: #94a3b8"] span {
  color: var(--text-secondary) !important;
}
.light-mode #rvAudioTitlesContainer {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode #rvTextCustomization {
  border-top-color: var(--border-color) !important;
}
.light-mode #relaxingVideoForm > div[style*="background: rgba(30, 41, 59, 0.5)"] {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode #rvLivePreviewContainer {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode #rvProgressBarContainer > div:first-child {
  background: rgba(0,0,0,0.05) !important;
  border-color: var(--border-color) !important;
}

/* Confirm Delete Modal Overrides */
.light-mode #modernConfirmBox {
  background: white !important;
  border-color: rgba(0,0,0,0.15) !important;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15) !important;
}
.light-mode #modernConfirmTitle {
  color: var(--text-primary) !important;
}
.light-mode #modernConfirmMsg {
  color: var(--text-secondary) !important;
}
.light-mode #modernConfirmCancel {
  background: rgba(0,0,0,0.05) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: var(--text-secondary) !important;
}
.light-mode #modernConfirmCancel:hover {
  background: rgba(0,0,0,0.1) !important;
}

/* Video AI App Layout Overrides */
.light-mode #page-video-translator {
  background-color: var(--bg-primary) !important;
}
.light-mode #page-video-translator > div > div:nth-child(1),
.light-mode #page-video-translator > div > div:nth-child(3) {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode #page-video-translator > div > div:nth-child(2) {
  background-color: var(--bg-primary) !important;
  border-color: var(--border-color) !important;
}
.light-mode #page-video-translator [style*="border-right: 1px solid #2d2d3a"],
.light-mode #page-video-translator [style*="border-bottom: 1px solid #2d2d3a"],
.light-mode #page-video-translator [style*="border-top: 1px solid #2d2d3a"] {
  border-color: var(--border-color) !important;
}
.light-mode #editorSegments {
  background: rgba(0,0,0,0.02) !important;
  border-color: var(--border-color) !important;
}
.light-mode #dubifyTerminalContainer {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}
.light-mode #dubifyTerminalContainer > div:first-child {
  border-bottom-color: var(--border-color) !important;
}
.light-mode #dubifyTerminal {
  color: var(--text-secondary) !important;
}
.light-mode #dubifyTerminal span[style*="color:#64748b"] {
  color: var(--text-secondary) !important;
}
.light-mode #vtPreviewBtn {
  background: rgba(0,0,0,0.05) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: var(--text-primary) !important;
}
.light-mode #vtPreviewBtn:hover {
  background: rgba(0,0,0,0.08) !important;
}
.light-mode #vtSplitOnlyBtn {
  background: rgba(0,0,0,0.05) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: var(--text-primary) !important;
}
.light-mode #vtSplitOnlyBtn:hover {
  background: rgba(0,0,0,0.08) !important;
}
.light-mode #page-video-translator .engine-option {
  color: var(--text-primary) !important;
}
.light-mode .engine-option:hover {
  background: rgba(59, 130, 246, 0.1) !important;
  color: var(--text-primary) !important;
}
.light-mode .engine-option:has(input[type="radio"]:checked) {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #1d4ed8 !important; /* Dark blue for contrast */
}

.light-mode #toggleHistoryBtn {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--text-secondary) !important;
}
.light-mode #vtSubmitText {
  color: white !important;
}

/* ===== Sign In Button & Auth Dropdown ===== */
.light-mode #headerSignInBtn {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-primary) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}
.light-mode #headerSignInBtn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  border-color: rgba(0, 0, 0, 0.25) !important;
  color: var(--text-primary) !important;
}
.light-mode #headerAuthPlate {
  background: rgba(255, 255, 255, 0.97) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}
.light-mode #headerAuthPlate input {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--text-primary) !important;
}
.light-mode #headerTabLogin,
.light-mode #headerTabRegister {
  color: var(--text-secondary) !important;
}
.light-mode #headerTabLogin[style*="border-bottom: 2px solid #3b82f6"] {
  color: var(--text-primary) !important;
}
.light-mode #headerAuthPlate hr {
  border-top-color: rgba(0, 0, 0, 0.1) !important;
}
.light-mode #headerAuthPlate span[style*="color: #64748b"] {
  color: var(--text-secondary) !important;
}

/* ===== Review & Edit Translation Modal ===== */
.light-mode #editorModal > .glass-card {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.12) !important;
  box-shadow: 0 25px 50px -10px rgba(0,0,0,0.15) !important;
  backdrop-filter: none !important;
}
.light-mode #editorModal h2 {
  color: var(--text-primary) !important;
}
.light-mode #editorModal p {
  color: var(--text-secondary) !important;
}
.light-mode #editorSegments {
  border-color: rgba(0,0,0,0.1) !important;
  background: rgba(0,0,0,0.02) !important;
}
/* Original text textarea (left side) */
.light-mode #editorSegments textarea:disabled {
  background: rgba(0,0,0,0.04) !important;
  color: var(--text-primary) !important;
  border-color: rgba(0,0,0,0.1) !important;
}
/* Translated text textarea (right side) */
.light-mode #editorSegments textarea.edited-segment-text {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-color: rgba(59,130,246,0.35) !important;
}
/* Timestamp badges */
.light-mode #editorSegments div[style*="font-family:monospace"] {
  color: var(--text-secondary) !important;
  background: rgba(0,0,0,0.06) !important;
}

/* ===== Settings Modal (in index.html) ===== */
.light-mode #settingsModal > .glass-card {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.12) !important;
  box-shadow: 0 25px 50px -10px rgba(0,0,0,0.15) !important;
  backdrop-filter: none !important;
}
.light-mode #settingsModal h2 {
  color: var(--text-primary) !important;
}
.light-mode #settingsModal #cancelSettingsBtn {
  color: var(--text-primary) !important;
  border-color: rgba(0,0,0,0.15) !important;
  background: rgba(0,0,0,0.05) !important;
}
.light-mode #settingsModal #closeSettingsModal {
  color: var(--text-secondary) !important;
}

@media (max-width: 768px) {
  /* Header fixes */
  .header-left { gap: 5px !important; }
  .logo-link span span { font-size: 1.1rem !important; }
  .header-inner nav { gap: 2px !important; }
  .header-inner nav a { padding: 6px 8px !important; font-size: 0px !important; } /* Hide text, show icon */
  .header-inner nav a svg { margin: 0 !important; }
  #headerSignInBtn { padding: 6px 10px !important; }
  #headerSignInBtn span { display: none !important; }
  #authContainer { flex-shrink: 0 !important; }
  .header-widget { display: none !important; } /* Hide Pro, Storage, Usage on mobile */
  
  /* Form fixes */
  #videoTranslatorForm > div { flex-wrap: wrap !important; }
  #vtLangCode, #vtSplitDuration, #vtVoiceGender, #vtVoicePitch, #vtVoiceRate { width: 100% !important; flex: 1 1 100% !important; margin-bottom: 10px; }
  .translator-form-panel { padding-top: 60px !important; padding-left: 15px !important; padding-right: 15px !important; }
  #toggleHistoryBtn { top: 15px !important; right: 15px !important; }
  .engine-option { margin-bottom: 5px; }
}

/* Custom sleek scrollbars for editor textareas */
#editorSegments textarea::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
#editorSegments textarea::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
#editorSegments textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
#editorSegments textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* --- Timeline UI --- */
.timeline-segment-block { position: absolute; top: 10px; height: 30px; background: rgba(236, 72, 153, 0.8); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: white; font-size: 10px; font-weight: bold; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 5px; box-sizing: border-box; }
.timeline-segment-block:hover { border-color: white; background: rgba(236, 72, 153, 1); }
.timeline-segment-block.selected { border: 2px solid #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.timeline-resize-handle { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 10; background: rgba(255,255,255,0.1); }
.timeline-resize-handle:hover { background: rgba(255,255,255,0.4); }
.timeline-resize-handle.left { left: 0; }
.timeline-resize-handle.right { right: 0; }
.timeline-ruler-tick { position: absolute; bottom: 0; width: 1px; background: rgba(255,255,255,0.2); }
.timeline-ruler-text { position: absolute; bottom: 5px; color: #94a3b8; font-size: 10px; font-family: monospace; transform: translateX(-50%); }

/* ===== Docs Page Light Mode Overrides ===== */
.light-mode .docs-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

.light-mode .docs-title {
  background: linear-gradient(135deg, #2563eb, #7c3aed, #db2777) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.light-mode .docs-subtitle {
  color: #475569 !important;
}

.light-mode .doc-section h2 {
  color: #0f172a !important;
  border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

.light-mode .doc-section p,
.light-mode .doc-section li {
  color: #334155 !important;
}

.light-mode .doc-section strong {
  color: #0f172a !important;
}

.light-mode .doc-step {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.light-mode .doc-step:hover {
  background: #ffffff !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

.light-mode .feature-card,
.light-mode .faq-item {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.light-mode .feature-card h3 {
  color: #1d4ed8 !important;
}

.light-mode .feature-card p {
  color: #475569 !important;
}

.light-mode .faq-question {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.light-mode .faq-answer {
  color: #475569 !important;
}

.light-mode .plan-table {
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.light-mode .plan-table th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.light-mode .plan-table td {
  background: #ffffff !important;
  color: #334155 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.light-mode .badge-free {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #475569 !important;
}

.light-mode .badge-pro {
  background: rgba(147, 51, 234, 0.1) !important;
  color: #7c3aed !important;
  border-color: rgba(147, 51, 234, 0.3) !important;
}

.light-mode code {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #c026d3 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.light-mode pre {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.light-mode .alert-box {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
  color: #1e40af !important;
}

/* ===== Contact Us Page Light Mode Overrides ===== */
.light-mode .contact-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

.light-mode .contact-title {
  background: linear-gradient(135deg, #2563eb, #7c3aed, #db2777) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.light-mode .contact-subtitle {
  color: #475569 !important;
}

.light-mode .contact-card h2 {
  color: #0f172a !important;
}

.light-mode .method-card {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
}

.light-mode .method-card:hover {
  background: #ffffff !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.light-mode .method-title {
  color: #0f172a !important;
}

.light-mode .method-desc {
  color: #475569 !important;
}

.light-mode #qrModal > div,
.light-mode #emailModal > div {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2) !important;
  color: #0f172a !important;
}

.light-mode #qrModal h2,
.light-mode #emailModal h2 {
  color: #0f172a !important;
}

.light-mode #contactForm label {
  color: #475569 !important;
}

.light-mode #contactForm input,
.light-mode #contactForm textarea {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

/* Header Active Nav Links in Light Mode */
.light-mode header nav a[style*="linear-gradient"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(168, 85, 247, 0.12)) !important;
  color: #1e1b4b !important;
  border-color: rgba(147, 51, 234, 0.4) !important;
  font-weight: 700 !important;
}

/* ===== Theme Toggle Icon & Header Icons Contrast ===== */
.light-mode #themeToggleBtn {
  color: #0f172a !important;
  background: rgba(0, 0, 0, 0.06) !important;
  border-radius: 50% !important;
}

.light-mode #themeToggleBtn:hover {
  background: rgba(0, 0, 0, 0.12) !important;
}

.light-mode #themeToggleBtn svg {
  stroke: #0f172a !important;
}

.light-mode header nav a svg {
  stroke: currentColor !important;
}

/* ===== Windows App Download Page Light Mode ===== */
.light-mode #page-download-app {
  background-color: var(--bg-primary) !important;
}

.light-mode #page-download-app > div > .glass-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

.light-mode #page-download-app h1 {
  color: #0f172a !important;
}

.light-mode #page-download-app p {
  color: #475569 !important;
}

.light-mode #page-download-app div[style*="grid"] > div {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.light-mode #page-download-app div[style*="grid"] > div > div:last-child {
  color: #475569 !important;
}

/* ===== Home Page (#page-welcome & #page-video-translator) Light Mode Overrides ===== */
.light-mode #page-welcome h1 {
  color: #0f172a !important;
}

.light-mode #page-welcome p {
  color: #475569 !important;
}

.light-mode #page-welcome button[style*="background: rgba(255,255,255,0.08)"] {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

.light-mode #page-video-translator,
.light-mode #page-video-translator [style*="background-color: #17171e"],
.light-mode #page-video-translator [style*="background-color: #1a1a24"] {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.light-mode #page-video-translator h3,
.light-mode #page-video-translator h4,
.light-mode #page-video-translator span[style*="color: #e2e8f0"],
.light-mode #page-video-translator label {
  color: #0f172a !important;
}

