/* ============================================================
   Zad — Policy Pages Shared Stylesheet
   ============================================================ */

/* Arabic font (Cairo) — loaded only when needed via font-display:swap */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --brand:         #0099CC;
  --brand-dark:    #007AA3;
  --brand-light:   #E0F5FF;
  --surface:       #1A1F24;
  --bg:            #F4F7FA;
  --white:         #FFFFFF;
  --text:          #1F2937;
  --text-muted:    #6B7280;
  --border:        #E5E9EF;
  --info-bg:       #EFF9FF;
  --info-border:   #BAE6FD;
  --warn-bg:       #FFFBEB;
  --warn-border:   #FDE68A;
  --success-bg:    #F0FDF4;
  --success-border:#86EFAC;
  --error-bg:      #FFF1F2;
  --error-border:  #FECDD3;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 16px rgba(0,153,204,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont,
               'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}

/* ── SITE HEADER ──────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #0099CC 0%, #005E8E 100%);
  color: #fff;
  padding: 36px 20px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 40px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 0;
}

.site-header .logo {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  position: relative;
  z-index: 2;
}

.site-header .logo .ar {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: .7;
  margin-left: 8px;
}

.site-header .tagline {
  font-size: .88rem;
  opacity: .78;
  margin-top: 6px;
  letter-spacing: .4px;
  position: relative;
  z-index: 2;
}

/* ── POLICY NAVIGATION ────────────────────────────────────── */
.policy-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  gap: 2px;
}

.nav-inner::-webkit-scrollbar { display: none; }

.policy-nav a {
  display: inline-block;
  padding: 13px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.policy-nav a:hover              { color: var(--brand); }
.policy-nav a.active             { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── MAIN CONTAINER ───────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 90px;
}

/* ── PAGE TITLE ───────────────────────────────────────────── */
.page-title {
  margin-bottom: 32px;
}

.page-title h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.page-title .meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: .83rem;
  color: var(--text-muted);
}

.page-title .meta-strip span::before {
  content: '📅 ';
}

/* ── SECTION CARDS ────────────────────────────────────────── */
.section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.section h3 {
  font-size: .93rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

.section p {
  color: #374151;
  margin-bottom: 12px;
}

.section ul, .section ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.section li {
  color: #374151;
  margin-bottom: 8px;
  line-height: 1.65;
}

.section p:last-child,
.section li:last-child,
.section ul:last-child,
.section ol:last-child { margin-bottom: 0; }

/* ── CALLOUT BOXES ────────────────────────────────────────── */
.box {
  border-radius: 8px;
  padding: 14px 18px;
  margin: 14px 0;
  font-size: .88rem;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.box-icon { flex-shrink: 0; font-size: 1.1rem; margin-top: 1px; }
.box p, .box ul { margin-bottom: 0 !important; font-size: .88rem; }
.box ul { margin-top: 6px; }

.box.info    { background: var(--info-bg);    border: 1px solid var(--info-border); }
.box.warn    { background: var(--warn-bg);    border: 1px solid var(--warn-border); }
.box.success { background: var(--success-bg); border: 1px solid var(--success-border); }
.box.error   { background: var(--error-bg);   border: 1px solid var(--error-border); }

/* ── TABLE ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: 8px; border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  min-width: 480px;
}

thead th {
  background: var(--info-bg);
  color: var(--brand-dark);
  font-weight: 700;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 2px solid var(--info-border);
}

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: #374151;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFBFC; }

/* ── STATUS PILLS ─────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .76rem;
  font-weight: 600;
}

.pill-blue   { background: #DBEAFE; color: #1D4ED8; }
.pill-green  { background: #DCFCE7; color: #15803D; }
.pill-amber  { background: #FEF9C3; color: #A16207; }
.pill-red    { background: #FEE2E2; color: #DC2626; }
.pill-gray   { background: #F3F4F6; color: #4B5563; }
.pill-purple { background: #F3E8FF; color: #7C3AED; }

/* ── SITE FOOTER ──────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  color: #9CA3AF;
  padding: 36px 20px;
  text-align: center;
  font-size: .84rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 16px;
}

.footer-links a {
  color: #60A5FA;
  text-decoration: none;
  transition: color .15s;
}

.footer-links a:hover { color: #93C5FD; text-decoration: underline; }

.footer-contact { margin-bottom: 10px; }
.footer-contact a { color: #60A5FA; text-decoration: none; }

.footer-copy {
  margin-top: 12px;
  font-size: .76rem;
  opacity: .55;
}

/* ── INDEX PAGE GRID ──────────────────────────────────────── */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.policy-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, transform .2s;
  display: block;
  border-top: 4px solid var(--brand);
}

.policy-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.policy-card .card-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}

.policy-card h2 {
  font-size: .97rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.policy-card p {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.policy-card .arrow {
  display: inline-block;
  margin-top: 14px;
  font-size: .82rem;
  color: var(--brand);
  font-weight: 600;
}

/* ── INTRO NOTICE CARD ────────────────────────────────────── */
.intro-notice {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin-bottom: 28px;
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow);
  font-size: .9rem;
  color: #374151;
  line-height: 1.7;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header .logo   { font-size: 1.75rem; }
  .page-title h1       { font-size: 1.45rem; }
  .section             { padding: 20px 18px; }
  .container           { padding: 24px 14px 70px; }
  .policy-nav a        { padding: 11px 10px; font-size: .78rem; }
  .policy-grid         { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .policy-nav a { padding: 10px 8px; font-size: .75rem; }
}


/* ============================================================
   ARABIC / RTL SUPPORT
   ============================================================ */

/* Arabic font family */
[dir="rtl"] body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ── Language toggle button ───────────────────────────────── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  margin: 0 10px;
  transition: background .15s, color .15s;
  font-family: inherit;
  letter-spacing: .3px;
}

.lang-toggle:hover {
  background: var(--brand);
  color: #fff;
}

/* ── Nav wrap (holds nav-inner + toggle button) ───────────── */
.nav-wrap {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}

/* nav-inner is now inside nav-wrap, no max-width needed */
.policy-nav .nav-inner {
  max-width: none;
  flex: 1;
  min-width: 0;
}

/* ── RTL — intro notice (flip accent border) ──────────────── */
.intro-notice {
  border-left: 4px solid var(--brand);
  border-right: none;
}

[dir="rtl"] .intro-notice {
  border-left: none;
  border-right: 4px solid var(--brand);
}

/* ── RTL — lists (flip indent) ───────────────────────────── */
[dir="rtl"] .section ul,
[dir="rtl"] .section ol {
  padding-left: 0;
  padding-right: 22px;
}

/* ── RTL — tables ────────────────────────────────────────── */
[dir="rtl"] thead th,
[dir="rtl"] tbody td {
  text-align: right;
}

/* ── RTL — section h2 number badge stays at line start ─────
   Flex direction is automatically reversed in RTL, so no
   extra rule needed — the .num badge leads naturally.      */

/* ── RTL — box callouts (flip icon margin) ───────────────── */
[dir="rtl"] .box { flex-direction: row-reverse; }
[dir="rtl"] .box-icon { margin-top: 1px; }

/* ── RTL — policy cards (accent border on top stays same) ── */
[dir="rtl"] .policy-card { border-top: 4px solid var(--brand); }

/* ── RTL — footer links ───────────────────────────────────── */
[dir="rtl"] .footer-links { direction: rtl; }

/* ── Responsive (RTL) ────────────────────────────────────── */
@media (max-width: 640px) {
  .lang-toggle { margin: 0 6px; padding: 5px 12px; font-size: .75rem; }
}
