/* ========================================
   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;
}

.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;
}

@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: 0;
  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: var(--sidebar-width);
  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;
}

/* --- 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;
  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;
}

.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;
}

/* ========================================
   MODERN PREMIUM FOOTER
   ======================================== */
.footer {
  margin-top: auto;
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, rgba(13, 13, 24, 0.75) 0%, rgba(8, 8, 16, 0.98) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 50px 0 26px;
  z-index: 10;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.1fr;
  gap: 36px;
}

/* Brand Column */
.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 360px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.footer-logo-icon {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 10px;
}

.footer-tagline {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

.footer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 9999px;
  width: fit-content;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

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

.status-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #34d399;
  letter-spacing: 0.02em;
}

/* Footer Link Columns */
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links li a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  display: inline-block;
}

.footer-links li a:hover {
  color: #fff;
  transform: translateX(3px);
}

.footer-donate-link {
  color: #f472b6 !important;
  font-weight: 600;
}

.footer-donate-link:hover {
  color: #fbcfe8 !important;
}

/* Footer Bottom Bar */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

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

.footer-copyright-text strong {
  color: #cbd5e1;
}

.footer-visitors-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.vis-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vis-item svg {
  color: #94a3b8;
}

.vis-item strong {
  color: #fff;
}

.vis-divider {
  color: rgba(255, 255, 255, 0.15);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

.vis-item.online strong {
  color: #4ade80;
}

/* Responsive Footer */
@media (max-width: 968px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-brand-col {
    max-width: 100%;
    grid-column: span 2;
  }
}

@media (max-width: 580px) {
  .footer {
    padding: 36px 0 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-brand-col {
    grid-column: span 1;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ========================================
   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);
}

/* ========================================
   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;
  }

  .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;
}

/* ========================================
   Legal, Guides & FAQ Content Styles
   ======================================== */
.text-content ul, .text-content ol {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
  padding-left: 24px;
}

.text-content li {
  margin-bottom: 8px;
}

.text-content a {
  color: var(--accent-purple);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.text-content a:hover {
  color: #a78bfa;
}

/* FAQ Component */
.faq-section {
  margin-top: 50px;
  margin-bottom: 30px;
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  transition: all var(--transition-normal);
}

.faq-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 58, 237, 0.3);
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-answer {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
  margin: 0;
}

/* Knowledge & Guide Cards */
.guides-section {
  margin-top: 50px;
  margin-bottom: 20px;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.guide-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-icon {
  font-size: 28px;
}

.guide-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.guide-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
