:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #f5f3ff;
  --primary-dark: #4c1d95;
  --secondary: #4f46e5;
  --accent: #ec4899;
  --bg-main: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #a78bfa;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(124, 58, 237, 0.12), 0 4px 6px -4px rgba(124, 58, 237, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(124, 58, 237, 0.15), 0 8px 10px -6px rgba(124, 58, 237, 0.1);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Nav */
.header {
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.35);
}

.brand-name {
  background: linear-gradient(135deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.btn-header {
  background: var(--primary-light);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid rgba(124, 58, 237, 0.2);
  transition: var(--transition);
}

.btn-header:hover {
  background: var(--primary);
  color: #fff;
}

/* Hero Section */
.hero {
  padding: 56px 0 32px 0;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--text-main);
  letter-spacing: -1px;
}

.hero-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto 32px auto;
}

/* Platform Selector Tabs */
.platform-selector {
  display: inline-flex;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: var(--radius-full);
  gap: 6px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.platform-btn {
  border: none;
  background: transparent;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.platform-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Downloader Input Card */
.input-card {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  transition: var(--transition);
}

.input-group:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.input-icon {
  color: var(--text-light);
  padding-left: 14px;
  font-size: 1.15rem;
}

.input-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 1.05rem;
  color: var(--text-main);
  outline: none;
}

.input-field::placeholder {
  color: var(--text-light);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-paste, .btn-clear {
  border: none;
  background: #fff;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-paste:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-submit {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  padding: 15px 24px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
  transition: var(--transition);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.input-disclaimer {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Status & Alert Messages */
.alert-box {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  text-align: left;
  line-height: 1.5;
}

.alert-box.active {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Spinner */
.spinner {
  display: none;
  margin: 30px auto;
  width: 44px;
  height: 44px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Media Result Section */
.result-container {
  display: none;
  margin-top: 32px;
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  text-align: left;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  animation: slideUp 0.35s ease-out;
}

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

.result-header {
  padding: 18px 24px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
}

.author-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.media-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.result-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.result-thumbnail-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  aspect-ratio: 9/16;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.result-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.result-caption {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.download-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-download-media {
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
}

.btn-download-media:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

/* Ad Placement Containers - Policy Compliant */
.ad-slot-wrapper {
  margin: 28px auto;
  max-width: 780px;
  text-align: center;
}

.ad-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 600;
}

.ad-container {
  min-height: 100px;
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Features Grid */
.features-section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-main);
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* How to use */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.step-card {
  background: var(--bg-main);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
}

.step-number {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2.2rem;
  font-weight: 900;
  color: rgba(124, 58, 237, 0.12);
  line-height: 1;
}

.step-card h4 {
  font-size: 1.15rem;
  margin: 14px 0 8px 0;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* FAQ Accordion */
.faq-section {
  padding: 56px 0;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
  transition: var(--transition);
}

.faq-question {
  width: 100%;
  padding: 18px 22px;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-icon {
  color: var(--primary);
  transition: transform 0.25s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 22px 20px 22px;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Footer */
.footer {
  margin-top: auto;
  background: #0f172a;
  color: #94a3b8;
  padding: 60px 0 24px 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 340px;
}

.footer-col h5 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    height: 64px;
  }
  .nav-links {
    display: none;
  }
  .result-body {
    grid-template-columns: 1fr;
  }
  .result-thumbnail-wrap {
    aspect-ratio: 16/9;
    max-height: 240px;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
