:root {
  --red: #E8342A;
  --red-light: #FFF0EF;
  --red-dark: #cc2e25;
  --black: #0D0D0D;
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --border: #E4E3DF;
  --text-primary: #0D0D0D;
  --text-secondary: #6B6863;
  --text-muted: #A8A5A0;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-arabic: 'Tajawal', sans-serif;
  --max-w: 1200px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-arabic);
  background: var(--bg);
  color: var(--text-primary);
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* =================== NAVBAR =================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 247, 244, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 0; text-decoration: none; }
.logo-mark { width: 75px; height: 75px; flex-shrink: 0; display: block; }
.logo-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  color: var(--black); letter-spacing: -0.5px;
}
.nav-actions { display: flex; align-items: center; gap: 18px; }
.nav-link {
  font-family: var(--font-arabic);
  font-size: 15px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
  transition: color .15s;
}
.nav-link:hover { color: var(--black); }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px;
  font-family: var(--font-arabic); font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; border: none; transition: all .18s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }

/* =================== PAGE HEADER =================== */
.ideas-header {
  max-width: var(--max-w); margin: 0 auto;
  padding: 64px 5% 28px; text-align: center;
}
.ideas-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--red); margin-bottom: 14px;
}
.ideas-h1 {
  font-family: var(--font-arabic);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800; line-height: 1.2;
  color: var(--black); margin-bottom: 16px;
}
.ideas-h1 .accent { color: var(--red); }
.ideas-sub {
  font-size: 17px; line-height: 1.8;
  color: var(--text-secondary);
  max-width: 640px; margin: 0 auto;
}

/* =================== FILTER BAR =================== */
.filter-wrap {
  position: sticky; top: 64px; z-index: 50;
  background: rgba(248, 247, 244, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.filter-bar {
  max-width: var(--max-w); margin: 0 auto;
  padding: 16px 5%;
  display: flex; flex-wrap: wrap; gap: 9px;
  justify-content: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 100px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-family: var(--font-arabic); font-size: 14px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--red); color: var(--black); }
.chip.active { background: var(--black); border-color: var(--black); color: #fff; }
.chip-count {
  font-family: var(--font-display);
  font-size: 11.5px; font-weight: 700;
  background: var(--bg); color: var(--text-muted);
  border-radius: 100px; padding: 1px 8px; min-width: 22px; text-align: center;
}
.chip:hover .chip-count { color: var(--text-secondary); }
.chip.active .chip-count { background: rgba(255,255,255,.16); color: #fff; }

/* =================== LISTING =================== */
.ideas-section { max-width: var(--max-w); margin: 0 auto; padding: 32px 5% 72px; }
.result-count {
  font-size: 14.5px; color: var(--text-secondary);
  margin-bottom: 22px; text-align: center;
}
.result-count strong {
  font-family: var(--font-display);
  color: var(--black); font-weight: 700;
}

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

.idea-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.idea-card:hover {
  border-color: var(--red);
  box-shadow: 0 6px 28px rgba(232,52,42,.09);
  transform: translateY(-3px);
}
.idea-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.idea-tag {
  font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 100px;
  white-space: nowrap;
}
.idea-tag-model { background: var(--red-light); color: var(--red); }
.idea-tag-sector {
  background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.idea-title {
  font-family: var(--font-arabic);
  font-size: 19px; font-weight: 800; line-height: 1.4;
  color: var(--black); margin-bottom: 10px;
}
.idea-desc {
  font-size: 14.5px; line-height: 1.85;
  color: var(--text-secondary);
}

/* Empty state */
.ideas-empty {
  text-align: center; padding: 64px 16px;
  color: var(--text-muted); font-size: 16px;
}

/* =================== PAGINATION =================== */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 7px; margin-top: 44px;
}
.page-btn {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--red); color: var(--black); }
.page-btn.active {
  background: var(--red); border-color: var(--red); color: #fff;
}
.page-btn.page-nav { font-family: var(--font-arabic); font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; }

/* =================== CTA SECTION =================== */
.ideas-cta {
  background: var(--black);
  padding: 80px 5%;
}
.ideas-cta-inner {
  max-width: 820px; margin: 0 auto; text-align: center;
}
.ideas-cta-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--red); margin-bottom: 16px;
}
.ideas-cta-h2 {
  font-family: var(--font-arabic);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800; line-height: 1.3;
  color: #fff; margin-bottom: 18px;
}
.ideas-cta-h2 .accent { color: var(--red); }
.ideas-cta-sub {
  font-size: 17px; line-height: 1.85;
  color: rgba(255,255,255,.7);
  max-width: 560px; margin: 0 auto 32px;
}
.btn-cta {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 16px 34px; border-radius: 12px;
  background: var(--red); color: #fff;
  font-family: var(--font-arabic); font-size: 17px; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
  transition: background .18s, transform .18s;
}
.btn-cta:hover { background: var(--red-dark); transform: translateY(-2px); }

/* =================== FOOTER =================== */
.footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 28px 5%;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700; color: #fff;
}
.footer-copy { font-size: 12.5px; color: rgba(255,255,255,.35); }

/* =================== REVEAL =================== */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* =================== RESPONSIVE =================== */
@media (max-width: 900px) {
  .ideas-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .nav { padding: 0 4%; }
  .nav-link { display: none; }
  .ideas-header { padding: 44px 4% 22px; }
  .ideas-section { padding: 24px 4% 56px; }
  .ideas-grid { grid-template-columns: 1fr; gap: 14px; }
  .filter-bar { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .ideas-cta { padding: 56px 5%; }
  .footer { flex-direction: column; gap: 12px; text-align: center; }
}
