@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #4f46e5;
  --secondary: #6366f1;
  --accent: #06b6d4;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
  --gradient: linear-gradient(135deg, #06b6d4, #4f46e5 55%, #7c3aed);
  --radius: 8px;
  --container: 1180px;
}

:root[data-theme="dark"] {
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #111827;
  --card: #111827;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: rgba(248, 250, 252, 0.11);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "IBM Plex Sans Arabic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

html[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", Inter, system-ui, sans-serif;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(6, 182, 212, 0.45);
  outline-offset: 3px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .site-header {
  background: rgba(2, 6, 23, 0.9);
}

.navbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand img {
  width: 44px;
  height: 44px;
}

.brand-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 10px 13px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 650;
  font-size: 0.93rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.lang-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
}

.lang-btn.active {
  color: #ffffff;
  background: var(--gradient);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.3);
}

.mobile-menu-btn {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 34px;
  border-bottom: 1px solid var(--border);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.26;
}

.hero::before {
  inset-inline-start: -80px;
  top: 50px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.38), transparent 68%);
}

.hero::after {
  inset-inline-end: -90px;
  top: 40px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.38), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 14px;
}

h1,
h2,
h3 {
  line-height: 1.18;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

h3 {
  font-size: 1.18rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p,
.section-lead,
.page-lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 760px;
  margin: 0 auto 24px;
}

.hero-actions,
.tool-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.btn-primary {
  color: #ffffff;
  background: var(--gradient);
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.28);
}

.btn-danger {
  color: #ffffff;
  background: var(--danger);
  border-color: transparent;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.search-wrap {
  position: relative;
  width: min(100%, 680px);
  margin: 26px auto 18px;
}

.search-input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  padding: 0 24px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  overflow: hidden;
}

.search-results.active {
  display: block;
}

.search-result {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.search-result:last-child {
  border-bottom: 0;
}

.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 650;
}

.pill-dot {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: 8px;
  color: #ffffff;
  background: var(--gradient);
}

.section {
  padding: 54px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head p {
  margin: 0;
}

.category-strip,
.feature-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.category-card,
.feature-card,
.tool-card,
.info-card,
.faq-item,
.tool-panel,
.result-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.category-card {
  min-height: 108px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px;
  font-weight: 750;
}

.category-icon,
.tool-icon,
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #06b6d4 100%);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.18);
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

:root[data-theme="dark"] .category-icon,
:root[data-theme="dark"] .tool-icon,
:root[data-theme="dark"] .feature-icon {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.tool-card:hover .tool-icon {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(79, 70, 229, 0.26);
}

.category-icon svg,
.tool-icon svg,
.feature-icon svg {
  width: 28px;
  height: 28px;
  color: #ffffff;
  stroke-width: 2.2;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  min-height: 210px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 70, 229, 0.45);
}

.tool-card p {
  color: var(--muted);
  margin: 0 0 18px;
}

.card-arrow {
  color: var(--primary);
  font-weight: 900;
}

.feature-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.info-card {
  padding: 22px;
}

.feature-card p,
.info-card p,
.faq-item p {
  margin: 0;
  color: var(--muted);
}

.ad-slot {
  min-height: 72px;
  margin: 24px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(100, 116, 139, 0.05);
  font-size: 0.88rem;
}

.grid-ad {
  grid-column: 1 / -1;
  margin: 0;
}

.tools-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 30px 0;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.filter-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 750;
}

.filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.tool-panel,
.result-panel {
  padding: 22px;
}

.tool-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
}

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

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.preview-box {
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(100, 116, 139, 0.05);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

.preview-box img {
  max-height: 300px;
  width: auto;
  border-radius: var(--radius);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 4px;
}

.message {
  min-height: 24px;
  color: var(--muted);
  font-weight: 700;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.privacy-note {
  border-inline-start: 4px solid var(--accent);
  background: rgba(6, 182, 212, 0.08);
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 650;
}

.faq-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.faq-item {
  padding: 18px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 38px 0;
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 24px;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: var(--muted);
}

.copyright {
  color: var(--muted);
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 76px;
    inset-inline: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    display: block;
  }

  .category-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cards-grid,
  .feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

  .navbar {
    min-height: 70px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .brand-subtitle {
    font-size: 0.72rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .icon-btn,
  .lang-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .hero {
    padding: 50px 0 26px;
  }

  .trust-row {
    gap: 14px;
  }

  .category-strip,
  .feature-strip,
  .cards-grid,
  .form-grid,
  .preview-grid,
  .stats-grid,
  .faq-grid,
  .info-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .tools-filter {
    grid-template-columns: 1fr;
  }

  .filter-buttons {
    justify-content: start;
  }

  .section-head {
    display: block;
  }

  .tool-card {
    min-height: 170px;
  }
}
