/* Design System & CSS Reset */
:root {
  --bg-dark: #070913;
  --bg-card: #0d1020;
  --bg-input: #111428;
  --bg-tag: #171b35;
  --bg-badge: rgba(99, 102, 241, 0.1);

  --border-color: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(99, 102, 241, 0.25);

  --text-white: #ffffff;
  --text-gray-light: #cbd5e1;
  --text-gray: #94a3b8;
  --text-muted: #64748b;

  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-blue: #3b82f6;
  --color-purple: #a855f7;

  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-gray-light);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Glow Spheres */
.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.sphere-top {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.05) 100%);
  top: -100px;
  right: -50px;
}

.sphere-bottom {
  width: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
  bottom: -100px;
  left: -100px;
}

/* Navbar */
.navbar {
  width: 100%;
  max-width: 1200px;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  z-index: 10;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-blue), var(--color-primary));
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.logo-camera-icon {
  color: var(--text-white);
  font-size: 18px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.logo-highlight {
  color: var(--color-primary);
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-gray);
}

.theme-toggle-btn:hover {
  border-color: var(--text-gray-light);
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.03);
}

/* Main Container Layout */
.main-container {
  width: 100%;
  max-width: 820px;
  padding: 40px 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 0 auto;
}

/* Hero Badge */
.badge-wrapper {
  margin-bottom: 24px;
}

.hero-badge {
  background-color: var(--bg-badge);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}

.badge-icon {
  font-size: 12px;
  color: #a5b4fc;
}

/* Main Heading */
.main-heading {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-white);
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

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

/* Subtitle */
.subtitle-text {
  font-size: 17px;
  color: var(--text-gray);
  max-width: 580px;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Disclaimer Shield Card */
.disclaimer-card {
  background-color: rgba(13, 16, 32, 0.6);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  margin-bottom: 40px;
  text-align: left;
}

.disclaimer-icon-area {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-blue);
  font-size: 20px;
}

.disclaimer-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-gray);
}

.disclaimer-text strong {
  color: var(--text-gray-light);
}

/* Search / Input Field Section */
.search-section {
  width: 100%;
  max-width: 680px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

#video-url {
  width: 100%;
  padding: 18px 56px 18px 24px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#video-url:focus {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.paste-icon-btn,
.clear-icon-btn {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.paste-icon-btn:hover,
.clear-icon-btn:hover {
  color: var(--text-white);
}

/* Download Trigger Button */
.button-wrapper {
  display: flex;
  justify-content: center;
}

.download-trigger-btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  color: var(--text-white);
  border: none;
  border-radius: 9999px;
  padding: 16px 40px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  transition: var(--transition);
}

.download-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

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

/* Popular Tags Row */
.tags-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 680px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.tags-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tags-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tag-pill {
  background-color: var(--bg-tag);
  color: var(--text-gray);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tag-pill:hover {
  background-color: var(--color-primary);
  color: var(--text-white);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* Loading state */
.loading-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 32px;
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fade-in 0.4s ease-out;
}

.loader-ring {
  width: 50px;
  height: 50px;
  position: relative;
}

.ring-spinner {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error state */
.error-container {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.1);
  padding: 32px;
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fade-in 0.4s ease-out;
}

.error-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ef4444;
  font-size: 22px;
}

.retry-action-btn {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.retry-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Results / Info Card Section */
.result-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 680px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slide-up 0.5s ease-out;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-card {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background-color: #000;
}

.preview-card video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.play-center-icon {
  font-size: 52px;
  color: var(--text-white);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  transition: var(--transition);
}

.video-player-overlay:hover {
  background: rgba(0, 0, 0, 0.25);
}

.video-player-overlay:hover .play-center-icon {
  transform: scale(1.15);
  color: var(--color-primary);
}

.details-table {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.row-label {
  color: var(--text-gray);
  font-weight: 500;
}

.row-value {
  color: var(--text-white);
  font-weight: 600;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-monospace {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.primary-download-btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  color: var(--text-white);
  border: none;
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  transition: var(--transition);
}

.primary-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  filter: brightness(1.05);
}

.alternative-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alt-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13.5px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.alt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-gray);
}

/* Telegram Community Box */
.telegram-card {
  width: 100%;
  max-width: 680px;
  background-color: rgba(13, 16, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.telegram-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
}

.telegram-desc {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 8px;
}

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 12px 30px;
  border-radius: 9999px;
  transition: var(--transition);
}

.telegram-btn:hover {
  background-color: var(--text-white);
  color: var(--bg-dark);
  border-color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

.telegram-icon {
  font-size: 16px;
  transition: var(--transition);
}

/* Footer styling */
.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 30px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  z-index: 10;
  border-top: 1px solid var(--border-color);
  background-color: rgba(7, 9, 19, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Helpers */
.hidden {
  display: none !important;
}

.text-success {
  color: #10b981 !important;
}

.animate-bounce-slow {
  animation: bounce-slow 2.5s infinite;
}

@keyframes bounce-slow {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive queries */
@media (max-width: 640px) {
  .main-heading {
    font-size: 40px;
  }

  .navbar {
    padding: 0 20px;
  }

  .alternative-actions {
    grid-template-columns: 1fr;
  }
}

/* Light Theme Variables & Overrides */
body.light-theme {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-tag: #e2e8f0;
  --bg-badge: rgba(99, 102, 241, 0.08);

  --border-color: rgba(0, 0, 0, 0.06);
  --border-glow: rgba(99, 102, 241, 0.15);

  --text-white: #0f172a;
  --text-gray-light: #334155;
  --text-gray: #475569;
  --text-muted: #64748b;

  background-color: var(--bg-dark);
  color: var(--text-gray-light);
}

body.light-theme .glow-sphere {
  opacity: 0.15;
}

body.light-theme .logo-text {
  color: #0f172a;
}

body.light-theme #video-url {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

body.light-theme .disclaimer-card {
  background-color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

body.light-theme .telegram-card {
  background-color: #ffffff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

body.light-theme .telegram-btn:hover {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

body.light-theme .result-container {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

body.light-theme .alt-btn {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme .alt-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--text-gray);
}

body.light-theme .site-footer {
  background-color: rgba(248, 250, 252, 0.8);
}