/* ============================================
   Zakhrafa — modern dark theme
   ============================================ */

:root {
  --bg-0: #f7faff;
  --bg-1: #ffffff;
  --bg-2: #eff5ff;
  --card: #ffffff;
  --card-hover: #f8fbff;
  --border: #e3eaf5;
  --border-strong: #c9d4e8;
  --text: #0f1a30;
  --text-dim: #4e5a75;
  --text-faint: #8e98b0;
  --accent-1: #2563eb;       /* primary blue */
  --accent-1-dark: #1d4ed8;
  --accent-1-darker: #1e40af;
  --accent-2: #2563eb;       /* alias — same brand color */
  --success: #10b981;
  --grad: #2563eb;            /* solid color (kept name for compat) */
  --grad-soft: rgba(37, 99, 235, 0.06);
  --shadow-1: 0 6px 22px rgba(37,99,235,.10);
  --shadow-2: 0 2px 10px rgba(15,26,48,.06);
  --shadow-glow: 0 0 30px rgba(37,99,235,.14);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Tajawal', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(900px 600px at 80% -10%, rgba(37,99,235,.08), transparent 60%),
    radial-gradient(700px 500px at 0% 20%,  rgba(37,99,235,.05), transparent 60%);
}

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

/* ============================================
   Header
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--border);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 22px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent-1);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(37,99,235,.32);
}
.brand-text { letter-spacing: -.02em; }

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  transition: all .2s ease;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active {
  color: var(--accent-1);
  background: var(--grad-soft);
  border: 1px solid rgba(37,99,235,.18);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 70px 0 50px;
  text-align: center;
  position: relative;
}
.hero-page { padding: 50px 0 30px; }
.hero-gaming {
  background: linear-gradient(180deg, rgba(37,99,235,.10), transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.hero-badge span { color: var(--accent-2); }

.hero-title {
  font-family: 'Cairo', var(--font);
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.1;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -.02em;
}
.hero-sub {
  display: block;
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 8px;
}

.grad {
  color: var(--accent-1);
}

.hero-text {
  max-width: 680px;
  margin: 16px auto 28px;
  color: var(--text-dim);
  font-size: clamp(15px, 1.6vw, 17px);
}
.hero-text strong { color: var(--text); font-weight: 700; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent-1);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37,99,235,.30);
}
.btn-primary:hover {
  background: var(--accent-1-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37,99,235,.38);
}
.btn-ghost {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-2);
}
.btn-ghost:hover { background: var(--card-hover); border-color: var(--border-strong); }

/* ============================================
   Tabs (homepage)
   ============================================ */
.tabs-section { padding: 30px 0 60px; }
.tabs {
  display: inline-flex;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-2);
}
.tab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  transition: all .2s ease;
}
.tab.active {
  background: var(--accent-1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.30);
}
.tab-pane[hidden] { display: none; }

/* ============================================
   Tool
   ============================================ */
.tool { margin-bottom: 50px; }

.tool-input-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-1);
}
.tool-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.input-row {
  position: relative;
  display: flex;
  align-items: center;
}
.name-input {
  width: 100%;
  font-family: inherit;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  background: #ffffff;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text);
  padding: 16px 56px 16px 20px;
  outline: none;
  transition: all .2s ease;
}
.name-input:focus {
  border-color: var(--accent-1);
  background: #fbfcff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.14);
}
.name-input::placeholder { color: var(--text-faint); font-weight: 500; }
.tool[data-lang="en"] .name-input { text-align: left; }

.btn-clear {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 0;
  background: #f1eef8;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .2s ease;
}
.btn-clear:hover { background: var(--accent-2); color: #fff; }

.tool-hint {
  margin: 12px 4px 0;
  font-size: 13px;
  color: var(--text-faint);
}

/* ============================================
   Filter bar (chips + search)
   ============================================ */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1 1 auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { height: 4px; }
.chips::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
  box-shadow: var(--shadow-2);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
  box-shadow: 0 4px 12px rgba(37,99,235,.28);
}
.chip .count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(37,99,235,.10);
  color: var(--accent-1);
  font-variant-numeric: tabular-nums;
}
.chip.active .count { background: rgba(255,255,255,.25); color: #fff; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 220px;
}
.search-icon {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all .2s ease;
  box-shadow: var(--shadow-2);
}
.search-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.search-input::placeholder { color: var(--text-faint); }

.results-meta {
  margin: 0 4px 10px;
  font-size: 13px;
  color: var(--text-faint);
}
.results-meta strong { color: var(--text-dim); font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faint);
  background: #ffffff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.result-card.hidden { display: none; }

@media (max-width: 640px) {
  .search-wrap { flex: 1 1 100%; order: -1; }
}

/* ============================================
   Results grid
   ============================================ */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: all .2s ease;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  /* Skip rendering offscreen cards — browser-native lazy render */
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
.result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.result-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}
.result-card:hover::before { opacity: 1; }

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.result-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-1);
  background: rgba(37,99,235,.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.result-name {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.result-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  min-height: 32px;
  word-break: break-word;
  line-height: 1.4;
  position: relative;
  z-index: 1;
  user-select: all;
}
.results[data-lang="ar"] .result-value { font-size: 22px; }

.btn-copy {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f6f4fc;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  z-index: 1;
}
.btn-copy:hover {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
}
.btn-copy.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-copy svg { flex-shrink: 0; }

/* ============================================
   Features
   ============================================ */
.features { padding: 40px 0 80px; }
.section-title {
  font-family: 'Cairo', var(--font);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 36px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all .2s ease;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
}
.feature-icon {
  font-size: 38px;
  margin-bottom: 10px;
}
.feature h3 { margin: 0 0 8px; font-size: 18px; }
.feature p { color: var(--text-dim); margin: 0; font-size: 14px; }

/* ============================================
   SEO content
   ============================================ */
.seo-content {
  padding: 40px 0 80px;
  background: linear-gradient(180deg, transparent, rgba(37,99,235,.04) 50%, transparent);
}
.seo-content h2 {
  font-family: 'Cairo', var(--font);
  font-size: clamp(22px, 3.2vw, 30px);
  margin: 40px 0 12px;
  font-weight: 800;
}
.seo-content h2:first-child { margin-top: 0; }
.seo-content h3 {
  font-size: 19px;
  margin: 24px 0 8px;
  color: var(--text);
}
.seo-content p, .seo-content li {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.85;
}
.seo-content strong { color: var(--text); }
.seo-content ol, .seo-content ul { padding-inline-start: 22px; }
.cat-list { list-style: none; padding: 0 !important; }
.cat-list li {
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.cat-list code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  background: rgba(37,99,235,.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-1);
  font-size: 13px;
}

/* Name grid (popular names + similar suggestions) */
.name-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
}
.name-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all .15s ease;
  box-shadow: var(--shadow-2);
}
.name-pill:hover {
  background: var(--grad-soft);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}

/* ============================================
   Dual tool layout (gaming pages)
   ============================================ */
.dual-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin: 20px 0 40px;
}
.col-title {
  font-size: 22px;
  font-family: 'Cairo', var(--font);
  margin: 0 0 14px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  margin-top: 40px;
}
.footer p { margin: 6px 0; }
.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--success);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(16,185,129,.4);
  opacity: 0;
  transition: all .25s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   Mobile tweaks
   ============================================ */
@media (max-width: 640px) {
  .topbar .container { flex-direction: column; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .nav { justify-content: center; }
  .nav a { padding: 6px 12px; font-size: 13px; }
  .results { grid-template-columns: 1fr; }
  .name-input { font-size: 22px; padding: 14px 50px 14px 16px; }
  .hero { padding: 40px 0 30px; }
  .feature { padding: 18px; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-card {
  animation: fadeUp .3s ease both;
}
.result-card:nth-child(1) { animation-delay: .02s; }
.result-card:nth-child(2) { animation-delay: .04s; }
.result-card:nth-child(3) { animation-delay: .06s; }
.result-card:nth-child(4) { animation-delay: .08s; }
.result-card:nth-child(5) { animation-delay: .1s; }
