/* CSS Variables */
:root {
  --background: hsl(210, 20%, 98%);
  --foreground: hsl(222, 47%, 11%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(222, 47%, 11%);
  --primary: hsl(217, 91%, 60%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(210, 40%, 96%);
  --secondary-foreground: hsl(222, 47%, 11%);
  --muted: hsl(210, 40%, 96%);
  --muted-foreground: hsl(215, 16%, 47%);
  --destructive: hsl(0, 84%, 60%);
  --border: hsl(214, 32%, 91%);
  --input: hsl(214, 32%, 91%);
  --ring: hsl(217, 91%, 60%);
  --radius: 0.75rem;

  /* Platform Colors */
  --youtube: hsl(0, 100%, 50%);
  --facebook: hsl(221, 44%, 41%);
  --instagram: hsl(340, 75%, 54%);
  --tiktok: hsl(0, 0%, 0%);
  --pinterest: hsl(0, 78%, 47%);
  --twitter: hsl(203, 89%, 53%);
  --vimeo: hsl(195, 100%, 40%);
  --dailymotion: hsl(210, 100%, 50%);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(30, 41, 59, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(30, 41, 59, 0.1), 0 2px 4px -2px rgba(30, 41, 59, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(30, 41, 59, 0.1), 0 4px 6px -4px rgba(30, 41, 59, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(30, 41, 59, 0.1), 0 8px 10px -6px rgba(30, 41, 59, 0.1);
  --shadow-primary: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

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

body {
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* Container */
.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  width: 100%;
  padding: 1.5rem 0;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: transform 0.2s;
}

.logo:hover .logo-icon {
  transform: scale(1.05);
}

.logo-icon {
  padding: 0.625rem;
  background-color: var(--primary);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

/* Hero Section */
.hero-section {
  width: 100%;
  padding: 2rem 0 3rem;
}

/* Platform Tabs */
.platform-tabs-container {
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.platform-tabs-container::-webkit-scrollbar {
  display: none;
}

.platform-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background-color: var(--secondary);
  padding: 0.375rem;
  border-radius: 0.75rem;
  width: fit-content;
  margin: 0 auto;
}

.platform-tab {
  position: relative;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-tab:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.platform-tab.active {
  background-color: var(--card);
  box-shadow: var(--shadow-md);
  color: var(--foreground);
}

.platform-tab svg {
  width: 20px;
  height: 20px;
}

.platform-tab[data-platform="youtube"] {
  color: var(--youtube);
}

.platform-tab[data-platform="facebook"] {
  color: var(--facebook);
}

.platform-tab[data-platform="instagram"] {
  color: var(--instagram);
}

.platform-tab[data-platform="tiktok"] {
  color: var(--tiktok);
}

.platform-tab[data-platform="pinterest"] {
  color: var(--pinterest);
}

.platform-tab[data-platform="twitter"] {
  color: black;
}

.platform-tab[data-platform="vimeo"] {
  color: var(--vimeo);
}

.platform-tab[data-platform="dailymotion"] {
  color: black;
}

/* Hero Text */
.hero-text {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease-out;
}

.hero-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 36rem;
  margin: 0 auto;
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(214, 219, 229, 0.5);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .glass-card {
    padding: 2rem;
  }
}

/* Download Form */
.download-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  font-size: 1rem;
  border-radius: 0.75rem;
  border: 2px solid var(--input);
  background-color: var(--card);
  color: var(--foreground);
  transition: all 0.2s;
}

.download-input::placeholder {
  color: var(--muted-foreground);
}

.download-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.download-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading State */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--muted-foreground);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Video Preview */
.video-preview {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--secondary);
  border-radius: 0.75rem;
  animation: slideUp 0.4s ease-out;
}

.preview-thumbnail {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 68px;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: var(--muted);
}

.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
}

.preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.platform-badge {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  padding: 0.125rem 0.375rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preview-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-author {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Quality Selector */
.quality-selector {
  padding: 1rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  animation: slideUp 0.4s ease-out;
}

.quality-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.quality-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quality-chip {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 2px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  transition: all 0.15s;
}

.quality-chip:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.quality-chip.active {
  border-color: var(--primary);
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

/* Error Message */
.error-message {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--destructive);
  animation: fadeIn 0.3s ease-out;
}

.error-message svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* Download Button */
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-primary);
  transition: all 0.2s;
  width: 100%;
}

.download-btn:hover:not(:disabled) {
  opacity: 0.9;
}

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

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

.download-btn.success {
  background-color: hsl(142, 71%, 45%);
}

/* Supported Formats */
.supported-formats {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.format-highlight {
  font-weight: 500;
}

/* How It Works Section */
.how-it-works {
  width: 100%;
  padding: 3rem 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--foreground);
  margin-bottom: 2rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  background-color: var(--card);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.step-card:hover {
  box-shadow: var(--shadow-md);
}

.step-number {
  position: absolute;
  top: -0.75rem;
  left: -0.75rem;
  width: 1.75rem;
  height: 1.75rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--secondary);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--primary);
}

.step-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.step-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Features Section */
.features {
  width: 100%;
  padding: 3rem 0;
  background-color: rgba(210, 218, 230, 0.3);
}

.section-subtitle {
  text-align: center;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

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

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background-color: var(--card);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.feature-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.feature-description {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Footer */
.footer {
  width: 100%;
  border-top: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.5);
  margin-top: auto;
  padding: 2rem 0;
}

.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background-color: rgba(210, 218, 230, 0.5);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.disclaimer svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.disclaimer-title {
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.footer-links a:hover {
  color: var(--foreground);
}

.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.heart-icon {
  color: var(--destructive);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
  max-width: 350px;
}

.toast.success {
  border-left: 4px solid hsl(142, 71%, 45%);
}

.toast.error {
  border-left: 4px solid var(--destructive);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--foreground);
  margin-bottom: 0.125rem;
}

.toast-description {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

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

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

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

/* Responsive Adjustments */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .platform-tabs {
    gap: 0.125rem;
  }

  .platform-tab {
    padding: 0.5rem 0.75rem;
  }

  .video-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .preview-thumbnail {
    width: 160px;
    height: 90px;
  }
}