/* ==========================================================
   START 2026 - Orange Egypt theme
   ========================================================== */

:root {
  --orange:        #FF7900;          /* PANTONE 151 / RGB 255,121,0 — Orange brand primary */
  --orange-rgb:    255, 121, 0;      /* same value, for rgba() usage */
  --orange-dark:   #E36A00;
  --orange-soft:   #FFF2E6;
  --ink:           #000000;
  --ink-2:         #1A1A1A;
  --muted:         #6B6B6B;
  --line:          #E5E5E5;
  --bg-soft:       #FAFAFA;
  --green:         #28A745;
  --red:           #DC3545;
  --shadow-sm:     0 2px 6px rgba(0, 0, 0, .06);
  --shadow:        0 6px 18px rgba(0, 0, 0, .08);
}

* { font-family: 'Tajawal', sans-serif; }

body {
  background: #fff;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--ink); }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

/* ---- Brand ---- */
.brand-text { font-weight: 900; font-size: 1.25rem; color: var(--ink); letter-spacing: .5px; }
.brand-year { color: var(--orange); }

/* ---- Buttons ---- */
.btn-orange {
  background: var(--orange);
  border: 2px solid var(--orange);
  color: #fff;
  font-weight: 700;
  transition: all .2s;
}
.btn-orange:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  color: #fff;
  transform: translateY(-1px);
}
.btn-outline-orange {
  background: transparent;
  border: 2px solid var(--orange);
  color: var(--orange);
  font-weight: 700;
}
.btn-outline-orange:hover { background: var(--orange); color: #fff; }

.btn-dark { background: var(--ink); border-color: var(--ink); font-weight: 700; }
.btn-outline-dark { border-color: var(--ink); color: var(--ink); font-weight: 700; }

/* ---- Public navbar ---- */
.public-navbar {
  background: #fff;
  border-bottom: 3px solid var(--orange);
  box-shadow: var(--shadow-sm);
  padding: .85rem 0;
}
.public-navbar .nav-link {
  color: var(--ink);
  font-weight: 500;
  margin: 0 .3rem;
  padding: .5rem .8rem !important;
  border-radius: 6px;
}
.public-navbar .nav-link:hover { color: var(--orange); background: var(--orange-soft); }

/* ---- Hero ---- */
.hero {
  background:
    linear-gradient(135deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.6) 60%, rgba(var(--orange-rgb),.85) 100%),
    radial-gradient(ellipse at top right, var(--orange) 0%, transparent 60%);
  color: #fff;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 12px);
  pointer-events: none;
}
.hero .badge-pill {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  padding: .35rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero h1 span { color: var(--orange); }
.hero p.lead { font-size: 1.15rem; max-width: 720px; opacity: .92; }

/* ---- Sections ---- */
.section { padding: 4rem 0; }
.section-soft { background: var(--bg-soft); }
.section-dark  { background: var(--ink); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-title {
  font-weight: 900;
  margin-bottom: .5rem;
  position: relative;
  padding-bottom: .5rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px; height: 4px;
  background: var(--orange);
  margin-top: .5rem;
  border-radius: 2px;
}
.section-subtitle { color: var(--muted); margin-bottom: 2.5rem; }

/* ---- Cards ---- */
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
  height: 100%;
  transition: all .25s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--orange);
}
.feature-card .icon-wrap {
  width: 54px; height: 54px;
  border-radius: 12px;
  background: var(--orange-soft);
  color: var(--orange);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}
.feature-card h5 { font-weight: 800; margin-bottom: .5rem; }
.feature-card p  { color: var(--muted); margin: 0; }

/* ---- Stats ---- */
.stat-card {
  text-align: center;
  padding: 2rem 1rem;
  background: #fff;
  border-radius: 14px;
  border-top: 4px solid var(--orange);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.stat-card .stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
  margin-bottom: .5rem;
}
.stat-card .stat-label { color: var(--ink); font-weight: 700; }

/* ---- Target groups ---- */
.target-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border: 2px solid var(--line);
  padding: .65rem 1.2rem;
  border-radius: 999px;
  margin: .35rem;
  font-weight: 500;
  transition: all .2s;
}
.target-pill:hover { border-color: var(--orange); color: var(--orange); }
.target-pill i { color: var(--orange); }

/* ---- Partnership packages ---- */
.pkg-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
  height: 100%;
  position: relative;
  transition: all .25s;
}
.pkg-card.featured {
  border: 2px solid var(--orange);
  box-shadow: var(--shadow);
}
.pkg-card.featured::before {
  content: 'الأكثر شعبية';
  position: absolute;
  top: -14px; right: 1.5rem;
  background: var(--orange); color: #fff;
  font-size: .75rem; font-weight: 700;
  padding: .35rem .9rem; border-radius: 999px;
}
.pkg-card h3 { font-weight: 900; margin-bottom: .5rem; }
.pkg-card .price {
  font-size: 2rem; font-weight: 900; color: var(--orange);
  margin: 1rem 0;
}
.pkg-card .price small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.pkg-card ul { list-style: none; padding: 0; }
.pkg-card ul li { padding: .35rem 0; }
.pkg-card ul li i { color: var(--orange); margin-left: .4rem; }

/* ---- Forms ---- */
.form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2.25rem;
  margin: 2rem 0;
}
.form-card h2 { margin-bottom: .25rem; }
.form-label { font-weight: 600; color: var(--ink); }
.required-mark { color: var(--red); }
.form-control, .form-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 .2rem rgba(var(--orange-rgb), .15);
}
.form-check-input:checked {
  background-color: var(--orange);
  border-color: var(--orange);
}

/* ---- Listings ---- */
.opp-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all .2s;
}
.opp-card:hover { box-shadow: var(--shadow-sm); border-color: var(--orange); }
.opp-card h5 { margin-bottom: .5rem; }
.opp-meta {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0;
}
.opp-meta .badge {
  font-weight: 600;
  background: var(--orange-soft);
  color: var(--orange-dark);
  padding: .4rem .8rem;
}
.opp-meta .badge.bg-dark-soft {
  background: #f1f1f1; color: var(--ink);
}

/* ---- Footer ---- */
.public-footer {
  background: var(--ink);
  color: #fff;
  padding: 3rem 0 1.5rem;
}
.footer-title { color: #fff; font-weight: 800; margin-bottom: 1rem; }
.footer-text { color: rgba(255,255,255,.75); font-size: 14px; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255,255,255,.75); }
.footer-links a:hover { color: var(--orange); }

/* ==========================================================
   Admin layout
   ========================================================== */
.admin-body { background: var(--bg-soft); }
.admin-topbar {
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.25rem;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 3px solid var(--orange);
}
.admin-shell { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar {
  width: 240px;
  background: #fff;
  border-left: 1px solid var(--line);
  padding: 1rem 0;
  flex-shrink: 0;
}
.admin-sidebar .nav-link {
  color: var(--ink-2);
  padding: .75rem 1.25rem;
  border-radius: 0;
  font-weight: 500;
  border-right: 3px solid transparent;
}
.admin-sidebar .nav-link i { width: 22px; color: var(--orange); }
.admin-sidebar .nav-link:hover { background: var(--orange-soft); color: var(--orange-dark); }
.admin-sidebar .nav-link.active {
  background: var(--orange-soft);
  color: var(--orange-dark);
  border-right-color: var(--orange);
  font-weight: 700;
}

/* Collapsible groups inside the admin sidebar.
   Group toggle: dimmer than top-level links, with a chevron that flips
   on expand.  Sub-items are slightly indented and slightly smaller so the
   visual hierarchy is obvious without doubling the line-height. */
.admin-sidebar .sidebar-group-toggle {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  padding: .55rem 1.25rem;
  text-transform: none;
  letter-spacing: .2px;
}
.admin-sidebar .sidebar-group-toggle:hover {
  background: transparent;
  color: var(--orange-dark);
}
.admin-sidebar .sidebar-group-caret {
  font-size: .75rem;
  transition: transform .2s ease;
  /* `.collapsed` (Bootstrap toggles this class when collapsed) flips it. */
}
.admin-sidebar .sidebar-group-toggle.collapsed .sidebar-group-caret {
  transform: rotate(-90deg);
}
.admin-sidebar .sidebar-sub {
  padding-right: 2.5rem;   /* RTL: indent from the right edge */
  padding-top: .5rem;
  padding-bottom: .5rem;
  font-size: .92rem;
}
.admin-sidebar .sidebar-sub i { font-size: .95rem; }

.admin-main { flex: 1; padding: 1.75rem; min-width: 0; }
.admin-main h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }

.admin-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.dash-stat {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid var(--orange);
}
.dash-stat .label { color: var(--muted); font-size: .9rem; margin-bottom: .25rem; }
.dash-stat .value { font-size: 1.85rem; font-weight: 900; color: var(--ink); line-height: 1; }
.dash-stat .ic { float: left; font-size: 1.8rem; color: var(--orange); opacity: .6; }

.table thead th {
  background: #f8f8f8;
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid var(--orange);
}
.table-actions .btn { padding: .25rem .55rem; font-size: .8rem; }

.status-جديد         { background: #d1ecf1; color: #0c5460; }
.status-قيد-المراجعة { background: #fff3cd; color: #856404; }
.status-مقبول         { background: #d4edda; color: #155724; }
.status-مرفوض         { background: #f8d7da; color: #721c24; }
/* Session attendance lifecycle */
.status-مسجل         { background: #d1ecf1; color: #0c5460; }
.status-حضر          { background: #d4edda; color: #155724; }
.status-لم-يحضر      { background: #f8d7da; color: #721c24; }
.status-ملغي         { background: #e2e3e5; color: #383d41; }
.status-pill {
  display: inline-block; padding: .25rem .7rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700;
}

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 50%, rgba(var(--orange-rgb),.6) 100%);
  padding: 1rem;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    right: 0; top: 60px;
    height: calc(100vh - 60px);
    transform: translateX(100%);
    transition: transform .25s;
    z-index: 99;
    box-shadow: -2px 0 12px rgba(0,0,0,.1);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 1rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 2.5rem 0; }
}

/* ==========================================================
   Accessibility (Phase 5)
   ========================================================== */

/* Skip-to-content link — only visible on keyboard focus. */
.skip-to-content {
  position: absolute;
  top: -100px; right: 0;
  background: var(--ink);
  color: #fff;
  padding: .6rem 1rem;
  font-weight: 700;
  border-radius: 0 0 0 8px;
  z-index: 10000;
  transition: top .2s;
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
  top: 0;
  outline: 3px solid var(--orange);
  color: #fff;
}

/* Strong focus indicators for everything keyboard-reachable. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.page-link:focus-visible,
.nav-link:focus-visible,
.navbar-toggler:focus-visible {
  outline: 3px solid var(--orange) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(var(--orange-rgb), .25) !important;
}

/* Active sidebar nav item — aria-current support. */
.admin-sidebar .nav-link[aria-current="page"] { font-weight: 700; }

/* Reduced motion — respect OS preference and disable transitions /
   the homepage counter "tick" animation. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .feature-card:hover,
  .btn-orange:hover { transform: none !important; }
}

/* Higher-contrast borders for users running forced-colors mode. */
@media (forced-colors: active) {
  .btn-orange, .btn-outline-orange, .badge, .status-pill {
    border: 1px solid CanvasText;
  }
}

/* Tables: stripe + clearer header for screen readers. */
.admin-card .table thead th {
  position: sticky; top: 0; z-index: 1;
}

/* Visually-hidden helper (for sr-only labels). */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================================================
   Knowledge Hub — AI search
   ========================================================== */
.kb-search-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fff8ee 100%);
}
.kb-search-card .input-group-lg .form-control {
  font-size: 1.05rem;
  padding-block: .8rem;
}
.kb-chip {
  border-radius: 999px !important;
  font-size: .85rem !important;
  padding: .35rem .9rem !important;
}
.kb-chip:hover {
  transform: translateY(-1px);
}
.kb-status {
  min-height: 1.5rem;
  padding: .35rem .25rem;
}
.kb-status-loading {
  color: var(--orange-dark);
}
.kb-status-error {
  color: var(--red);
}
.kb-status-ok {
  color: var(--muted);
}
.kb-loader {
  display: inline-block;
  width: 1rem; height: 1rem;
  margin-inline-end: .4rem;
  border: 2px solid rgba(var(--orange-rgb), .25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: kb-spin .85s linear infinite;
  vertical-align: -2px;
}
@keyframes kb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .kb-loader { animation: none; border-top-color: var(--orange); }
}

.kb-result {
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.kb-result:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  box-shadow: var(--shadow);
}
.kb-result .kb-preview,
.kb-result .kb-full {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 2;
  color: var(--ink-2);
  font-size: .95rem;
  text-align: justify;
  text-justify: inter-word;
  direction: rtl;
}
.kb-result .kb-full {
  border-top: 1px dashed var(--line);
  padding-top: .6rem;
  margin-top: .4rem;
}

/* ---- Document-grouped result cards ---- */
.kb-doc-head { row-gap: .35rem; }
.kb-doc-icon { color: var(--orange); font-size: 1.15rem; }
.kb-doc-title {
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.kb-cat-pill {
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .65rem;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  border: 1px solid #FFE0BF;
}
.kb-score { font-weight: 600; }
/* Divider between the lead passage and each extra passage. */
.kb-passage + .kb-passage,
.kb-extra .kb-passage {
  border-top: 1px dashed var(--line);
  padding-top: .6rem;
  margin-top: .6rem;
}
.kb-extra .kb-passage .kb-preview { color: var(--muted); }
.kb-more {
  color: var(--orange-dark);
  font-weight: 600;
  text-decoration: none;
}
.kb-more:hover { color: var(--orange); text-decoration: underline; }
.kb-toggle { color: var(--orange-dark); }
