/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --bg: #f7f8fc;
  --bg2: #eef0f7;
  --text: #1a1d2e;
  --text2: #5a607a;
  --text3: #9198b5;
  --border: rgba(26,29,46,0.08);
  --border2: rgba(26,29,46,0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(26,29,46,0.07);
  --shadow-lg: 0 8px 32px rgba(26,29,46,0.12);
  --font: 'Cairo', 'Segoe UI', sans-serif;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

html { direction: rtl; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.navbar-brand .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.navbar-back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text2);
  padding: 7px 14px;
  border: 0.5px solid var(--border2);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.navbar-back:hover { background: var(--bg2); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 72px 2rem 56px;
  max-width: 680px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: #f0edff;
  color: #5b4fcf;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero h1 span {
  background: linear-gradient(135deg, #6c5ce7, #00b894);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: var(--text2);
  max-width: 480px;
  margin: 0 auto 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 8px;
}

.hero-stat { text-align: center; }
.hero-stat .num { font-size: 24px; font-weight: 900; color: var(--text); }
.hero-stat .lbl { font-size: 12px; color: var(--text3); }

/* ===== SEARCH BAR ===== */
.search-wrap {
  max-width: 520px;
  margin: 0 auto 60px;
  padding: 0 2rem;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: 40px;
  border: 0.5px solid var(--border2);
  background: var(--white);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
  transition: var(--transition);
}
.search-wrap input:focus { border-color: #6c5ce7; box-shadow: 0 0 0 3px rgba(108,92,231,0.1); }
.search-wrap input::placeholder { color: var(--text3); }
.search-icon {
  position: absolute;
  left: 2rem;
  top: 50%; transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

/* ===== SECTIONS GRID ===== */
.sections-label {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 0 2rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
}

.sections-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 80px;
}

/* ===== SECTION CARD ===== */
.sec-card {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  display: block;
}

.sec-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 3px;
  background: var(--card-accent, #6c5ce7);
  opacity: 0;
  transition: opacity var(--transition);
}

.sec-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border2);
}
.sec-card:hover::before { opacity: 1; }

.sec-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--card-bg, #f0edff);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
}

.sec-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.sec-card-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 14px;
}

.sec-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}

.sec-card-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--card-tag-bg, #f0edff);
  color: var(--card-tag-color, #5b4fcf);
}

.sec-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 0.5px solid var(--border);
}

.sec-card-count {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}

.sec-card-arrow {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card-bg, #f0edff);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--card-tag-color, #5b4fcf);
  transition: transform var(--transition);
}
.sec-card:hover .sec-card-arrow { transform: translateX(-3px); }

/* ===== TOOLS PAGE ===== */
.page-hero {
  padding: 48px 2rem 40px;
  max-width: 900px;
  margin: 0 auto;
}

.page-hero-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.page-hero-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--sec-bg, #f0edff);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
}

.page-hero h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.page-hero p {
  font-size: 14px;
  color: var(--text2);
}

.page-hero-stats {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.page-stat {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== TOOLS GRID ===== */
.tools-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 80px;
}

.tools-subsection {
  margin-bottom: 36px;
}

.tools-sublabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tools-sublabel::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* ===== TOOL CARD ===== */
.tool-card {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.tool-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--sec-bg, #f0edff);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.tool-info { flex: 1; min-width: 0; }

.tool-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.tool-tagline {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge-free {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #e8f8f0; color: #0a7a4d;
  border: 0.5px solid #b8edcf;
}
.badge-paid {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #fff3e0; color: #b45309;
  border: 0.5px solid #fcd38d;
}
.badge-freemium {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #eef2ff; color: #4338ca;
  border: 0.5px solid #c7d2fe;
}
.badge-best {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #fff7ed; color: #c2410c;
  border: 0.5px solid #fed7aa;
}
.badge-new {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #f0fdf4; color: #15803d;
  border: 0.5px solid #bbf7d0;
}

.tool-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--sec-bg, #f0edff);
  color: var(--sec-color, #5b4fcf);
  transition: var(--transition);
  width: fit-content;
  margin-top: auto;
}
.tool-link:hover {
  background: var(--sec-color, #5b4fcf);
  color: white;
}
.tool-link svg { width: 12px; height: 12px; }

/* ===== FOOTER ===== */
footer {
  background: var(--white);
  border-top: 0.5px solid var(--border);
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text3);
}

footer a { color: var(--text2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .sections-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tools-grid { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .hero, .page-hero { padding: 40px 1rem 32px; }
  .tools-section, .sections-grid { padding: 0 1rem; }
}
