/* =========================================
   ROOT
   ========================================= */

:root {
  /* Backgrounds */
  --bg: #000714;
  --bg-primary: #000714;
  --bg-secondary: #000815;
  --bg-tertiary: #030819;

  --surface: #000815;
  --surface-dark: #030819;

  /* Purple */
  --purple-dark: #490cc2;
  --purple: #5915d8;
  --purple-bright: #7228ee;
  --purple-light: #962fee;

  /* Cyan */
  --cyan: #45b6d8;

  /* Text */
  --text: #f6f5fb;
  --text-primary: #f6f5fb;
  --text-white: #feffff;

  --text-secondary: #969399;
  --text-muted: #969399;

  --text-gray: #54565f;
  --text-dark-gray: #3c3d41;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-dark: rgba(255, 255, 255, 0.05);

  --border-purple: rgba(114, 40, 238, 0.15);
  --border-purple-medium: rgba(114, 40, 238, 0.3);
  --border-purple-strong: rgba(114, 40, 238, 0.5);

  --border-cyan: rgba(69, 182, 216, 0.25);

  /* Purple Alpha */
  --purple-05: rgba(114, 40, 238, 0.05);
  --purple-10: rgba(114, 40, 238, 0.1);
  --purple-15: rgba(114, 40, 238, 0.15);
  --purple-20: rgba(114, 40, 238, 0.2);
  --purple-25: rgba(114, 40, 238, 0.25);
  --purple-30: rgba(114, 40, 238, 0.3);
  --purple-40: rgba(114, 40, 238, 0.4);
  --purple-50: rgba(114, 40, 238, 0.5);

  /* Dark Purple Alpha */
  --purple-dark-10: rgba(73, 12, 194, 0.1);
  --purple-dark-15: rgba(73, 12, 194, 0.15);
  --purple-dark-20: rgba(73, 12, 194, 0.2);
  --purple-dark-30: rgba(73, 12, 194, 0.3);
  --purple-dark-40: rgba(73, 12, 194, 0.4);

  /* Light Purple Alpha */
  --purple-light-10: rgba(150, 47, 238, 0.1);
  --purple-light-15: rgba(150, 47, 238, 0.15);
  --purple-light-20: rgba(150, 47, 238, 0.2);
  --purple-light-30: rgba(150, 47, 238, 0.3);
  --purple-light-40: rgba(150, 47, 238, 0.4);
  --purple-light-50: rgba(150, 47, 238, 0.5);

  /* Cyan Alpha */
  --cyan-10: rgba(69, 182, 216, 0.1);
  --cyan-15: rgba(69, 182, 216, 0.15);
  --cyan-20: rgba(69, 182, 216, 0.2);
  --cyan-30: rgba(69, 182, 216, 0.3);
  --cyan-40: rgba(69, 182, 216, 0.4);
  --cyan-50: rgba(69, 182, 216, 0.5);

  /* White Alpha */
  --white-05: rgba(255, 255, 255, 0.05);
  --white-08: rgba(255, 255, 255, 0.08);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-12: rgba(255, 255, 255, 0.12);
  --white-15: rgba(255, 255, 255, 0.15);
  --white-20: rgba(255, 255, 255, 0.2);

  /* Black Alpha */
  --black-20: rgba(0, 0, 0, 0.2);
  --black-30: rgba(0, 0, 0, 0.3);
  --black-40: rgba(0, 0, 0, 0.4);
  --black-50: rgba(0, 0, 0, 0.5);
  --black-60: rgba(0, 0, 0, 0.6);
  --black-70: rgba(0, 0, 0, 0.7);

  /* Gradients */

  --gradient-primary: linear-gradient(135deg, #5915d8, #7228ee);

  --gradient-purple: linear-gradient(135deg, #490cc2, #5915d8, #962fee);

  --gradient-purple-soft: linear-gradient(
    135deg,
    rgba(73, 12, 194, 0.2),
    rgba(150, 47, 238, 0.1)
  );

  --gradient-dark: linear-gradient(180deg, #000714, #030819);

  --gradient-card: linear-gradient(
    145deg,
    rgba(89, 21, 216, 0.08),
    rgba(0, 8, 21, 0.4)
  );

  /* Glow */

  --glow-sm: 0 0 15px rgba(114, 40, 238, 0.25);

  --glow-md: 0 0 25px rgba(114, 40, 238, 0.35);

  --glow-lg: 0 0 40px rgba(114, 40, 238, 0.3);

  --glow-purple:
    0 0 30px rgba(73, 12, 194, 0.35), 0 0 60px rgba(150, 47, 238, 0.15);

  --glow-cyan: 0 0 20px rgba(69, 182, 216, 0.3);

  /* Shadows */

  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.25);

  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);

  --shadow-lg: 0 15px 50px rgba(0, 0, 0, 0.45);

  --shadow-purple: 0 10px 30px rgba(73, 12, 194, 0.25);

  /* UI */

  --button-primary: #7228ee;
  --button-hover: #962fee;

  --input-bg: rgba(0, 8, 21, 0.7);
  --card-bg: rgba(3, 8, 25, 0.7);

  --overlay: rgba(0, 7, 20, 0.75);

  /* Radius */

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  /* Transition */

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===================== TOKENS ===================== */
:root {
  --bg: #060a16;
  --bg-alt: hsl(225, 56%, 7%);
  --surface: #0d1428;
  --surface-2: #111a33;
  --border: #1b2440;
  --border-soft: #161f38;
  --purple: #6f03ad;
  --purple-2: #9941fd;
  --purple-deep: #6f029b98;
  --cyan: #06c2db;
  --text: #f3f5fb;
  --text-dim: #a6adc4;
  --text-mute: #6b738f;
  --green: #02fa72;
  --font: "Cairo", "Tajawal", sans-serif;
  --neon-green: #00ff88;
  --neon-glow: rgba(0, 255, 136, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}
ul {
  list-style: none;
}

.hero__text {
  width: 100%;
  margin: 0 auto;
  padding: 20px 32px;
}

.hero__inner {
  height: 400px;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 30px;
}

.container-fluid {
  width: 100%;
  padding: 0 30px;
}

/* =========================================
   APP LAYOUT
   ========================================= */

.app-layout {
  min-height: 100vh;
  display: flex;
}

/* =========================================
   SIDEBAR
   ========================================= */

.sidebar {
  width: 250px;
  min-width: 250px;

  min-height: 100vh;

  background: var(--bg-secondary);

  border-right: 1px solid var(--border-purple);

  display: flex;
  flex-direction: column;

  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;

  z-index: 1000;
}

/* Logo */

.sidebar-logo {
  height: 92px;

  display: flex;
  align-items: center;

  padding: 0 20px;

  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 46px;
  height: 46px;

  border: 2px solid var(--purple-bright);

  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--purple-bright);

  font-size: 27px;

  box-shadow: 0 0 18px rgba(114, 40, 238, 0.25);
}

.logo-text {
  margin-left: 14px;
}

.logo-text h5 {
  margin: 0;

  color: var(--text-white);

  font-size: 19px;
  font-weight: 600;
}

.logo-text span {
  color: var(--text-secondary);

  font-size: 12px;
}

/* Sidebar Navigation */

.sidebar-nav {
  padding: 22px 14px;
}

.sidebar-link {
  height: 50px;

  padding: 0 13px;

  display: flex;
  align-items: center;
  gap: 17px;

  color: var(--text);

  border-radius: var(--radius-md);

  margin-bottom: 7px;

  transition:
    background var(--transition-normal),
    color var(--transition-normal),
    box-shadow var(--transition-normal);
}

.sidebar-link i {
  width: 20px;

  text-align: center;

  font-size: 17px;

  color: var(--text-secondary);

  transition: var(--transition-normal);
}

.sidebar-link span {
  font-size: 15px;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--text-white);

  background: linear-gradient(
    90deg,
    rgba(89, 21, 216, 0.13),
    rgba(89, 21, 216, 0.03)
  );
}

.sidebar-link:hover i,
.sidebar-link.active i {
  color: var(--purple-bright);

  filter: drop-shadow(0 0 7px rgba(150, 47, 238, 0.6));
}

/* Security Card */

.security-card {
  margin: auto 18px 18px;

  padding: 17px 15px;

  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  background: rgba(3, 8, 25, 0.45);

  display: flex;
  gap: 12px;
}

.security-icon {
  color: var(--text-white);

  font-size: 17px;
}

.security-card h6 {
  margin: 0 0 7px;

  font-size: 13px;
}

.security-card p {
  margin: 0;

  color: var(--text-secondary);

  font-size: 11px;

  line-height: 1.7;
}

/* =========================================
   MAIN AREA
   ========================================= */

.main-area {
  margin-left: 250px;

  width: calc(100% - 250px);

  min-height: 100vh;

  background:
    radial-gradient(
      circle at 50% 45%,
      rgba(73, 12, 194, 0.035),
      transparent 35%
    ),
    var(--bg);

  display: flex;
  flex-direction: column;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
}
.btn svg {
  flex-shrink: 0;
}
.btn--primary {
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-deep) 100%
  );
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.65);
  display: inline-flex;
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px rgba(124, 92, 255, 0.8);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  border-color: var(--purple-2);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--purple-2);
  background: rgba(124, 92, 255, 0.06);
}
.btn--lg {
  padding: 14px 26px;
  font-size: 15.5px;
}
.btn--block {
  width: 100%;
  margin-top: 18px;
}

/* ===================== HEADER ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 10, 22, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
  padding: 20px 30px;
  direction: ltr !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  width: 200px;
}
.brand__logo {
  width: 48px;
  height: 48px;
  border: 2px solid #8d2bdf;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: grid;
  place-items: center;
  color: #f8f7f8;
  font-weight: 800;
  font-size: 17px;
  background: rgb(104, 3, 236);
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  flex: 1;
  justify-content: center;
  direction: rtl !important;
}
.nav__link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.15s ease;
  position: relative;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}
.nav__link:hover {
  color: var(--text);
}
.nav__link--active {
  color: var(--text);
}
.nav__link--active::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: -27px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
}
.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 4px;
}
.lang-switch .chev {
  opacity: 0.6;
}
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 6px;
  flex-shrink: 0;
}
.burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s ease;
}
.burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.is-open span:nth-child(2) {
  opacity: 0;
}
.burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons duplicated inside the mobile hamburger menu.
   Hidden everywhere by default; only revealed on small screens
   when the mobile nav is open (see the 860px media query). */
.nav__mobile-actions {
  display: none;
}
.nav__mobile-btn-wrap {
  display: block;
  width: 100%;
}

/* ---- جميع الصفحات mega menu ---- */
.nav__pages {
  position: relative;
}
.nav__pages-trigger {
  cursor: pointer;
}
.nav__pages-trigger .chev {
  transition: transform 0.2s ease;
}
.nav__pages.is-open .nav__pages-trigger .chev {
  transform: rotate(180deg);
}
.nav__pages.is-open .nav__pages-trigger {
  color: var(--text);
}
.mega {
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  z-index: 60;
}
.nav__pages.is-open .mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega__col {
  display: flex;
  flex-direction: column;
}
.mega__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-2);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.mega__col a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 7px 0;
  transition: color 0.15s ease;
}
.mega__col a:hover {
  color: var(--cyan);
}

/* =========================================
   MAIN CONTENT
   ========================================= */

.main-content {
  flex: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 35px 30px 55px;
}

/* Error Section */

.error-section {
  width: 100%;

  max-width: 900px;

  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 404 */

.error-number {
  font-size: clamp(100px, 10vw, 145px);

  line-height: 0.9;

  font-weight: 800;

  letter-spacing: -7px;

  background: linear-gradient(135deg, #0d0144, #7228ee 55%, #3b016d);

  -webkit-background-clip: text;
  background-clip: text;

  color: transparent;

  filter: drop-shadow(0 0 20px rgba(114, 40, 238, 0.25));
}

/* Heading */

.error-section h1 {
  margin-top: 12px;

  font-size: clamp(28px, 3vw, 36px);
  font-style: italic;
  font-weight: 500;

  color: var(--text-white);
}

/* Description */

.error-description {
  margin-top: 8px;
  font-family: monospace;
  color: var(--text);

  opacity: 0.92;

  font-size: 14px;

  line-height: 1.8;
}

/* =========================================
   ILLUSTRATION
   ========================================= */

.error-illustration {
  width: 100%;
  height: 270px;

  position: relative;

  margin-top: 5px;
  justify-content: center;
  align-items: center;
  display: flex;
  overflow: hidden;
}

.error-illustration img {
  border-radius: 10px;
  box-shadow: 0 5px 10px rgb(11, 0, 73);
  border: 1px solid var(--bg-tertiary);
}

/* =========================================
   SEARCH
   ========================================= */

.search-container {
  width: 100%;
  max-width: 648px;

  display: flex;

  border: 1px solid var(--border-light);

  background: rgba(3, 8, 25, 0.55);

  border-radius: 8px;

  padding: 6px;

  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

.search-input-wrapper {
  flex: 1;

  display: flex;
  align-items: center;

  padding-left: 11px;
}

.search-input-wrapper i {
  color: var(--text-secondary);

  font-size: 16px;
}

.search-input-wrapper input {
  width: 100%;

  border: 0;
  outline: 0;

  background: transparent;

  color: var(--text-white);

  padding: 11px 12px;

  font-size: 13px;
}

.search-input-wrapper input::placeholder {
  color: var(--text-secondary);
}

#searchBtn {
  width: 105px;

  border: 0;

  border-radius: 6px;

  background: var(--gradient-primary);

  color: var(--text-white);

  font-size: 13px;

  transition: var(--transition-normal);
}

#searchBtn:hover {
  background: linear-gradient(135deg, #7228ee, #962fee);

  box-shadow: var(--glow-sm);
}

/* =========================================
   OR DIVIDER
   ========================================= */

.or-divider {
  width: 100%;
  max-width: 650px;

  display: flex;
  align-items: center;

  gap: 17px;

  margin: 22px 0;
}

.or-divider span {
  height: 1px;

  flex: 1;

  background: var(--border);
}

.or-divider small {
  color: var(--text);

  font-size: 12px;
}

/* =========================================
   ACTIONS
   ========================================= */

.error-actions {
  display: flex;

  gap: 18px;
}

.primary-btn,
.secondary-btn {
  height: 49px;

  min-width: 240px;

  padding: 0 25px;

  border-radius: 7px;

  font-size: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 12px;

  transition: var(--transition-normal);
}

.primary-btn {
  border: 0;

  background: var(--gradient-primary);

  color: var(--text-white);

  box-shadow: 0 8px 25px rgba(73, 12, 194, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);

  box-shadow: var(--glow-md);
}

.secondary-btn {
  border: 1px solid var(--border-purple-medium);

  background: transparent;

  color: var(--text-white);
}

.secondary-btn:hover {
  background: var(--purple-10);

  border-color: var(--purple-bright);

  box-shadow: var(--glow-sm);
}

/* =========================================
   FOOTER
   ========================================= */

.footer {
  border-top: 1px solid var(--purple);

  padding: 20px 42px 12px;

  background: rgba(0, 7, 20, 0.75);
}

/* Footer Brand */

.footer-brand {
  display: flex;
  align-items: center;

  gap: 11px;
}

.footer-logo-icon {
  width: 42px;
  height: 42px;

  border: 2px solid var(--purple);

  border-radius: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--purple-bright);

  font-size: 22px;
}

.footer-brand h5 {
  margin: 0;

  font-size: 15px;
}

.footer-brand span {
  color: var(--text-secondary);

  font-size: 11px;
}

.footer-description {
  color: var(--text-secondary);

  max-width: 270px;

  font-size: 11px;

  line-height: 1.8;

  margin: 13px 0 0 52px;
}

/* Footer titles */

.footer-title {
  color: var(--text-white);

  font-size: 13px;

  font-weight: 500;

  margin-bottom: 12px;
}

/* Footer Links */

.footer-links {
  list-style: none;

  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-secondary);

  font-size: 11px;

  transition: var(--transition-normal);
}

.footer-links a:hover {
  color: var(--purple-light);
}

/* Social */

.social-links {
  display: flex;

  gap: 13px;
}

.social-links a {
  width: 40px;
  height: 40px;

  border: 1px solid var(--border);

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--text-white);

  transition: var(--transition-normal);
}

.social-links a:hover {
  color: var(--purple-light);

  border-color: var(--border-purple-medium);

  box-shadow: var(--glow-sm);

  transform: translateY(-2px);
}

/* Copyright */

.copyright {
  text-align: center;

  color: var(--text-secondary);

  font-size: 11px;

  margin-top: 13px;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1200px) {
  .top-navigation {
    gap: 18px;
  }

  .top-navigation a {
    font-size: 12px;
  }

  .header-actions {
    gap: 9px;
  }

  .signin-btn {
    padding: 0 18px;
  }

  .create-account-btn {
    padding: 0 18px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);

    transition: transform var(--transition-normal);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;

    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
  }

  .top-navigation {
    display: none;
  }

  .topbar {
    padding: 0 20px;
  }

  .header-actions {
    margin-left: auto;
  }

  .language-btn {
    display: none;
  }

  .header-divider {
    display: none;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 30px 18px 45px;
  }

  .error-number {
    font-size: 100px;

    letter-spacing: -5px;
  }

  .error-section h1 {
    font-size: 28px;
  }

  .error-description {
    font-size: 13px;
  }

  .error-illustration {
    height: 230px;
  }

  .broken-document {
    width: 110px;
    height: 140px;
  }

  .tech-ground {
    width: 300px;
  }

  .search-container {
    max-width: 100%;
  }

  .error-actions {
    width: 100%;

    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .footer {
    padding: 30px 25px 15px;
  }
}

@media (max-width: 500px) {
  .topbar {
    height: 70px;
  }

  .signin-btn {
    display: none;
  }

  .create-account-btn {
    height: 40px;

    padding: 0 15px;

    font-size: 12px;
  }

  .error-number {
    font-size: 80px;
  }

  .error-section h1 {
    font-size: 23px;
  }

  .error-description {
    font-size: 12px;
  }

  .error-illustration {
    height: 205px;
  }

  .floating-icon {
    transform: scale(0.75);
  }

  .broken-document {
    width: 95px;
    height: 125px;
  }

  .search-container {
    padding: 5px;
  }

  #searchBtn {
    width: 80px;
  }

  .search-input-wrapper input {
    font-size: 11px;
  }

  .footer {
    padding: 25px 18px 15px;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {
  .topbar {
    height: 64px;
  }

  .topbar-inner {
    padding: 0 16px;
  }

  /* Hide desktop elements */

  .desktop-nav,
  .top-actions {
    display: none;
  }

  /* Brand */

  .dlogo {
    width: 36px;
    height: 36px;

    font-size: 20px;
  }

  .brand-text strong {
    font-size: 15px;
  }

  .brand-text small {
    font-size: 8px;
  }

  /* Hamburger */

  .burger {
    display: flex;
  }

  /* Mobile dropdown */

  .mobile-nav {
    position: absolute;

    top: calc(100% + 8px);
    left: 12px;
    right: 12px;

    display: flex;
    flex-direction: column;

    padding: 10px;

    background: linear-gradient(
      145deg,
      rgba(8, 14, 28, 0.98),
      rgba(5, 10, 22, 0.98)
    );

    border: 1px solid rgba(92, 105, 139, 0.22);

    border-radius: 14px;

    box-shadow:
      0 20px 45px rgba(0, 0, 0, 0.45),
      0 0 25px rgba(91, 33, 182, 0.08);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;
  }

  /* Open state */

  .mobile-nav.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
  }

  /* Links */

  .mobile-nav a {
    min-height: 47px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 0 13px;

    border-radius: 9px;

    color: #8995ad;

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition:
      background 0.2s ease,
      color 0.2s ease;
  }

  .mobile-nav a i {
    width: 20px;

    text-align: center;

    font-size: 16px;

    color: #74819a;
  }

  .mobile-nav a:hover {
    color: #fff;

    background: rgba(124, 58, 237, 0.08);
  }

  .mobile-nav a:hover i {
    color: #a78bfa;
  }

  /* Active */

  .mobile-nav a.active {
    color: #fff;

    background: linear-gradient(
      90deg,
      rgba(124, 58, 237, 0.16),
      rgba(34, 211, 238, 0.04)
    );

    border: 1px solid rgba(124, 58, 237, 0.14);
  }

  .mobile-nav a.active i {
    color: #a78bfa;
  }

  /* Divider */

  .mobile-divider {
    height: 1px;

    margin: 9px 4px;

    background: rgba(100, 115, 145, 0.14);
  }

  /* Account */

  .mobile-account {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 10px 8px 7px;
  }

  .mobile-account .avatar {
    width: 36px;
    height: 36px;
  }

  .mobile-account > div:last-child {
    display: flex;
    flex-direction: column;

    line-height: 1.1;
  }

  .mobile-account strong {
    color: #e8edf7;

    font-size: 11px;
  }

  .mobile-account small {
    margin-top: 4px;

    color: #65728b;

    font-size: 9px;
  }
}

/* =====================================================
   VERY SMALL PHONES
===================================================== */

@media (max-width: 380px) {
  .topbar-inner {
    padding: 0 12px;
  }

  .brand-text small {
    display: none;
  }

  .mobile-nav {
    left: 8px;
    right: 8px;
  }
}

/* ---- Mobile nav / burger breakpoint (desktop untouched above 860px) ---- */
@media (max-width: 860px) {
  .header__actions {
    display: none;
  }
  .nav {
    display: flex;
    position: absolute;
    top: calc(100% + 10px);
    right: 16px;
    left: 16px;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: linear-gradient(
      160deg,
      rgba(9, 15, 30, 0.98),
      rgba(5, 9, 20, 0.98)
    );
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 14px 16px 18px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.55);

    /* Smooth reveal instead of an abrupt display:none/flex swap,
       and no inner scrollbar under normal use. */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;
    transition:
      opacity 0.22s ease,
      transform 0.22s ease,
      visibility 0.22s ease;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 45;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .nav__link {
    width: 100%;
    padding: 13px 6px;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
  }
  .nav__link--active::after {
    display: none;
  }

  .nav__pages {
    width: 100%;
  }
  .nav__pages-trigger {
    width: 100%;
  }
  .mega {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 4px;
    box-shadow: none;
    border-color: var(--border-soft);
    background: var(--surface-2);
    margin-top: 6px;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav__pages.is-open .mega {
    display: grid;
  }
  .mega__col a {
    padding: 9px 4px;
  }

  /* Login / Explore buttons, moved out of the header and shown
     full-width inside the hamburger menu on mobile only. */
  .nav__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 14px;
  }
  .nav__mobile-actions .lang-switch {
    justify-content: center;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
  }
  .nav__mobile-actions .btn--block {
    margin-top: 0;
    width: 100%;
  }
}

/* Extra safety for very narrow phones so the dropdown never
   touches the viewport edges or overlaps the burger/logo. */
@media (max-width: 380px) {
  .header__inner {
    padding: 16px 16px;
  }
  .brand {
    width: auto;
  }
  .nav {
    right: 10px;
    left: 10px;
    padding: 12px 12px 16px;
  }
}
