/* Snaptik – brand: #2563EB → #06B6D4. No other accent colors. */
:root,
[data-theme="dark"] {
  --brand: linear-gradient(90deg, #2563EB, #06B6D4);
  --primary: #2563EB;
  --secondary: #06B6D4;
  --bg: #000000;
  --card: #0A0A0A;
  --border: #1F1F23;
  --input: #111113;
  --text: #FFFFFF;
  --muted: #A1A1AA;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --card: #F6F7F9;
  --border: #E5E7EB;
  --input: #FFFFFF;
  --text: #0A0A0A;
  --muted: #52525B;
  --shadow: 0 10px 30px rgba(10, 10, 10, .08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
html[lang="ar"] body { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif; line-height: 1.75; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary) 35%, transparent);
}

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

/* Gradient text: logo + H1 */
.brand-text {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo__icon { width: 32px; height: 32px; stroke: none; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav__link { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.nav__link:hover, .nav__link.is-active { color: var(--text); background: var(--card); text-decoration: none; }
.header__actions { display: flex; align-items: center; gap: 8px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600;
}
.btn-icon:hover { border-color: var(--primary); }
.nav-toggle { display: none; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* Language menu */
.lang { position: relative; }
.lang summary { list-style: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang__menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  width: 240px; max-height: 360px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.lang__menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.lang__menu a:hover, .lang__menu a.is-active { background: var(--input); text-decoration: none; }
.lang__menu a.is-active { box-shadow: inset 3px 0 0 var(--primary); }
.lang__badge { width: 24px; font-size: .7rem; font-weight: 700; color: var(--muted); }

/* Hero + form */
.hero { padding: 64px 0 40px; text-align: center; }
.hero__inner { display: flex; flex-direction: column; align-items: center; }
.hero__title { max-width: 900px; font-size: clamp(1.75rem, 4.6vw, 2.9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.hero__sub { max-width: 620px; font-size: 1.1rem; }

.search { display: flex; gap: 10px; width: 100%; max-width: 760px; margin-top: 12px; }
.search__box {
  position: relative; flex: 1; display: flex; align-items: center;
  background: var(--input); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.search__box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.search__icon { position: absolute; inset-inline-start: 16px; color: var(--muted); }
.search__input {
  flex: 1; min-width: 0; height: 58px; padding: 0 12px; padding-inline-start: 48px;
  background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 1rem;
}
.search__input::placeholder { color: var(--muted); }
.search__paste {
  margin-inline-end: 8px; height: 40px; padding: 0 14px;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.search__paste:hover { border-color: var(--primary); }
.search__error {
  width: 100%; max-width: 760px; margin: 12px 0 0; padding: 12px 16px; text-align: start;
  background: var(--card); border: 1px solid var(--border); border-inline-start: 3px solid var(--primary); border-radius: 10px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 58px; padding: 0 28px; border: 0; border-radius: 14px;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn--brand { background: var(--brand); color: #FFFFFF; }
.btn--brand:hover { filter: brightness(1.08); }
.btn--ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--primary); }
.btn--sm { height: 46px; padding: 0 18px; border-radius: 12px; font-size: .95rem; }
.btn[disabled] { opacity: .7; cursor: wait; }

.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #FFFFFF; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.tab { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.tab:hover { color: var(--text); text-decoration: none; border-color: var(--primary); }
.tab.is-active { color: #FFFFFF; background: var(--brand); border-color: transparent; }

/* Result */
.result {
  width: 100%; max-width: 760px; margin-top: 24px; padding: 20px; text-align: start;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.result__head { display: flex; gap: 16px; }
.result__cover { width: 120px; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--input); flex-shrink: 0; }
.result__meta { min-width: 0; flex: 1; }
.result__author { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.result__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--input); }
.result__title { margin: 0 0 12px; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.result__actions { display: flex; flex-direction: column; gap: 10px; }
.result__actions .btn { width: 100%; justify-content: space-between; }
.result__size { font-weight: 500; opacity: .85; font-size: .85rem; }
.result__again { margin-top: 14px; width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.gallery__item { display: flex; flex-direction: column; gap: 8px; }
.gallery__item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--input); }
.gallery__item .btn { width: 100%; }

/* Sections */
.section { padding: 48px 0; }
.section__title { text-align: center; font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 28px; letter-spacing: -.02em; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px;
  border-radius: 10px; background: var(--brand); color: #FFFFFF; font-weight: 800;
}
.step p, .feature p { margin: 0; }
.step { display: flex; flex-direction: column; }
.step__img {
  margin: 16px 0 0; margin-top: auto; padding-top: 16px;
}
.step__img img {
  display: block; width: 100%; height: 200px; object-fit: contain;
  background: var(--input); border: 1px solid var(--border); border-radius: 12px;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid--tools { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature__icon { width: 28px; height: 28px; color: var(--secondary); margin-bottom: 10px; }
.tool { display: flex; flex-direction: column; gap: 4px; color: var(--text); transition: border-color .15s; }
.tool:hover { border-color: var(--primary); text-decoration: none; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq__item { padding: 0; }
.faq__item summary { cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq__item[open] summary::after { content: "−"; }
.faq__item p { padding: 0 22px 18px; margin: 0; }

/* Long-form SEO article */
.article { font-size: 1.02rem; line-height: 1.75; }
.article h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); margin: 44px 0 14px; letter-spacing: -.01em; }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1.1rem; margin: 26px 0 8px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 18px; padding-inline-start: 22px; }
.article li { margin-bottom: 8px; }
.article li::marker { color: var(--primary); font-weight: 700; }
.article a { font-weight: 600; }

/* Legal pages */
.legal__title { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 8px; }
.legal__updated { margin: 0 0 20px; font-size: .9rem; }
.legal__intro { font-size: 1.08rem; line-height: 1.75; margin-bottom: 24px; }
.legal__toc { margin-bottom: 36px; padding: 18px 22px; }
.legal__toc ol { margin: 10px 0 0; padding-inline-start: 20px; columns: 2; column-gap: 32px; }
.legal__toc li { margin-bottom: 6px; break-inside: avoid; }
.legal__toc a { color: var(--muted); }
.legal__toc a:hover { color: var(--text); }
.legal .article h2 { scroll-margin-top: 84px; }
.legal__related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }

/* Contact page */
.hero--small { padding: 48px 0 8px; }
.section--tight { padding: 20px 0; }
.contact__topics { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.contact__topic { color: var(--text); transition: border-color .15s, transform .15s; }
.contact__topic:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-2px); }
.contact__topic h2 { font-size: 1.05rem; margin-bottom: 6px; }
.contact__topic p { margin: 0; font-size: .95rem; }
.contact__layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.contact__form h2, .contact__side h2 { font-size: 1.2rem; margin-bottom: 16px; }
.contact__side { display: flex; flex-direction: column; gap: 20px; }
.contact__email { font-weight: 700; font-size: 1.05rem; word-break: break-all; }
.contact__list { margin: 0; padding-inline-start: 20px; }
.contact__list li { margin-bottom: 10px; color: var(--muted); }
.contact__note { font-size: .88rem; margin: 4px 0 16px; }
.contact__success { text-align: center; padding: 24px 8px; }
.contact__success svg { width: 48px; height: 48px; color: var(--secondary); margin-bottom: 8px; }
.contact__form .search__error { margin: 0 0 16px; max-width: none; }
.contact__form .search__error p { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--input); border: 1px solid var(--border); border-radius: 12px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 150px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.field [aria-invalid="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.field--hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 820px) {
  .contact__layout, .field-row { grid-template-columns: 1fr; }
  .legal__toc ol { columns: 1; }
}

/* How To Use guides */
.guides { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); transition: border-color .15s, transform .15s; }
.guide-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.guide-card__img { width: 100%; height: 180px; object-fit: contain; background: var(--input); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; }
.guide-card__tag { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: #FFFFFF; font-size: .78rem; font-weight: 700; }
.guide-card h2 { font-size: 1.2rem; margin: 2px 0 0; }
.guide-card p { margin: 0; }
.guide-card__more { margin-top: auto; padding-top: 6px; color: var(--primary); font-weight: 600; }
.breadcrumb { font-size: .9rem; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; }
.guide__title { font-size: clamp(1.8rem, 4.5vw, 2.5rem); }
.guide__meta { font-size: .9rem; margin: 0 0 18px; }
.guide__intro { font-size: 1.08rem; line-height: 1.75; }
.guide h2 { margin-top: 32px; }
.guide__steps { list-style: none; padding: 0; margin: 0; counter-reset: gs; display: flex; flex-direction: column; gap: 12px; }
.guide__step { counter-increment: gs; display: grid; grid-template-columns: 1fr 180px; gap: 18px; align-items: center; }
.guide__step h3::before { content: counter(gs); display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-inline-end: 10px; border-radius: 8px; background: var(--brand); color: #FFFFFF; font-size: .9rem; }
.guide__step p { margin: 0; }
.guide__step img { width: 100%; height: 130px; object-fit: contain; background: var(--input); border: 1px solid var(--border); border-radius: 10px; }
.guide__cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; border-color: var(--primary); }
.guide__cta p { margin: 0; }
.guide__more-title { font-size: 1.2rem; }
@media (max-width: 820px) {
  .guides { grid-template-columns: 1fr; }
  .guide__step { grid-template-columns: 1fr; }
}

.prose h1 { font-size: 2.2rem; margin-bottom: 24px; }
.prose h2 { font-size: 1.2rem; margin-top: 28px; }
.prose p { color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 36px 0 24px; margin-top: 32px; font-size: .92rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__inner p { max-width: 420px; margin-top: 8px; }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--text); }
.footer__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .85rem; }

/* Mobile */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 64px; inset-inline: 0;
    flex-direction: column; padding: 12px 20px; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav.is-open { display: flex; }
  .header__actions { margin-inline-start: auto; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 0 24px; }
  .search { flex-direction: column; }
  .search__submit { width: 100%; }
  .result__head { flex-direction: column; }
  .result__cover { width: 100%; max-height: 320px; aspect-ratio: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Star rating (real votes only) */
.rating { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 20px; }
.rating__title { margin: 0; font-weight: 600; font-size: .95rem; }
.rating__stars { display: flex; flex-direction: row-reverse; gap: 6px; }
.rating__star {
  padding: 2px; border: 0; background: none; cursor: pointer; line-height: 0;
  color: #4B5563; transition: color .15s, transform .15s;
}
.rating__star svg { width: 32px; height: 32px; fill: currentColor; }
.rating__star.is-on { color: #FBBF24; }
.rating:not(.is-done) .rating__stars:hover .rating__star { color: #4B5563; }
.rating:not(.is-done) .rating__stars .rating__star:hover,
.rating:not(.is-done) .rating__stars .rating__star:hover ~ .rating__star { color: #FBBF24; }
.rating:not(.is-done) .rating__star:hover { transform: scale(1.12); }
.rating__star:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.rating.is-done .rating__star { cursor: default; }
.rating__summary, .rating__thanks { margin: 0; font-size: .9rem; }
.rating__thanks { color: var(--secondary); font-weight: 600; }

/* Star rating v2: hidden until a result, then shown inside the result box */
.rating[hidden] { display: none; }
.result .rating { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
