/*  ------------ header nav ----------- */
nav {
  position: relative;
  top: 5px;
  left: 0;
  width: 100%;
  height: 100%;
  height: 70px;
  background: var(--background);
  /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); */
  z-index: 99;
}
nav .navbar {
  height: 100%;
  max-width: 1250px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
  padding: 0 50px;
}
.navbar .logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.navbar .logo img {
  vertical-align: middle;
  width: 70px;
  height: auto;
}

.sidebar-logo img {
  vertical-align: middle;
  width: 70px;
  height: auto;
}
nav .navbar .nav-links {
  line-height: 70px;
  height: 100%;
}

nav .navbar .links {
  display: flex;
}

nav .navbar .links li {
  position: relative;
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0 14px;
}

nav .navbar .links li a {
  height: 100%;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-color);
  transition: var(--transition);
  font-size: 15px;
  font-weight: 500;
}

nav .navbar .links li a:hover,
nav .navbar .links li a.active {
  color: var(--primary-color);
}

/* Arrow Styling - All Levels */
nav .navbar .links li .arrow,
.navbar .links li .sub-menu .more-arrow,
.navbar .links li .sub-menu .more-more-arrow {
  height: 100%;
  width: 22px;
  line-height: inherit;
  text-align: center;
  display: inline-block;
  color: var(--text-color);
  transition: all 0.3s ease;
  transform: rotate(0deg);
}

html[dir="rtl"] .navbar .links li .sub-menu .more-arrow,
html[dir="rtl"] .navbar .links li .sub-menu .more-more-arrow {
  transform: rotate(180deg);
}
/* First Level Arrow */
.links li:hover .first-arrow {
  transform: rotate(90deg);
}

/* Second Level Arrow */
.links li .sub-menu .more:hover .more-arrow {
  transform: rotate(90deg);
}

html[dir="rtl"] .links li .sub-menu .more:hover .more-arrow {
  transform: rotate(90deg);
}

/* Third Level Arrow */
.links li .sub-menu .more-more:hover .more-more-arrow {
  transform: rotate(90deg);
}

html[dir="rtl"] .links li .sub-menu .more-more:hover .more-more-arrow {
  transform: rotate(90deg);
}

/* Arrow Hover Effects for All Levels */
.links li .arrow:hover,
.links li .sub-menu .more-arrow:hover,
.links li .sub-menu .more-more-arrow:hover {
  color: var(--primary-color);
}

/* Common Submenu Styles */
nav .navbar .links li .sub-menu,
.navbar .links li .sub-menu .more-sub-menu,
.navbar .links li .sub-menu .more-sub-sub-menu {
  position: absolute;
  background: var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 4px 4px;
  display: none;
  z-index: 2;
  transition: all 0.3s ease;
  min-width: 180px;
}

/* First Level Submenu */
nav .navbar .links li .sub-menu {
  top: 70px;
  left: 0;
  line-height: 40px;
}

nav .navbar .links li:hover .more-menu,
nav .navbar .links li:hover .js-sub-menu {
  display: block;
}

/* Second Level Submenu */
.navbar .links li .sub-menu .more-sub-menu {
  top: 0;
  left: 100%;
  border-radius: 0 4px 4px 4px;
}

/* Third Level Submenu */
.navbar .links li .sub-menu .more-sub-sub-menu {
  top: 0;
  left: 100%;
  border-radius: 0 4px 4px 4px;
}

/* Adjust submenu positioning for RTL layout */
html[dir="rtl"] .navbar .links li .sub-menu .more-sub-menu,
html[dir="rtl"] .navbar .links li .sub-menu .more-sub-sub-menu {
  left: auto;
  right: 100%;
  border-radius: 4px 0 4px 4px;
}

/* Show Submenus on Hover */
.links li .sub-menu .more:hover .more-sub-menu,
.links li .sub-menu .more-more:hover .more-sub-sub-menu {
  display: block;
}

/* Submenu Items Styling */
.navbar .links li .sub-menu li {
  padding: 0 22px;
  border-bottom: 1px solid var(--border-color);
}

.navbar .links li .sub-menu a {
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  display: block;
  padding: 8px 0;
}

.navbar .links li .sub-menu a:hover,
.navbar .links li .sub-menu a.active {
  color: var(--primary-color);
}

/* Span container for all menu levels */
.navbar .links li span,
.navbar .links li .sub-menu li span,
.navbar .links li .sub-menu .more-sub-menu li span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

/* Arrow alignment for all levels */
.navbar .links li .arrow,
.navbar .links li .sub-menu .more-arrow,
.navbar .links li .sub-menu .more-more-arrow {
  line-height: inherit;
  height: 40px;
  display: flex;
  align-items: center;
}

/* Added hover effect for menu items */
.navbar .links li:hover {
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

/* Main level arrow alignment */
nav .navbar .links > li > span {
  display: flex;
  align-items: center;
}

/* search-box */
.navbar .search-box {
  position: relative;
  height: 40px;
  width: 40px;
}
.navbar .search-box i {
  position: absolute;
  height: 100%;
  width: 100%;
  line-height: 40px;
  text-align: center;
  font-size: 22px;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.navbar .search-box .input-box {
  position: absolute;
  right: calc(100% - 40px);
  top: 80px;
  height: 60px;
  width: 300px;
  background: var(--background);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}
.navbar.showInput .search-box .input-box {
  top: 65px;
  opacity: 1;
  pointer-events: auto;
  background: var(--background);
}
.search-box .input-box::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  background: var(--background);
  right: 10px;
  top: -6px;
  transform: rotate(45deg);
}
.search-box .input-box input {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 4px;
  transform: translate(-50%, -50%);
  height: 35px;
  width: 280px;
  outline: none;
  padding: 0 15px;
  font-size: 16px;
  border: none;
}
.navbar .nav-links .sidebar-logo {
  display: none;
}
.navbar .bx-menu {
  display: none;
}
@media (max-width: 920px) {
  nav .navbar {
    max-width: 100%;
    padding: 0 25px;
  }

  nav .navbar .logo a {
    font-size: 27px;
  }
  nav .navbar .links li {
    padding: 0 10px;
    white-space: nowrap;
  }
  nav .navbar .links li a {
    font-size: 15px;
  }
}
@media (max-width: 768px) {
  .navbar .bx-menu {
    display: block;
  }
  nav .navbar .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    display: block;
    max-width: 270px;
    width: 100%;
    background: var(--background);
    line-height: 40px;
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    z-index: 1000;
  }
  .navbar .nav-links .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-logo .logo-name {
    font-size: 25px;
    color: var(--text-color);
  }
  .sidebar-logo i,
  .navbar .bx-menu {
    font-size: 25px;
    color: var(--text-color);
  }
  nav .navbar .links {
    display: block;
    margin-top: 20px;
  }

  /* Adjust submenu positioning for RTL layout */
  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-menu,
  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-sub-menu {
    left: auto;
    right: 0;
    border-radius: 4px 0 4px 4px;
  }

  nav .navbar .links li {
    display: block;
    position: relative;
  }

  /* Common Submenu Styles */
  nav .navbar .links li .sub-menu,
  .navbar .links li .sub-menu .more-sub-menu,
  .navbar .links li .sub-menu .more-sub-sub-menu {
    position: relative;
    top: 0;
    box-shadow: none;
    display: none;
    left: 0;
  }

  .navbar .links li .sub-menu.active,
  .navbar .links li .sub-menu .more-sub-menu.active,
  .navbar .links li .sub-menu .more-sub-sub-menu.active {
    display: block;
  }

  .navbar .links li .arrow {
    cursor: pointer;
    padding-left: 5px;
  }
}

@media (max-width: 370px) {
  nav .navbar .nav-links {
    max-width: 100%;
  }

  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-menu,
  html[dir="rtl"] .navbar .links li .sub-menu .more-sub-sub-menu {
    left: auto;
    right: 0;
    border-radius: 4px 0 4px 4px;
  }
}
/* ------------------------------ */
/* toggles */
.toggles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
}

/* Theme Toggle in Navigation */
.theme-toggle-nav {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
}
.theme-toggle-nav:hover {
  color: var(--primary-color);
}
.theme-toggle-nav i {
  font-size: 1.2rem;
}

/* Language Toggle Container */
.language-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}
.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sliderLanguage {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary-color);
  border-radius: 34px;
  transition: 0.4s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  font-size: 0.9rem;
}
.language-text {
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  pointer-events: none;
}
.language-text.en {
  pointer-events: auto;
}
.language-text.ar {
  pointer-events: auto;
}
input:checked + .sliderLanguage .language-text.en {
  pointer-events: none;
}
input:checked + .sliderLanguage .language-text.ar {
  pointer-events: auto;
}
.sliderLanguage a:hover {
  text-decoration: underline;
}
.sliderLanguage:before {
  position: absolute;
  content: "";
  height: 28px;
  width: 28px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}
input:checked + .sliderLanguage {
  background-color: var(--primary-color);
}
input:checked + .sliderLanguage:before {
  transform: translateX(45px);
}
@media (max-width: 576px) {
  .switch {
    width: 60px;
    height: 26px;
  }
  .sliderLanguage {
    font-size: 0.8rem;
    padding: 0 8px;
  }
  .sliderLanguage:before {
    height: 22px;
    width: 22px;
    bottom: 2px;
    left: 3px;
  }
  input:checked + .sliderLanguage:before {
    transform: translateX(32px);
  }
}

@media (max-width: 768px) {
  .switch {
    width: 70px;
    height: 30px;
  }
  .sliderLanguage {
    font-size: 0.85rem;
    padding: 0 9px;
  }
  .sliderLanguage:before {
    height: 25px;
    width: 25px;
    bottom: 3px;
    left: 4px;
  }
  input:checked + .sliderLanguage:before {
    transform: translateX(38px);
  }
}

@media (min-width: 992px) {
  .switch {
    width: 80px;
    height: 34px;
  }
  .sliderLanguage {
    font-size: 0.9rem;
  }
  .sliderLanguage:before {
    height: 28px;
    width: 28px;
  }
  input:checked + .sliderLanguage:before {
    transform: translateX(45px);
  }
}

/*search */
.openBtn {
  background: none;
  border: none;
  padding: 10px 15px;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-color);
}
.openBtn:hover {
  color: var(--primary-color);
}
.overlay {
  height: 100%;
  width: 100%;
  display: none;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.9);
}
.overlay-content {
  position: relative;
  top: 46%;
  width: 80%;
  text-align: center;
  margin-top: 30px;
  margin: auto;
}
.overlay .closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  font-size: 60px;
  cursor: pointer;
  color: white;
}
.overlay .closebtn:hover {
  color: #ccc;
}
.overlay input[type="text"] {
  padding: 15px;
  font-size: 17px;
  border: none;
  float: left;
  width: 80%;
  background: white;
}
.overlay input[type="text"]:hover {
  background: #f1f1f1;
}
.overlay button {
  float: left;
  width: 20%;
  padding: 15px;
  background: #ddd;
  font-size: 17px;
  border: none;
  cursor: pointer;
}
.overlay button:hover {
  background: #bbb;
}
