/* ── Header ────────────────────────────────────────────── */
#header {
  position: relative; z-index: 10;
  padding: 12px 24px;
  border-bottom: 0.5px solid var(--border);
  background: rgba(8,8,8,.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* 3-column grid */
.hdr-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  position: relative;
}

/* LEFT: Logo */
.hdr-logo { display: flex; align-items: center; text-decoration: none; justify-self: start; }
.hdr-logo-img {
  height: 30px; width: auto;
  object-fit: contain;
  filter: brightness(1.05);
}

/* CENTER: Arabic brand */
.brand-frame {
  justify-self: center;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 32px;
  border-radius: 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(9, 9, 13, 0.92), rgba(9, 9, 13, 0.92)) padding-box,
    linear-gradient(120deg, rgba(102, 217, 255, 0.75), rgba(201, 168, 106, 0.85), rgba(102, 217, 255, 0.75)) border-box;
  box-shadow:
    0 0 0 1px rgba(102, 217, 255, 0.12),
    0 0 18px rgba(102, 217, 255, 0.22),
    0 0 30px rgba(201, 168, 106, 0.12);
  overflow: hidden;
}
.brand-frame::before {
  content: "";
  position: absolute;
  inset: -120% -40%;
  background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.14), transparent 58%);
  transform: rotate(8deg);
  animation: brand-shine 5s linear infinite;
  pointer-events: none;
}
.brand-ar {
  position: relative;
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 28px; font-weight: 700;
  direction: rtl;
  line-height: 1;
  white-space: nowrap;
  color: var(--accent2);
  text-shadow:
    0 0 14px rgba(102, 217, 255, 0.55),
    0 0 30px rgba(102, 217, 255, 0.28),
    0 0 44px rgba(201, 168, 106, 0.16);
}

@keyframes brand-shine {
  0%   { transform: translateX(-140%) rotate(8deg); }
  100% { transform: translateX(140%) rotate(8deg); }
}

/* RIGHT: slide panel (inline on desktop, slide-out on mobile) */
.hdr-slide {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  justify-self: end;
}

/* Nav links */
.hdr-nav {
  display: flex; gap: 22px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
}
.hdr-nav::-webkit-scrollbar { display: none; }
.hdr-link {
  font-size: 11px; color: var(--muted2);
  text-decoration: none; letter-spacing: .1em;
  white-space: nowrap;
  transition: color .15s;
  position: relative;
}
.hdr-link:hover { color: var(--accent2); }
.hdr-link.on { color: var(--accent2); }
.hdr-link.on::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--accent2);
  opacity: .6;
}

/* Lang switch */
.lang-sw { display: flex; gap: 5px; flex-shrink: 0; }
.lb {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-h);
  border-radius: 6px;
  color: var(--muted2);
  font-size: 11px; padding: 4px 12px;
  cursor: pointer; letter-spacing: .1em;
  transition: all .2s;
}
.lb.on, .lb:hover {
  background: rgba(200,169,110,.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile-only: hamburger + lang select (hidden on desktop) */
.top-actions { display: none; }

/* Menu backdrop */
.menu-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 55;
  background: rgba(0,0,0,.55);
}

/* ── My Space link (cabinet-style) ────────────────────── */
.myspace-link {
  border: 2px solid #06080f;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(102, 217, 255, 0.18), rgba(200, 169, 106, 0.15));
  color: var(--text);
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(6, 8, 15, 0.8), 0 0 14px rgba(102, 217, 255, 0.12);
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}
.myspace-link:hover {
  border-color: rgba(102, 217, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(102, 217, 255, 0.2), 0 0 18px rgba(102, 217, 255, 0.25);
  color: var(--accent2);
}

/* ── Mobile / Tablet (≤900px) ─────────────────────────── */
@media (max-width: 900px) {
  #header { padding: 10px 14px; }

  .hdr-inner {
    grid-template-columns: auto 1fr auto;
  }

  /* Brand absolute-centered */
  .brand-frame {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
    padding: 7px 20px;
  }
  .brand-ar { font-size: 22px; }

  /* Hamburger visible */
  .top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
  }
  .menu-toggle-btn {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: transparent;
    border: 1px solid var(--border-h);
    border-radius: 8px;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    z-index: 71;
    transition: background .15s;
  }
  .menu-toggle-btn:hover { background: rgba(255,255,255,.06); }
  .menu-toggle-btn:active { background: rgba(255,255,255,.1); }

  /* Slide-out panel */
  .hdr-slide {
    position: fixed;
    top: 0; right: -110vw;
    height: 100vh;
    width: min(320px, 85vw);
    z-index: 70;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
    padding: 76px 18px 20px;
    background: linear-gradient(160deg, rgba(8, 8, 12, 0.98), rgba(14, 14, 22, 0.98));
    border-left: 1px solid rgba(200, 169, 106, 0.2);
    transition: right .24s ease;
    pointer-events: none;
    visibility: hidden;
    justify-self: auto;
  }
  .hdr-nav {
    flex-direction: column;
    gap: 6px;
  }
  .hdr-link {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    background: transparent;
  }
  .hdr-link.on {
    background: rgba(102, 217, 255, .08);
    color: var(--accent2);
  }
  .hdr-link.on::after { display: none; }
  .lang-sw {
    margin-top: 6px;
    justify-content: center;
  }
  .myspace-link {
    margin-top: 4px;
    width: 100%;
    min-height: 42px;
    font-size: 13px;
  }

  /* Open state */
  body.menu-open .hdr-slide {
    right: 0;
    pointer-events: auto;
    visibility: visible;
  }
  body.menu-open .menu-backdrop { display: block; }
}

/* ── Small phone (≤560px) ─────────────────────────────── */
@media (max-width: 560px) {
  .brand-ar { font-size: 18px; }
  .hdr-logo-img { height: 26px; }
}
