/* ============================================================
   VidGrab – Main Stylesheet
   Aesthetic: Bold editorial + deep navy/electric accent
   ============================================================ */

:root {
  --bg:          #0a0e1a;
  --bg2:         #111827;
  --bg3:         #1c2539;
  --surface:     #1e2840;
  --border:      #2d3a55;
  --accent:      #3b82f6;
  --accent-2:    #06b6d4;
  --accent-glow: rgba(59,130,246,.35);
  --red:         #ef4444;
  --green:       #22c55e;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-faint:  #4b5c7a;
  --font-head:   'Sora', sans-serif;
  --font-body:   'Space Grotesk', sans-serif;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,.5);
  --transition:  .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

/* ── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p  { color: var(--text-muted); line-height: 1.8; }
a  { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section    { padding: 60px 0; }
.section-sm { padding: 40px 0; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,14,26,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-family: var(--font-head); font-weight: 800;
  font-size: 1.4rem; text-decoration: none;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; box-shadow: 0 0 16px var(--accent-glow);
}
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  transition: color var(--transition);
}
.main-nav a:hover { color: var(--text); }
.nav-toggle {
  display: none; background: none; border: none;
  color: var(--text); font-size: 1.5rem; cursor: pointer;
}

/* ── Hero Section ───────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,.12) 0%, transparent 70%);
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1' fill='%232d3a55' opacity='.4'/%3E%3C/svg%3E");
  opacity: .4;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3);
  color: var(--accent); border-radius: 100px;
  padding: 6px 16px; font-size: .85rem; font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 { margin-bottom: 16px; }
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p.lead { max-width: 580px; margin: 0 auto 40px; font-size: 1.1rem; }

/* ── Downloader Card ────────────────────────────────────── */
.downloader-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto;
}
.format-tabs {
  display: flex; gap: 8px; margin-bottom: 24px;
}
.tab-btn {
  flex: 1; padding: 10px; border: 2px solid var(--border);
  background: transparent; color: var(--text-muted);
  border-radius: var(--radius); font-family: var(--font-body);
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }
.tab-btn.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; box-shadow: 0 0 16px var(--accent-glow);
}
.input-row {
  display: flex; gap: 12px; align-items: stretch;
}
.url-input {
  flex: 1; padding: 14px 18px;
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: 1rem;
  transition: border-color var(--transition);
  outline: none;
}
.url-input::placeholder { color: var(--text-faint); }
.url-input:focus { border-color: var(--accent); }
.btn {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.btn:active { transform: translateY(0); }
.btn-sm  { padding: 9px 18px; font-size: .9rem; }
.btn-red { background: var(--red); box-shadow: 0 0 16px rgba(239,68,68,.3); }
.btn-green { background: var(--green); box-shadow: 0 0 16px rgba(34,197,94,.3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Loading Spinner ────────────────────────────────────── */
.spinner {
  display: none; width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
  margin: 24px auto 0;
}
.spinner.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result Card ────────────────────────────────────────── */
#resultArea { margin-top: 28px; display: none; }
.video-meta {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--bg3); border-radius: var(--radius);
  padding: 18px; margin-bottom: 20px;
}
.video-thumb {
  width: 160px; height: 90px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
}
.video-info h3 { font-size: 1rem; margin-bottom: 8px; color: var(--text); }
.video-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .78rem; padding: 3px 10px;
  border-radius: 100px;
}
.formats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.format-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--transition);
}
.format-item:hover { border-color: var(--accent); }
.format-label {
  font-weight: 700; font-size: 1rem; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.format-detail { font-size: .8rem; color: var(--text-muted); }
.progress-bar-wrap {
  height: 4px; background: var(--bg2); border-radius: 2px;
  overflow: hidden; margin-top: 4px;
}
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s;
}
#errorMsg {
  display: none; background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3); color: #fca5a5;
  border-radius: var(--radius); padding: 14px 18px;
  margin-top: 16px;
}

/* ── Features Grid ──────────────────────────────────────── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.feature-icon {
  font-size: 2rem; margin-bottom: 16px;
  background: var(--bg3); width: 56px; height: 56px;
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.feature-card h3 { margin-bottom: 8px; font-size: 1.05rem; }

/* ── Steps ──────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 32px; }
.step { text-align: center; }
.step-num {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.3rem; font-weight: 800;
  margin: 0 auto 16px; box-shadow: 0 0 20px var(--accent-glow);
}
.step h3 { margin-bottom: 8px; }

/* ── FAQ ────────────────────────────────────────────────── */
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border); padding: 20px 0;
}
.faq-q {
  background: none; border: none; color: var(--text);
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 600;
  cursor: pointer; width: 100%; text-align: left;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 0;
}
.faq-q .arrow { color: var(--accent); transition: transform var(--transition); font-size: 1.2rem; }
.faq-q.open .arrow { transform: rotate(45deg); }
.faq-a { display: none; padding-top: 12px; }
.faq-a p { color: var(--text-muted); }

/* ── AdSense Banners ────────────────────────────────────── */
.ad-banner-wrap { background: var(--bg2); border-top: 1px solid var(--border); padding: 20px 0; }

/* ── Content Pages ──────────────────────────────────────── */
.content-page { padding: 60px 0; max-width: 800px; margin: 0 auto; }
.content-page h1 { margin-bottom: 8px; }
.content-page .date { color: var(--text-faint); margin-bottom: 36px; font-size: .9rem; }
.content-page h2 { margin: 36px 0 12px; color: var(--text); }
.content-page p  { margin-bottom: 16px; }
.content-page ul { list-style: disc; padding-left: 24px; color: var(--text-muted); }
.content-page ul li { margin-bottom: 8px; }

/* ── Blog ───────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 28px; }
.blog-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.blog-card-body { padding: 24px; }
.blog-cat {
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}
.blog-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--text); }
.blog-card p  { font-size: .9rem; }
.blog-date { font-size: .8rem; color: var(--text-faint); margin-top: 16px; }

/* ── Contact Form ───────────────────────────────────────── */
.contact-form { max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .95rem; }
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: 1rem; outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 140px; }
.form-success {
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3);
  color: #86efac; border-radius: var(--radius); padding: 14px 18px;
  display: none;
}

/* ── Section Headers ────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header p { max-width: 540px; margin: 12px auto 0; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 60px 0 0;
}
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; padding-bottom: 48px;
}
.footer-tagline { color: var(--text-muted); font-size: .9rem; margin-top: 12px; max-width: 220px; }
.footer-links h4 { color: var(--text); font-size: .9rem; font-weight: 700; margin-bottom: 16px; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links ul li a { color: var(--text-muted); font-size: .9rem; }
.footer-links ul li a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 20px 0;
  text-align: center;
}
.footer-bottom p { font-size: .85rem; color: var(--text-faint); margin-bottom: 4px; }
.footer-legal-note { font-size: .78rem !important; max-width: 680px; margin: 4px auto 0 !important; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb { padding: 16px 0; }
.breadcrumb a { color: var(--text-muted); font-size: .9rem; }
.breadcrumb span { color: var(--text-faint); font-size: .9rem; }
.breadcrumb .sep { margin: 0 8px; color: var(--text-faint); }

/* ── Utilities ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-32 { margin-bottom: 32px; }
.badge {
  background: rgba(59,130,246,.15); color: var(--accent);
  border: 1px solid rgba(59,130,246,.25); border-radius: 6px;
  font-size: .78rem; font-weight: 700; padding: 3px 10px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-nav { display: none; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--bg2);
    border-bottom: 1px solid var(--border); padding: 20px; gap: 16px; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .site-header { position: relative; }
  .input-row { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .video-meta { flex-direction: column; }
  .video-thumb { width: 100%; height: 180px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .downloader-card { padding: 20px; }
}
