/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3a;
  --bg-card-hover: #222250;
  --text-primary: #f0f0ff;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8a;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --gradient-main: linear-gradient(135deg, #a855f7 0%, #06b6d4 100%);
  --gradient-hero: linear-gradient(180deg, #12122a 0%, #0a0a1a 100%);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(168,85,247,0.15) 0%, transparent 60%);
  --border-color: rgba(168,85,247,0.15);
  --border-glow: rgba(6,182,212,0.3);
  --shadow-glow: 0 0 30px rgba(168,85,247,0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
ul { list-style: none; }

/* ===== UTILITY ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== AD ZONES ===== */
.ad-zone {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  min-height: 100px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: rgba(18,18,42,0.5);
  position: relative;
}
.ad-zone::after {
  content: 'Advertisement';
  position: absolute;
  top: 4px;
  right: 12px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ad-zone--banner { min-height: 100px; }
.ad-zone--rect { min-height: 260px; max-width: 336px; margin: 20px auto; }
.ad-zone--native { min-height: 120px; margin: 24px 0; border-radius: var(--radius-md); }
.ad-zone--sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 60px;
  z-index: 900;
  background: rgba(10,10,26,0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  border-bottom: none;
}
.ad-zone--sticky .ad-close {
  position: absolute;
  top: -24px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.ad-zone--sticky .ad-close:hover { background: var(--accent-purple); color: #fff; }
.ad-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(168,85,247,0.2);
  border-radius: var(--radius-sm);
  width: 100%;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 14px 0;
  transition: var(--transition);
  background: transparent;
}
.navbar.scrolled {
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
}
.nav-logo img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-main);
  transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-badge {
  background: var(--gradient-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
}
.nav-mobile-btn {
  display: none;
  background: none;
  color: var(--text-primary);
  font-size: 1.5rem;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 160px 0 80px;
  text-align: center;
  background: var(--gradient-hero);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}
.hero-glow--purple { top: 10%; left: 15%; background: rgba(168,85,247,0.12); }
.hero-glow--cyan { bottom: 10%; right: 15%; background: rgba(6,182,212,0.1); animation-delay: -4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  margin: 0 auto 24px;
  box-shadow: var(--shadow-glow);
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(168,85,247,0.2); }
  50% { box-shadow: 0 0 40px rgba(168,85,247,0.4), 0 0 80px rgba(6,182,212,0.15); }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
}

/* ===== SEARCH BOX ===== */
.search-box {
  max-width: 680px;
  margin: 0 auto 16px;
  display: flex;
  gap: 12px;
  position: relative;
}
.search-box input {
  flex: 1;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 4px rgba(168,85,247,0.1);
}
.search-box .btn-search {
  padding: 18px 36px;
  background: var(--gradient-main);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-xl);
  transition: var(--transition);
  white-space: nowrap;
}
.search-box .btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168,85,247,0.35);
}
.search-box .btn-search:active { transform: translateY(0); }
.search-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== CONTENT TABS ===== */
.content-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px auto 0;
  max-width: 500px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}
.tab-btn:hover, .tab-btn.active {
  background: rgba(168,85,247,0.15);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}
.tab-btn .tab-icon { margin-right: 6px; }

/* ===== SECTIONS GENERAL ===== */
section { padding: 80px 0; }
.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
}

/* ===== FEATURES GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(168,85,247,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ===== HOW IT WORKS ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  counter-reset: step;
}
.step-card {
  text-align: center;
  padding: 36px 24px;
  position: relative;
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.step-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* ===== TOOLS GRID ===== */
.tools-section { background: var(--bg-secondary); }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}
.tool-card:hover {
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}
.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(6,182,212,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.tool-card h3 { font-size: 0.95rem; font-weight: 600; }
.tool-card p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.tool-arrow {
  margin-left: auto;
  color: var(--text-muted);
  transition: var(--transition);
}
.tool-card:hover .tool-arrow { color: var(--accent-cyan); transform: translateX(4px); }

/* ===== FAQ ===== */
.faq-section { background: var(--bg-primary); }
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition);
}
.faq-item:hover { border-color: rgba(168,85,247,0.3); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg-card);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  transition: var(--transition);
}
.faq-question:hover { background: var(--bg-card-hover); }
.faq-chevron {
  font-size: 1.2rem;
  transition: transform 0.3s;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-item.active .faq-chevron { transform: rotate(180deg); color: var(--accent-purple); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.active .faq-answer { max-height: 300px; }
.faq-answer-inner {
  padding: 0 24px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 100px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand p { font-size: 0.85rem; color: var(--text-secondary); margin-top: 12px; line-height: 1.7; }
.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--accent-cyan); transform: translateX(4px); }
.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: var(--text-secondary); }
.footer-bottom a:hover { color: var(--accent-purple); }

/* ===== LOADING MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
}
.loader {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal h3 { font-size: 1.1rem; margin-bottom: 8px; }
.modal p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; }
.modal .ad-zone { margin-top: 16px; border-radius: var(--radius-md); }

/* ===== RESULTS SECTION ===== */
.results-section {
  display: none;
  padding: 40px 0;
}
.results-section.active { display: block; }

/* Profile header card */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(168,85,247,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  border: 2px solid var(--accent-purple);
}
.profile-info { flex: 1; }
.profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.profile-username { font-size: 0.85rem; color: var(--text-muted); }
.profile-stats { text-align: center; }
.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Download all bar */
.download-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(168,85,247,0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.download-all-bar p { font-size: 0.9rem; color: var(--text-secondary); }
.btn-download-all {
  padding: 12px 28px;
  background: var(--gradient-main);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-xl);
  transition: var(--transition);
  white-space: nowrap;
}
.btn-download-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168,85,247,0.35);
}

/* Story list */
.story-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual story row */
.story-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.story-item:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

/* Story thumbnail */
.story-thumb {
  width: 72px;
  height: 96px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-thumb-placeholder {
  font-size: 1.8rem;
  color: var(--text-muted);
}
.story-thumb .media-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
}

/* Story details */
.story-details {
  flex: 1;
  min-width: 0;
}
.story-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.story-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.story-badge--video { background: rgba(168,85,247,0.15); color: var(--accent-purple); }
.story-badge--image { background: rgba(6,182,212,0.15); color: var(--accent-cyan); }
.story-badge--story { background: rgba(236,72,153,0.15); color: var(--accent-pink); }

/* Story download button */
.story-download-btn {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--accent-purple);
  color: var(--accent-purple);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-xl);
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.story-download-btn:hover {
  background: var(--gradient-main);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
}
.story-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.story-download-btn.downloading {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Results error / empty state */
.results-error {
  display: none;
  text-align: center;
  padding: 60px 20px;
}
.results-error.active { display: block; }
.error-icon { font-size: 3rem; margin-bottom: 16px; }
.results-error h3 { font-size: 1.2rem; margin-bottom: 8px; }
.results-error p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }
.btn-try-again {
  padding: 12px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
  border-radius: var(--radius-xl);
  transition: var(--transition);
}
.btn-try-again:hover { border-color: var(--accent-purple); }

/* Ad inserted between story items */
.story-list .ad-zone--inline {
  min-height: 100px;
  border-radius: var(--radius-md);
  margin: 4px 0;
  border: 1px solid var(--border-color);
}

/* ===== SCROLL TO TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 800;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(168,85,247,0.3);
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover { transform: translateY(-3px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-btn { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10,10,26,0.98);
    backdrop-filter: blur(16px);
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
  }
  .hero { padding: 130px 0 60px; }
  .search-box { flex-direction: column; }
  .search-box .btn-search { width: 100%; padding: 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .profile-header { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .profile-stats { width: 100%; display: flex; gap: 20px; justify-content: center; padding-top: 12px; border-top: 1px solid var(--border-color); }
  .story-item { flex-wrap: wrap; }
  .story-download-btn { width: 100%; text-align: center; }
  .download-all-bar { flex-direction: column; gap: 12px; text-align: center; }
  .btn-download-all { width: 100%; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .content-tabs { gap: 6px; }
  .tab-btn { padding: 8px 14px; font-size: 0.8rem; }
  .story-thumb { width: 56px; height: 74px; }
}
