/* ==========================================================================
   Orshina Scholarships — Responsive & Luminous Theme Stylesheet
   Zero Arabic strings; 100% mobile-first fluid layout with safe-area support
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f1f5fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #1d4ed8;
  --accent-2: #0284c7;
  --accent-3: #7c3aed;
  --accent-soft: rgba(29, 78, 216, 0.1);
  --accent-border: rgba(29, 78, 216, 0.28);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.14);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.14);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.14);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.14);
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 16px 38px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 28px 64px rgba(15, 23, 42, 0.16);
  --glass: rgba(255, 255, 255, 0.84);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050914;
  --surface: #0d1527;
  --surface-2: #14203b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #1e2d4d;
  --accent: #60a5fa;
  --accent-2: #38bdf8;
  --accent-3: #a78bfa;
  --accent-soft: rgba(96, 165, 250, 0.15);
  --accent-border: rgba(96, 165, 250, 0.35);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.15);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.15);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.15);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.15);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, 0.68);
  --glass: rgba(5, 9, 20, 0.86);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.16), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(139, 92, 246, 0.16), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.62;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, .brand-text strong {
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
}

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

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

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: min(1280px, calc(100% - 32px));
  margin-inline: auto;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 100;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #8b5cf6, #ec4899);
  transition: width 0.08s linear;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Crisp SVG Flags */
.flag-svg {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-block;
  vertical-align: middle;
}

.flag-lg {
  width: 28px;
  height: 19px;
  border-radius: 4px;
}

/* Sticky Header & Mobile Drawer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.bar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-text small {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #06b6d4, #8b5cf6);
  background-size: 200% 200%;
  animation: gradMove 6s ease infinite;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  flex: none;
}

@keyframes gradMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.primary-nav a {
  position: relative;
  padding-block: 6px;
  transition: color 0.2s;
}

.primary-nav a:hover {
  color: var(--accent);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.primary-nav a:hover::after {
  transform: scaleX(1);
}

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

.lang-switch select {
  height: 38px;
  padding: 0 28px 0 11px;
  border-radius: 11px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.btn-tool {
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 12px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.83rem;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.menu-btn {
  display: none;
  width: 38px;
  padding: 0;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  margin-block: 24px 36px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 15% 18%, rgba(56, 189, 248, 0.34), transparent 44%),
    radial-gradient(circle at 85% 20%, rgba(167, 139, 250, 0.34), transparent 48%),
    linear-gradient(130deg, #070e22 0%, #152863 52%, #1d4ed8 100%);
  color: #fff;
  padding: clamp(24px, 4.5vw, 52px);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.glow-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
  top: -70px;
  left: -60px;
  animation: floatGlow 11s ease-in-out infinite alternate;
}

.glow-2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  bottom: -90px;
  right: 10%;
  animation: floatGlow 14s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(28px, 20px) scale(1.14); }
}

.hero-main {
  position: relative;
  z-index: 2;
}

.pill-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e0f2fe;
  margin: 0;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.8);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.8); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 3.15rem);
  line-height: 1.15;
  margin: 14px 0 12px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff 0%, #e0f2fe 45%, #c4b5fd 85%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShimmer 8s linear infinite;
}

@keyframes textShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-lead {
  color: #e2e8f0;
  max-width: 54ch;
  margin: 0 0 22px;
  font-size: 0.98rem;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #0f172a;
  padding: 12px 22px;
  border-radius: 13px;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-cta:hover {
  transform: translateY(-3px);
}

.btn-outline-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 12px 20px;
  border-radius: 13px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: all 0.22s;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.kpi strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.kpi span {
  font-size: 0.78rem;
  color: #bae6fd;
  font-weight: 600;
}

/* Portrait Showcase Card */
.portrait-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.avatar-ring {
  position: relative;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 0deg, #22d3ee, #818cf8, #f472b6, #34d399, #22d3ee);
  animation: ringSpin 12s linear infinite;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #0f172a;
  animation: ringCounterSpin 12s linear infinite;
}

@keyframes ringCounterSpin {
  to { transform: rotate(-360deg); }
}

.avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.portrait-copy h2 {
  font-size: 1.2rem;
  color: #fff;
  margin: 2px 0 4px;
}

.portrait-copy p {
  margin: 0;
  font-size: 0.84rem;
  color: #e0f2fe;
  line-height: 1.5;
}

.mini-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.mini-badges span {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.next-mini {
  width: 100%;
  background: rgba(7, 14, 34, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 0.82rem;
  text-align: left;
}

.next-mini a {
  display: block;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.next-mini a:hover {
  text-decoration: underline;
}

/* Interactive Hub */
.feature-hub {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 24px;
  margin-bottom: 44px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.feature-hub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #8b5cf6, #ec4899, #2563eb);
  background-size: 200% auto;
  animation: gradMove 5s linear infinite;
}

.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.level-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lvl-btn {
  padding: 7px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.83rem;
  transition: all 0.22s;
}

.lvl-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.lvl-btn.active {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

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

.tool-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.28s, box-shadow 0.28s;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.tool-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  flex: none;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.tool-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.tip-highlight {
  font-size: 0.83rem !important;
  color: var(--accent) !important;
  font-weight: 700;
}

.quiz-area {
  font-size: 0.88rem;
  font-weight: 700;
}

.ladder-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ladder-item {
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.83rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.22s;
}

.ladder-item.reached {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.btn-accent {
  align-self: flex-start;
  margin-top: auto;
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s;
}

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

/* Directory Section */
section {
  margin-block-end: 48px;
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.sec-eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 4px;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.22;
  margin: 0;
  font-weight: 700;
}

.today-label {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.country-ribbon {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 6px 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.c-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.c-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.c-pill.active {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.filter-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.filter-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs button {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.83rem;
  font-weight: 700;
  transition: all 0.2s;
}

.tabs button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tabs button[aria-pressed="true"] {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  border-color: transparent;
}

.mobile-filter-toggle {
  display: none;
  flex: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.filter-grid.collapsed {
  display: none;
}

label {
  min-width: 0;
}

label span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

input, select {
  width: 100%;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding-inline: 12px;
  font-size: 16px; /* Prevents iOS auto-zoom on focus */
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  appearance: none;
  padding-inline-end: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-position: right 14px center, right 9px center;
}

#reset-filters {
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding-inline: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s;
}

#reset-filters:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 18px 14px;
}

.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#result-count {
  margin: 0;
  font-weight: 800;
  font-size: 0.94rem;
}

.saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s;
}

.saved-pill[aria-pressed="true"] {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.sort-wrap select {
  width: auto;
  height: 38px;
  font-size: 0.85rem;
}

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

.card {
  background: linear-gradient(165deg, rgba(56, 189, 248, 0.05), transparent 38%), var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s, border-color 0.28s;
  animation: cardPop 0.38s ease backwards;
}

@keyframes cardPop {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
}

.chip.open {
  background: var(--green-soft);
  color: var(--green);
}

.chip.upcoming {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.recurring {
  background: var(--purple-soft);
  color: var(--purple);
}

.chip.closed {
  background: var(--rose-soft);
  color: var(--rose);
}

.bm-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1rem;
  display: grid;
  place-items: center;
  flex: none;
  transition: all 0.2s;
}

.bm-btn.saved {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.card h3 {
  margin: 2px 0 0;
  font-size: 1.06rem;
  line-height: 1.38;
  font-weight: 700;
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 600;
}

.desc {
  margin: 0;
  font-size: 0.89rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cycle-strip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-info {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 8px 13px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.83rem;
  transition: all 0.2s;
}

.btn-info:hover {
  background: var(--accent);
  color: #fff;
}

.ext-link {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent);
}

.ext-link:hover {
  text-decoration: underline;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.p-btn {
  min-width: 42px;
  height: 42px;
  padding-inline: 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.p-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.p-btn.active {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  border-color: transparent;
}

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

/* Follow CTA */
.follow-box {
  border-radius: 26px;
  background:
    radial-gradient(circle at 85% 20%, rgba(251, 191, 36, 0.28), transparent 45%),
    linear-gradient(125deg, #1e1b4b 0%, #581c87 48%, #be185d 100%);
  color: #fff;
  padding: clamp(24px, 4vw, 42px);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.follow-box h2 {
  color: #fff;
  margin-bottom: 10px;
}

.follow-box p {
  color: #fce7f3;
  margin: 0 0 18px;
  max-width: 56ch;
}

.follow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.follow-tags span {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-ig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #831843;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.94rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-ig:hover {
  transform: translateY(-3px) scale(1.02);
}

.ig-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  padding: 22px;
}

.ig-handle {
  display: inline-block;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.ig-card small {
  display: block;
  color: #fbcfe8;
  margin-top: 4px;
}

/* About */
.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-md);
}

.about-card img {
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex: none;
  border: 3px solid var(--accent);
}

.about-card h2 {
  margin-bottom: 8px;
}

.about-card p {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 72ch;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 9px 15px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.87rem;
  transition: all 0.2s;
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding-block: 24px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

footer p {
  margin: 6px 0 0;
}

/* Modal */
dialog {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 24px;
  padding: 0;
  width: min(700px, calc(100% - 20px));
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
}

.m-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.m-head h3 {
  margin: 8px 0 0;
  font-size: 1.18rem;
  line-height: 1.35;
}

.m-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 800;
  flex: none;
}

.m-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-summary {
  margin: 0;
}

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

.m-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.m-box small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.76rem;
}

.m-box strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  margin-top: 3px;
}

.m-box p {
  margin: 4px 0 0;
  font-size: 0.89rem;
}

.m-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.m-cycle {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
}

.m-foot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

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

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 38px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 20px;
}

/* Tablet & Mobile Responsive Breakpoints */
@media (max-width: 1080px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hub-grid, .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .menu-btn {
    display: inline-grid;
    place-items: center;
  }
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-shadow: var(--shadow-lg);
  }
  .primary-nav.open {
    display: flex;
  }
  .primary-nav a {
    padding: 10px 14px;
    border-radius: 10px;
  }
  .primary-nav a:hover {
    background: var(--accent-soft);
  }
  .hero, .follow-box {
    grid-template-columns: 1fr;
  }
  .hero-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 24px);
  }
  .bar {
    min-height: 66px;
  }
  .brand-text small {
    display: none;
  }
  .hero {
    border-radius: 24px;
    padding: 22px 18px;
  }
  .hero-btns {
    flex-direction: column;
  }
  .hero-btns a {
    width: 100%;
  }
  .hero-kpis {
    gap: 8px;
  }
  .kpi strong {
    font-size: 1.2rem;
  }
  .mobile-filter-toggle {
    display: inline-flex;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .hub-grid, .cards, .m-grid {
    grid-template-columns: 1fr;
  }
  .about-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .m-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .m-foot-actions {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* RTL & Arabic Typography Support */
html[dir="rtl"] body {
  font-family: "Cairo", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .brand-text strong {
  font-family: "Cairo", "Space Grotesk", sans-serif;
}
html[dir="rtl"] .next-mini {
  text-align: right;
}
html[dir="rtl"] .lang-switch select {
  padding: 0 11px 0 28px;
}
html[dir="rtl"] select {
  background-position: left 9px center, left 14px center;
}
html[dir="rtl"] .ig-handle {
  direction: ltr;
}
