:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eef2ff;
  --accent: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --container: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
ul { list-style: none; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 900;
  font-size: 1.35rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px rgba(79,70,229,.35);
  font-size: 1.1rem;
}

.logo small {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-links a {
  padding: .55rem .9rem;
  border-radius: 12px;
  color: #334155;
  font-weight: 700;
  font-size: .92rem;
  transition: .2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(79,70,229,.28);
}

.menu-btn {
  display: none;
  border: 0;
  background: var(--primary-soft);
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,58,237,.18), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(79,70,229,.2), transparent 30%),
    linear-gradient(180deg, #0b1020 0%, #151b33 100%);
  color: #fff;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #c7d2fe;
  font-size: .82rem;
  font-weight: 700;
}

.badge.light {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}

.hero h1 {
  margin: 1rem 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.25;
  font-weight: 900;
}

.hero h1 span {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: #cbd5e1;
  font-size: 1.05rem;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: .85rem 1.25rem;
  font-weight: 800;
  transition: .2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(99,102,241,.35);
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-dark {
  background: #0f172a;
  color: #fff;
}

.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: #f1f5f9; color: #0f172a; }
.btn-sm { padding: .55rem .9rem; font-size: .88rem; border-radius: 12px; }
.btn-block { width: 100%; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-top: 2rem;
}

.stat {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  color: #a5b4fc;
}

.stat span { color: #94a3b8; font-size: .85rem; }

.hero-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}

.mini-tool {
  background: rgba(15,23,42,.45);
  border-radius: 16px;
  padding: 1rem;
}

.mini-tool textarea {
  width: 100%;
  min-height: 110px;
  border: 0;
  border-radius: 12px;
  padding: .85rem;
  resize: vertical;
  background: rgba(255,255,255,.95);
  color: #0f172a;
}

.mini-tool .row {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

/* Sections */
.section { padding: 3.5rem 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
}

.section-head p { color: var(--muted); margin-top: .35rem; }

.section.alt { background: #eef2ff55; }

/* Cards / grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: .25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(79,70,229,.12);
}

.card-body { padding: 1.15rem; }

.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: .85rem;
  color: #fff;
}

.tool-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.tool-card p {
  color: var(--muted);
  font-size: .92rem;
  flex: 1;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
}

.pill.indigo { background: #e0e7ff; color: #3730a3; }
.pill.cyan { background: #cffafe; color: #0e7490; }
.pill.green { background: #d1fae5; color: #047857; }
.pill.orange { background: #ffedd5; color: #c2410c; }
.pill.pink { background: #fce7f3; color: #be185d; }
.pill.free { background: #ecfdf5; color: #047857; }

/* Category chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: .45rem .9rem;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: .2s ease;
}

.chip:hover, .chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Search */
.search-box {
  display: flex;
  gap: .75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .55rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.search-box input {
  flex: 1;
  border: 0;
  outline: none;
  padding: .65rem .85rem;
  background: transparent;
}

/* Page hero small */
.page-hero {
  padding: 2.5rem 0 1.5rem;
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 900;
}

.page-hero p { color: var(--muted); margin-top: .4rem; max-width: 680px; }

/* Tool workspace */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
}

.panel-head h2, .panel-head h3 {
  font-size: 1rem;
  font-weight: 800;
}

.panel-body { padding: 1.1rem; }

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 700;
  font-size: .9rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem .95rem;
  background: #fff;
  outline: none;
  transition: .2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.field textarea { min-height: 220px; resize: vertical; }

.field .hint {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .8rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.output-box {
  min-height: 220px;
  border: 1px dashed #c7d2fe;
  border-radius: 14px;
  background: #f8fafc;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-box.filled {
  border-style: solid;
  background: #fff;
  border-color: #c7d2fe;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-top: .85rem;
}

.stat-mini {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .7rem;
  text-align: center;
}

.stat-mini strong { display: block; font-size: 1.1rem; color: var(--primary); }
.stat-mini span { font-size: .78rem; color: var(--muted); }

.dropzone {
  border: 2px dashed #a5b4fc;
  border-radius: 16px;
  background: #f8fafc;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: .2s ease;
}

.dropzone:hover, .dropzone.dragover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.dropzone input { display: none; }

.preview-wrap {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.preview-wrap img,
.preview-wrap canvas {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

/* Pricing */
.price-card {
  position: relative;
  padding: 1.5rem;
  text-align: center;
}

.price-card.featured {
  border: 2px solid var(--primary);
  transform: scale(1.02);
}

.price-card .amount {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--primary);
  margin: .5rem 0;
}

.price-card ul {
  text-align: right;
  margin: 1.25rem 0;
}

.price-card li {
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  color: #334155;
}

.price-card li::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 900;
}

/* Blog */
.article-card h3 { font-size: 1.05rem; font-weight: 800; margin: .5rem 0; }
.article-card p { color: var(--muted); font-size: .92rem; }
.article-meta { color: var(--muted); font-size: .8rem; margin-top: .8rem; }

.prose {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.prose h2 {
  margin: 1.5rem 0 .7rem;
  font-size: 1.35rem;
}

.prose h3 { margin: 1.2rem 0 .5rem; }
.prose p { margin-bottom: .9rem; color: #334155; }
.prose ul, .prose ol { margin: 0 1.2rem 1rem; }
.prose li { margin-bottom: .35rem; color: #334155; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .92rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: .65rem .75rem;
  text-align: right;
}
.prose th { background: #f8fafc; }

/* Footer */
.site-footer {
  margin-top: auto;
  background: #0b1020;
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: .9rem;
  font-size: .95rem;
}

.site-footer a {
  display: block;
  color: #94a3b8;
  margin-bottom: .45rem;
  font-size: .9rem;
}

.site-footer a:hover { color: #a5b4fc; }

.footer-brand p {
  color: #94a3b8;
  margin-top: .75rem;
  max-width: 320px;
  font-size: .9rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: #64748b;
}

/* Contact / forms */
.contact-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 1rem;
}

.alert {
  padding: .9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 700;
}

.alert-success { background: #ecfdf5; color: #047857; }
.alert-info { background: #eff6ff; color: #1d4ed8; }
.alert-warning { background: #fffbeb; color: #b45309; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0f172a;
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  z-index: 200;
  transition: .3s ease;
  box-shadow: var(--shadow);
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Related tools */
.related {
  margin-top: 2rem;
}

/* Ad slots placeholders for AdSense */
.ad-slot {
  border: 1px dashed #c4b5fd;
  background: #faf5ff;
  color: #7c3aed;
  border-radius: 14px;
  min-height: 90px;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 700;
  margin: 1.25rem 0;
}

/* QR canvas center */
#qr-canvas {
  display: block;
  margin: 1rem auto;
  background: #fff;
  padding: .5rem;
  border-radius: 12px;
}

.hidden { display: none !important; }

.copy-ok { color: var(--success) !important; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid,
  .workspace,
  .contact-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .price-card.featured { transform: none; }
}

@media (max-width: 720px) {
  .menu-btn { display: grid; place-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: .75rem;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .85rem 1rem; }
  .grid-3, .grid-4, .grid-2, .stats-row, .hero-stats { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
}


/* --- Generated page helpers --- */
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem .95rem;
  background: #fff;
  outline: none;
  transition: .2s ease;
  margin-bottom: .75rem;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
.textarea { min-height: 140px; resize: vertical; }
.select { width: auto; min-width: 140px; margin-bottom: 0; }
.label {
  display: block;
  margin: .85rem 0 .4rem;
  font-weight: 700;
  font-size: .9rem;
}
.tool-layout { max-width: 900px; margin: 0 auto; }
.crumbs {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .75rem;
}
.crumbs a { color: var(--primary); font-weight: 700; }
.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #0b1020, #1e1b4b);
  color: #fff;
  border-radius: 24px;
  padding: 2rem;
}
.cta-box h2 { font-size: 1.6rem; font-weight: 900; margin-bottom: .35rem; }
.cta-box p { color: #cbd5e1; max-width: 520px; }
.content-prose h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 1.25rem 0 .5rem;
}
.content-prose p { color: #334155; margin-bottom: .75rem; }
.content-prose a { color: var(--primary); font-weight: 700; }
.cat-filter.active {
  background: var(--primary) !important;
  color: #fff !important;
}
.toolbar .input, .toolbar .select { margin-bottom: 0; }
.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  font-size: .9rem;
  color: #334155;
}
main { flex: 1; }
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 3rem 0 1.25rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.footer-brand p { margin-top: .75rem; color: #94a3b8; font-size: .92rem; max-width: 320px; }
.site-footer h4 { color: #fff; margin-bottom: .75rem; font-size: .95rem; }
.site-footer a {
  display: block;
  color: #94a3b8;
  font-size: .9rem;
  padding: .25rem 0;
  transition: .15s;
}
.site-footer a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1rem;
  font-size: .82rem;
  color: #64748b;
}
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0f172a;
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  z-index: 200;
  transition: .3s ease;
  box-shadow: var(--shadow);
}
