/* ==========================================================================
   ZHH WhatsApp Chat Link Generator — style.css
   Pure CSS. No frameworks. Mobile-first, responsive, glassmorphism + blue.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --blue-50: #eef4ff;
  --blue-100: #dbe7ff;
  --blue-300: #93b4ff;
  --blue-500: #2f6bff;
  --blue-600: #1e53e6;
  --blue-700: #1741b6;

  --bg: #ffffff;
  --bg-soft: #f6f9ff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(20, 40, 90, 0.10);
  --text: #0d1a33;
  --text-soft: #566180;
  --success: #14a06b;
  --danger: #e0405a;

  --grad: linear-gradient(135deg, var(--blue-500), #6a8bff 55%, #00c2ff);
  --grad-soft: linear-gradient(135deg, var(--blue-50), #f7fbff);

  --shadow-sm: 0 2px 10px rgba(20, 40, 90, 0.06);
  --shadow: 0 18px 40px -22px rgba(20, 40, 90, 0.35);
  --shadow-lg: 0 40px 90px -40px rgba(20, 45, 110, 0.45);

  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 68px;
}

html[data-theme="dark"] {
  --bg: #070b16;
  --bg-soft: #0b1222;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-solid: #101829;
  --border: rgba(255, 255, 255, 0.10);
  --text: #eaf0ff;
  --text-soft: #9aa8c7;
  --blue-50: #131e38;
  --blue-100: #1a2748;
  --grad-soft: linear-gradient(135deg, #101a33, #0b1222);
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue-300); outline-offset: 2px; border-radius: 8px; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: 20px; }
.section { padding: 84px 0; }
.section--soft { background: var(--bg-soft); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.eyebrow {
  display: inline-block; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700; color: var(--blue-600); background: var(--blue-50);
  padding: 7px 14px; border-radius: var(--r-pill); margin-bottom: 14px;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: clamp(1.65rem, 4vw, 2.4rem); }
h3 { font-size: 1.05rem; font-weight: 700; }
.lead { color: var(--text-soft); font-size: 1.02rem; margin-top: 10px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200; background: var(--blue-600);
  color: #fff; padding: 10px 16px; border-radius: 0 0 12px 12px; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- Background glow ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 420px; height: 420px; background: #79a0ff; top: -140px; left: -100px; }
.aurora span:nth-child(2) { width: 360px; height: 360px; background: #6ee7ff; top: 120px; right: -120px; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 380px; height: 380px; background: #b9c9ff; bottom: -160px; left: 40%; animation-delay: -12s; }
@keyframes drift { to { transform: translate3d(30px, -40px, 0) scale(1.12); } }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 60; height: var(--nav-h);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.nav__inner { display: flex; align-items: center; gap: 16px; height: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; }
.logo__mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 0.82rem; font-weight: 800;
  box-shadow: 0 8px 20px -8px var(--blue-500);
}
.logo__text small { display: block; font-size: 0.66rem; font-weight: 600; color: var(--text-soft); letter-spacing: 0.06em; }
.nav__links { display: none; margin-left: auto; gap: 4px; }
.nav__links a {
  padding: 9px 14px; border-radius: var(--r-pill); font-size: 0.92rem; font-weight: 600;
  color: var(--text-soft); transition: color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--blue-600); background: var(--blue-50); }
.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav__links + .nav__actions { margin-left: 0; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.nav__burger { display: grid; }
.nav__drawer {
  position: fixed; inset: var(--nav-h) 0 auto; z-index: 55; display: grid; gap: 4px;
  padding: 16px 20px 24px; background: var(--bg); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow); transform: translateY(-120%); transition: transform 0.35s var(--ease);
}
.nav__drawer.is-open { transform: translateY(0); }
.nav__drawer a { padding: 12px 14px; border-radius: 14px; font-weight: 600; }
.nav__drawer a:hover { background: var(--blue-50); color: var(--blue-600); }

@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__burger, .nav__drawer { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 22px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.95rem;
  border: 1px solid transparent; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 16px 30px -16px var(--blue-500); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -18px var(--blue-500); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { transform: translateY(-2px); background: var(--blue-50); color: var(--blue-600); }
.btn--block { width: 100%; padding-block: 17px; font-size: 1rem; }
.btn--sm { padding: 10px 16px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
  background: rgba(255, 255, 255, 0.45); animation: ripple 0.6s var(--ease) forwards;
}
.btn--ghost .ripple { background: rgba(47, 107, 255, 0.28); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- Cards / glass ---------- */
.glass {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-lg);
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 72px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 6.4vw, 3.5rem); margin-bottom: 16px; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-soft); font-size: clamp(1rem, 2.4vw, 1.12rem); max-width: 620px; margin: 0 auto; }
.hero__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; color: var(--text-soft);
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* ---------- Generator card ---------- */
.gen { max-width: 720px; margin: 40px auto 0; padding: clamp(22px, 4vw, 38px); text-align: left; }
.field { margin-bottom: 22px; }
.field__label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.field__label label { font-weight: 700; font-size: 0.93rem; }
.hint { font-size: 0.78rem; color: var(--text-soft); font-weight: 600; }
.control {
  display: flex; align-items: stretch; gap: 10px; background: var(--surface-solid);
  border: 1.5px solid var(--border); border-radius: var(--r); padding: 6px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.control:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue-500) 16%, transparent); }
.control select, .control input, .control textarea {
  width: 100%; border: 0; background: transparent; padding: 12px 12px; border-radius: 12px;
}
.control select { max-width: 138px; border-right: 1.5px solid var(--border); border-radius: 12px 0 0 12px; font-weight: 700; cursor: pointer; }
.control textarea { resize: vertical; min-height: 118px; }
.control select:focus, .control input:focus, .control textarea:focus { outline: none; }
.control.is-invalid { border-color: var(--danger); animation: shake 0.4s var(--ease); }
@keyframes shake {
  25% { transform: translateX(-7px); } 50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); } 100% { transform: translateX(0); }
}
.error {
  display: none; align-items: center; gap: 7px; margin-top: 8px; color: var(--danger);
  font-size: 0.83rem; font-weight: 600;
}
.error.is-shown { display: flex; animation: fadeUp 0.3s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

.preview {
  margin: 4px 0 24px; padding: 14px 16px; border-radius: var(--r);
  background: var(--grad-soft); border: 1px dashed var(--border);
  font-size: 0.86rem; word-break: break-all; color: var(--text-soft);
}
.preview strong { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-600); margin-bottom: 5px; }
.preview code { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; color: var(--text); }

/* ---------- Skeleton ---------- */
.skeleton { display: none; margin-top: 26px; }
.skeleton.is-shown { display: grid; gap: 12px; }
.skeleton__bar { height: 16px; border-radius: 10px; background: var(--blue-100); position: relative; overflow: hidden; }
.skeleton__bar:nth-child(2) { width: 88%; } .skeleton__bar:nth-child(3) { width: 62%; height: 44px; }
.skeleton__bar::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.25s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Output ---------- */
.output { display: none; margin-top: 28px; padding: 22px; border-radius: var(--r-lg); background: var(--grad-soft); border: 1px solid var(--border); }
.output.is-shown { display: block; animation: pop 0.45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.output__title { display: flex; align-items: center; gap: 9px; font-weight: 800; margin-bottom: 14px; }
.output__title svg { width: 20px; height: 20px; color: var(--success); }
.output__link { display: flex; gap: 10px; align-items: center; }
.output__link input {
  flex: 1; padding: 14px 16px; border-radius: var(--r); border: 1.5px solid var(--border);
  background: var(--surface-solid); font-size: 0.88rem;
}
.output__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.output__actions .btn--block { padding-block: 14px; }
.copied { animation: copied 0.5s var(--ease); }
@keyframes copied { 50% { transform: scale(0.92); } }
@media (min-width: 640px) { .output__actions { grid-template-columns: repeat(4, 1fr); } }

/* ---------- History ---------- */
.history__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  background: var(--surface-solid); border: 1.5px solid var(--border); border-radius: var(--r-pill);
}
.search svg { width: 17px; height: 17px; color: var(--text-soft); flex: none; }
.search input { width: 100%; border: 0; background: transparent; }
.search input:focus { outline: none; }
.history__list { display: grid; gap: 12px; }
.hist {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  animation: fadeUp 0.35s var(--ease);
}
.hist__body { min-width: 0; flex: 1; }
.hist__num { font-weight: 700; font-size: 0.95rem; }
.hist__url { font-size: 0.78rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist__tools { display: flex; gap: 6px; flex: none; }
.hist__tools .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
.hist__tools .icon-btn svg { width: 16px; height: 16px; }
.is-fav { color: #f0a500; }
.empty { text-align: center; padding: 46px 20px; border: 1px dashed var(--border); border-radius: var(--r-lg); background: var(--surface); }
.empty__art { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 22px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 18px 30px -18px var(--blue-500); }
.empty__art svg { width: 30px; height: 30px; }
.empty p { color: var(--text-soft); font-size: 0.92rem; margin-top: 6px; }

/* ---------- Features ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.feature { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature__icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); margin-bottom: 14px; }
.feature__icon svg { width: 22px; height: 22px; }
.feature p { color: var(--text-soft); font-size: 0.88rem; margin-top: 6px; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.acc { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.acc__btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; text-align: left; font-weight: 700; font-size: 0.97rem; }
.acc__btn svg { width: 18px; height: 18px; flex: none; color: var(--blue-600); transition: transform 0.3s var(--ease); }
.acc.is-open .acc__btn svg { transform: rotate(180deg); }
.acc__panel { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.acc__panel p { padding: 0 20px 18px; color: var(--text-soft); font-size: 0.9rem; }

/* ---------- Contact ---------- */
.contact { max-width: 620px; margin: 0 auto; padding: 32px; text-align: center; }
.avatar { width: 76px; height: 76px; border-radius: 26px; margin: 0 auto 16px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; box-shadow: 0 20px 36px -20px var(--blue-500); }
.contact__meta { display: grid; gap: 10px; margin: 20px 0 24px; text-align: left; }
.contact__meta div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--bg-soft); font-size: 0.9rem; }
.contact__meta span { color: var(--text-soft); }
.contact__meta b { font-weight: 700; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 32px; }
.footer__top { display: grid; gap: 26px; }
.footer p { color: var(--text-soft); font-size: 0.88rem; margin-top: 10px; max-width: 340px; }
.footer h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 12px; }
.footer__links { display: grid; gap: 8px; font-size: 0.9rem; }
.footer__links a:hover { color: var(--blue-600); }
.social { display: flex; gap: 8px; margin-top: 16px; }
.social a { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); transition: transform 0.2s var(--ease), color 0.2s; }
.social a:hover { transform: translateY(-3px); color: var(--blue-600); }
.social svg { width: 17px; height: 17px; }
.footer__bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: 0.82rem; color: var(--text-soft); }
@media (min-width: 820px) { .footer__top { grid-template-columns: 2fr 1fr 1fr 1fr; } }

/* ---------- Floating actions ---------- */
.fab-stack { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; gap: 10px; justify-items: center; }
.fab {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 18px 34px -16px var(--blue-500);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.fab:hover { transform: translateY(-3px) scale(1.04); }
.fab svg { width: 22px; height: 22px; }
.fab--top { background: var(--surface-solid); color: var(--blue-600); border: 1px solid var(--border); opacity: 0; pointer-events: none; }
.fab--top.is-shown { opacity: 1; pointer-events: auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 90; left: 16px; right: 16px; bottom: 88px; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 11px; max-width: 380px; width: 100%;
  padding: 13px 16px; border-radius: var(--r); background: var(--surface-solid);
  border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 600;
  animation: toastIn 0.35s var(--ease);
}
.toast.is-out { animation: toastOut 0.3s var(--ease) forwards; }
.toast svg { width: 19px; height: 19px; flex: none; }
.toast--ok svg { color: var(--success); }
.toast--err svg { color: var(--danger); }
.toast--info svg { color: var(--blue-600); }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(0.96); } }
@media (min-width: 640px) { .toasts { left: auto; right: 22px; bottom: 22px; justify-items: end; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
