﻿/* =====================================================
   UnduhTik - Professional LIGHT theme
   Load order in HTML: style.css -> theme.css
   (brand.css is not needed any more)
   ===================================================== */

:root {
  color-scheme: light;

  --body-top: #c9def5;
  --body-mid: #dbe9f8;
  --glow: rgba(190, 24, 93, 0.08);
  --header-bg: rgba(214, 230, 247, 0.88);
  --nav: #1e3a5f;
  --ad-bg: rgba(255, 255, 255, 0.35);
  --tool-a: #e8f2fd;
  --tool-b: #d2e4f6;
  --input-bg: #f8fbff;
  --result-bg: #f1f7fd;
  --footer-bg: #d3e3f4;
  --err: #b91c1c;
  --logo-a: #0b6580;
  --logo-b: #be185d;

  --bg: #e4eefa;            /* soft sky blue page */
  --surface: #f3f8fe;       /* cards: very light blue, not pure white */
  --surface-2: #e6eff9;
  --line: #c8daee;
  --line-strong: #aec6e0;

  --text: #0f172a;        /* headings + main text */
  --text-muted: #3b4b63;  /* paragraphs (high contrast on white) */
  --text-soft: #53647d;   /* placeholders, small labels */

  --accent: #0b6580;      /* links, focus */
  --accent-dark: #0a4f66;
  --accent-2: #be185d;
  --grad: linear-gradient(90deg, #0b6580 0%, #be185d 100%);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 36px rgba(30, 64, 120, 0.14);
  --shadow-sm: 0 2px 10px rgba(30, 64, 120, 0.08);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
html, body { background: var(--bg); }

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(800px 380px at 85% -60px, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--body-top) 0, var(--body-mid) 340px, var(--bg) 640px);
  background-repeat: no-repeat;
}

h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.02em; line-height: 1.2; }
p { color: var(--text-muted); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

::selection { background: rgba(14, 116, 144, 0.25); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: 1120px; padding: 12px 20px; }

.logo { color: var(--text); gap: 10px; }
.logo-text { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.logo-text .b-u { color: var(--text); }
.logo-text .b-t {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* darker logo icon colors so it is visible on white */
#utg stop:first-child { stop-color: var(--logo-a); }
#utg stop:last-child { stop-color: var(--logo-b); }

.main-nav { gap: 6px; }
.main-nav a {
  color: var(--nav);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.main-nav a:hover { color: var(--accent); background: var(--surface-2); }

.lang-switcher {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
}
.lang-switcher option { background: var(--surface); color: var(--text); }

.hamburger {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  line-height: 1;
}

@media (max-width: 720px) {
  .main-nav.open {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    gap: 2px;
    padding: 10px 16px 14px;
  }
}

/* ---------- In-app warning ---------- */
.in-app-warning { background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; }
.in-app-warning button { color: #78350f; }

/* ---------- Ad slots ---------- */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}
.ad-label { color: var(--text-soft); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero { max-width: 780px; padding: 64px 20px 28px; }
.hero h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 14px;
  color: var(--text);
}
.hero-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

/* ---------- Tool box ---------- */
.tool-box {
  background: linear-gradient(180deg, var(--tool-a) 0%, var(--tool-b) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.tool-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: var(--grad);
}

.input-row input,
#tiktokUrl {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#tiktokUrl::placeholder { color: var(--text-soft); opacity: 1; }
.input-row input:focus,
#tiktokUrl:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.18);
}
.input-row input.input-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ---------- Buttons ---------- */
.btn-main,
.btn-result.primary {
  background: var(--grad);
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.btn-main:hover,
.btn-result.primary:hover {
  background: var(--grad);
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(14, 116, 144, 0.28);
  opacity: 1;
}
.btn-main:disabled:hover { background: var(--grad); transform: none; box-shadow: none; }
.btn-spinner { border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; }

.btn-paste,
.btn-result.secondary,
.btn-result.tertiary,
.btn-result.copy-btn,
.copy-btn {
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-paste:hover,
.btn-result.secondary:hover,
.btn-result.tertiary:hover,
.btn-result.copy-btn:hover,
.copy-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent-dark);
  opacity: 1;
}

.status { color: var(--text-muted); }
.status.error { color: var(--err); }

/* ---------- Result ---------- */
.result,
.slideshow-result {
  background: var(--result-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 24px;
}
.result img { border-radius: 12px; border: 1px solid var(--line); }
.result h3, .slideshow-result h3 { font-size: 16px; color: var(--text); }
.result p, .slideshow-result p { color: var(--text-muted); }

.slide-card { background: var(--surface-2); border: 1px solid var(--line); }
.slide-download {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.slide-download:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Sections ---------- */
.guide-section,
.features-section,
.faq-section { margin: 72px auto; max-width: 880px; }
.seo-content { margin: 72px auto; max-width: 1040px; }

.guide-section h2,
.features-section h2,
.faq-section h2,
.seo-content h2 {
  color: var(--text);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.seo-content h2 { margin-bottom: 16px; }
.seo-intro { color: var(--text-muted); font-size: 16px; }
.seo-content > p { color: var(--text-muted); max-width: 720px; margin-left: auto; margin-right: auto; }
.seo-links { line-height: 2; }
.seo-links a { color: var(--accent); font-weight: 600; }
.seo-links a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- Cards ---------- */
.guide-step,
.features-list li,
.seo-card,
.faq-section details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.guide-step:hover,
.features-list li:hover,
.seo-card:hover {
  border-color: rgba(14, 116, 144, 0.45);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: none;
}

.guide-step { padding: 28px 22px; }
.guide-step h3, .seo-card h3 { color: var(--text); font-size: 17px; margin-bottom: 8px; }
.guide-step p, .seo-card p, .features-list span { color: var(--text-muted); font-size: 14px; line-height: 1.7; }

.step-number { background: var(--grad); color: #fff; font-weight: 800; width: 38px; height: 38px; }

.features-list li { padding: 20px 22px; }
.features-list strong { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.features-list li::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
  margin-bottom: 12px;
}

.seo-card { padding: 26px; }
.seo-icon { margin-bottom: 12px; }

/* ---------- FAQ ---------- */
.faq-section details { padding: 0; margin-bottom: 12px; overflow: hidden; }
.faq-section summary {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 18px 52px 18px 20px;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s;
}
.faq-section details[open] { border-color: rgba(14, 116, 144, 0.45); }
.faq-section details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-section details p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.75;
}

/* ---------- Toast ---------- */
.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid #dc2626;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
}
.toast-success { color: var(--text); border-left-color: #16a34a; }
.toast-close { color: var(--text-soft); }
.toast-close:hover { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 48px 20px 28px;
}
.footer-brand .logo-text { font-size: 20px; }
.footer-brand p { color: var(--text-muted); }
.footer-links { gap: 10px 22px; padding-top: 4px; }
.footer-links a { color: var(--nav); font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-copy { color: var(--text-soft); border-top: 1px solid var(--line-strong); padding-top: 20px; margin-top: 8px; }

/* ---------- Legal / contact pages ---------- */
.legal-page h1 { color: var(--text); }
.legal-page h2 { color: var(--accent); }
.legal-page p { color: var(--text-muted); }
.contact-box { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }

/* ---------- Step illustrations ---------- */
.step-illus {
  max-width: 330px;
  margin: 0 auto 18px;
  padding: 6px;
  background: linear-gradient(180deg, var(--tool-a) 0%, var(--tool-b) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.step-illus svg { display: block; width: 100%; height: auto; }
.guide-step { display: flex; flex-direction: column; align-items: center; }

/* =====================================================
   DARK THEME  (auto from phone/PC setting, or toggle button)
   ===================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b1220;
  --surface: #121c2e;
  --surface-2: #18253b;
  --line: #223250;
  --line-strong: #324a70;

  --text: #f1f5f9;
  --text-muted: #b4c0d4;
  --text-soft: #8d9bb3;

  --accent: #5fd0ea;
  --accent-dark: #9be7f7;
  --accent-2: #f472b6;

  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);

  --body-top: #112040;
  --body-mid: #0e1a30;
  --glow: rgba(244, 114, 182, 0.10);
  --header-bg: rgba(11, 18, 32, 0.86);
  --nav: #cbd5e1;
  --ad-bg: rgba(255, 255, 255, 0.04);
  --tool-a: #16253f;
  --tool-b: #101c33;
  --input-bg: #0d1626;
  --result-bg: #0f1a2e;
  --footer-bg: #08101d;
  --err: #fca5a5;
  --logo-a: #22d3ee;
  --logo-b: #f472b6;
}
:root[data-theme="dark"] ::selection { background: rgba(95, 208, 234, 0.3); color: #fff; }
:root[data-theme="dark"] .toast { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6); }
:root[data-theme="dark"] .in-app-warning { background: #3a2f0b; color: #fde68a; border-bottom-color: #5c4a10; }
:root[data-theme="dark"] .in-app-warning button { color: #fde68a; }
:root[data-theme="dark"] .step-illus svg { filter: brightness(.96); }

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .hero { padding-top: 40px; }
  .hero-subtitle { font-size: 15px; }
  .tool-box { padding: 20px 16px; border-radius: 16px; }
  .guide-section, .features-section, .faq-section, .seo-content { margin: 52px auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation-duration: 0.01ms !important; }
}
/* Dark mode contrast fixes */
:root { --grad-text: linear-gradient(90deg, #0b6580, #be185d); }
:root[data-theme="dark"] { --grad-text: linear-gradient(90deg, #22d3ee, #f472b6); }
.logo-text .b-t { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="dark"] .slide-download:hover { color: #08101d; }

/* FAQ focus ring clip na ho */
.faq-section summary:focus-visible { outline-offset: -3px; }

/* Mobile par bade touch targets */
.lang-switcher, .hamburger, .theme-toggle { min-height: 44px; }
.hamburger, .theme-toggle { min-width: 44px; }
/* ===== Small fixes (review) ===== */

/* 1. Rang-birangi patti box ke gol kinaron se bahar na nikle */
.tool-box { overflow: hidden; }

/* 2. Arabic (RTL): mobile header aur FAQ ka "+" sahi jagah par */
@media (max-width: 720px) {
  .header-right { margin-left: 0; margin-inline-start: auto; }
}
[dir="rtl"] .faq-section summary { padding: 18px 20px 18px 52px; }
[dir="rtl"] .faq-section summary::after { right: auto; left: 20px; }

/* 3. Mobile par touch buttons 44px */
@media (max-width: 720px) {
  .theme-toggle, .hamburger {
    flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  }
}

/* 4. Reduced-motion mein loading spinner chalta rahe (dheere) */
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 1.5s !important; animation-iteration-count: infinite !important; }
}

[dir="rtl"] .seo-grid, [dir="rtl"] .error { text-align: right; }

/* Language dropdown: fixed small width on phones (shows ID, EN, MS...) */
@media (max-width: 720px) {
  .header-right .lang-switcher { width: 64px; max-width: 64px; }
}