/* ═══════════════════════════════════════════════════════════════
   SAINIFY SALAH — Premium Left-Side Navigation Drawer
   drawer.css — Single source of truth for all drawer styles.
   Uses transform-based animation for GPU compositing (zero reflow).
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer Shell — GPU-composited slide (no layout reflow) ── */
.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 292px;
  /* Transform starts off-screen — GPU layer, zero layout reflow */
  transform: translateX(-100%);
  will-change: transform;
  background: var(--surface, #fff);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.side-drawer.open {
  transform: translateX(0);
  box-shadow:
    4px 0 8px rgba(0, 0, 0, 0.08),
    12px 0 40px rgba(0, 0, 0, 0.18),
    24px 0 64px rgba(0, 0, 0, 0.10);
}

/* Decorative background orbs */
.sd-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.sd-orb-1 {
  width: 200px; height: 200px;
  top: -60px; right: -80px;
  background: radial-gradient(circle, rgba(28,122,110,.12) 0%, transparent 70%);
}
.sd-orb-2 {
  width: 160px; height: 160px;
  bottom: 80px; left: -50px;
  background: radial-gradient(circle, rgba(212,175,55,.10) 0%, transparent 70%);
}

/* ── Drawer Header ── */
.drawer-header {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  padding: 44px 20px 22px;
  background: linear-gradient(150deg, #0D5E53 0%, #1C7A6E 40%, #22917F 70%, #1A8A7A 100%);
}
.dh-pattern {
  position: absolute; inset: 0; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='%23ffffff' d='M40 0L50 20H70L55 33L60 55L40 42L20 55L25 33L10 20H30Z'/%3E%3C/svg%3E");
  background-size: 56px 56px;
}
.drawer-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 30%, rgba(255,255,255,.5) 50%, rgba(255,255,255,.3) 70%, transparent 100%);
}
.dh-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, transform .18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 2;
}
.dh-close:active { background: rgba(255,255,255,.3); transform: scale(.9); }

.dh-identity { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.dh-logo-wrap { position: relative; flex-shrink: 0; }
.dh-logo {
  width: 58px; height: 58px; border-radius: 16px;
  border: 2px solid rgba(255,255,255,.3);
  box-shadow: 0 4px 12px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.2);
  display: block; object-fit: cover;
}
.dh-logo-glow {
  position: absolute; inset: -4px; border-radius: 20px;
  background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 70%);
  pointer-events: none;
}
.dh-text { flex: 1; min-width: 0; }
.dh-title {
  font-size: 18px; font-weight: 800; color: #fff;
  letter-spacing: -.3px; line-height: 1.2;
  font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
}
.dh-arabic {
  font-family: var(--font-arabic, 'Noto Naskh Arabic', serif);
  font-size: 14px; color: rgba(255,255,255,.8);
  margin-top: 3px; line-height: 1.4; direction: rtl;
}
.dh-version {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px; font-size: 11px; color: rgba(255,255,255,.55);
  cursor: pointer; letter-spacing: .3px;
  font-family: var(--font, sans-serif);
  -webkit-tap-highlight-color: transparent;
}
.dh-version-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ECCA3; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(78,204,163,.8);
  animation: sd-pulse 2.5s ease-in-out infinite;
}
@keyframes sd-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(78,204,163,.8); }
  50%       { opacity: .6; box-shadow: 0 0 3px rgba(78,204,163,.3); }
}

/* ── Navigation ── */
.drawer-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative; z-index: 1;
}
.drawer-nav::-webkit-scrollbar { display: none; }

.drawer-section-label {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--t4, #9CA3AF);
  font-family: var(--font, sans-serif);
}
.drawer-section-label::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border, #E5E7EB);
}

/* Nav item */
.drawer-item {
  width: 100%; display: flex; align-items: center;
  padding: 0 16px 0 12px; height: 50px;
  font-size: 14px; font-weight: 500;
  color: var(--t1, #111827);
  font-family: var(--font, sans-serif);
  border-left: 3px solid transparent;
  background: transparent; cursor: pointer;
  transition: background .15s, border-left-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: left; position: relative;
}
.drawer-item::before {
  content: ''; position: absolute; inset: 0;
  background: var(--teal, #1C7A6E);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.drawer-item:active::before { opacity: .06; }

@media (hover: hover) {
  .drawer-item:hover {
    background: rgba(28,122,110,.05);
    color: var(--teal, #1C7A6E);
    border-left-color: rgba(28,122,110,.3);
  }
  .drawer-item:hover .di-arrow { color: var(--teal, #1C7A6E); }
}
.drawer-item.active {
  background: var(--teal-lt, rgba(28,122,110,.08));
  color: var(--teal, #1C7A6E);
  border-left-color: var(--teal, #1C7A6E);
  font-weight: 600;
}
.drawer-item.active .di-icon-wrap { transform: scale(1.06); }
.drawer-item.active .di-arrow { color: var(--teal, #1C7A6E); }

/* Icon pill */
.di-icon-wrap {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-right: 12px;
  transition: transform .15s;
}
.di-icon { font-size: 17px; line-height: 1; }

/* Colour variants */
.di-c-teal   { background: rgba(28,122,110,.12); }
.di-c-amber  { background: rgba(245,158,11,.12);  }
.di-c-blue   { background: rgba(59,130,246,.12);  }
.di-c-purple { background: rgba(139,92,246,.12);  }
.di-c-red    { background: rgba(239,68,68,.12);   }
.di-c-green  { background: rgba(34,197,94,.12);   }
.di-c-gold   { background: rgba(212,175,55,.12);  }

.di-label { flex: 1; line-height: 1; }
.di-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  color: #fff; padding: 2px 6px; border-radius: 20px;
  margin-right: 6px; flex-shrink: 0;
}
.di-arrow {
  flex-shrink: 0; color: var(--t4, #9CA3AF);
  transition: color .15s, transform .15s;
}
.drawer-item:active .di-arrow { transform: translateX(2px); }

/* ── Footer ── */
.drawer-footer {
  flex-shrink: 0; padding: 14px 20px 18px;
  border-top: 1px solid var(--border, #E5E7EB);
  background: var(--surface, #fff);
  position: relative; z-index: 1;
}
.df-copy {
  font-size: 11px; color: var(--t4, #9CA3AF);
  text-align: center; margin: 0 0 12px;
  line-height: 1.4; font-family: var(--font, sans-serif);
}
.df-copy strong { color: var(--t3, #6B7280); font-weight: 600; }
.df-socials { display: flex; justify-content: center; gap: 10px; }
.dsoc {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.4,0,.2,1), opacity .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.dsoc:active { transform: scale(.88); opacity: .85; }
@media (hover: hover) {
  .dsoc:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.22); }
}
.dsoc-instagram { background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #F77737 100%); }
.dsoc-whatsapp  { background: #25D366; }
.dsoc-telegram  { background: #229ED9; }

/* ── Dark theme ── */
[data-theme="dark"] .side-drawer,
[data-theme="dark"] .drawer-footer { background: var(--surface, #1C1C1E); }
[data-theme="dark"] .drawer-header {
  background: linear-gradient(150deg, #0A3D38 0%, #0F5548 40%, #146657 70%, #115E50 100%);
}
[data-theme="dark"] .di-c-teal   { background: rgba(28,122,110,.18); }
[data-theme="dark"] .di-c-amber  { background: rgba(245,158,11,.18); }
[data-theme="dark"] .di-c-blue   { background: rgba(59,130,246,.18); }
[data-theme="dark"] .di-c-purple { background: rgba(139,92,246,.18); }
[data-theme="dark"] .di-c-red    { background: rgba(239,68,68,.18);  }
[data-theme="dark"] .di-c-green  { background: rgba(34,197,94,.18);  }
[data-theme="dark"] .di-c-gold   { background: rgba(212,175,55,.18); }
[data-theme="dark"] .drawer-item { color: var(--t1, #F3F4F6); }
[data-theme="dark"] .drawer-item.active { background: rgba(28,122,110,.15); }
[data-theme="dark"] .drawer-section-label::after { background: var(--border, #2D2D2F); }

/* ── Scroll lock when drawer open ── */
body.drawer-is-open {
  overflow: hidden;
  /* Prevent scroll-through on iOS */
  position: fixed;
  width: 100%;
}

/* ── Narrow screens ── */
@media (max-width: 340px) {
  .side-drawer { width: 272px; }
  .dh-title { font-size: 16px; }
  .dh-logo  { width: 50px; height: 50px; }
}
