* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
}

body {
  direction: rtl;
}

.navbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #11171e;
  color: white;
  padding: 0 1rem;
  height: 80px;
}

.logo {
  height: 60px;
  width: 50px;
  margin-left: 10px;
}

.right-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item {
  padding: 0 12px;
  font-size: 18px;
  color: #ffffff;
  text-decoration: none;
  font-family: in;
}

.dark-mode-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin: 0 12px;
}

.search-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.cta-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    align-self: flex-start;
}
.register-btn {
  background-color: transparent !important;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.login-btn {
  background-color: #007bff;
  border: none;
}

.active {
  position: relative;
  font-weight: bold;
}

.active::after {
  content: "";
  position: absolute;
  bottom: -14px;
  right: 0;
  width: 100%;
  height: 3px;
}

/* Default state - hidden on desktop */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  position: relative;
  transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: white;
  left: 0;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  bottom: -8px;
}

/* Add hamburger animation styles */
.hamburger.active {
  background: transparent;
}

.hamburger.active::before {
  top: 0;
  transform: rotate(45deg);
  transition: all 0.3s;
}

.hamburger.active::after {
  bottom: 0;
  transform: rotate(-45deg);
  transition: all 0.3s;
}

/* Default RTL (Arabic) styles */
html[lang="ar"] .navbar {
  direction: rtl;
}

html[lang="ar"] .right-nav {
  margin-right: 0;
  margin-left: auto;
}

html[lang="ar"] .logo {
  margin-left: 10px;
  margin-right: 0;
}

html[lang="ar"] .cta-button {
  margin-left: 10px;
  margin-right: 0;
}

html[lang="ar"] .active::after {
  right: 0;
  left: auto;
}

/* LTR (English) styles */
html[lang="en_US"] .navbar {
  direction: ltr;
}

html[lang="en_US"] .right-nav {
  margin-left: 0;
  margin-right: auto;
}

html[lang="en_US"] .logo {
  margin-right: 10px;
  margin-left: 0;
}

html[lang="en_US"] .cta-button {
  margin-right: 10px;
  margin-left: 0;
}

html[lang="en_US"] .active::after {
  left: 0;
  right: auto;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  /* Show menu toggle on mobile */
  .menu-toggle {
    display: block;
    z-index: 100;
  }

  /* RTL (Arabic) mobile styles */
  html[lang="ar"] .menu-toggle {
    order: 2;
  }

  html[lang="ar"] .right-nav {
    order: 1;
  }

  html[lang="ar"] .nav-menu {
    right: 0;
    left: auto;
  }

  /* LTR (English) mobile styles */
  html[lang="en_US"] .menu-toggle {
    order: 1;
  }

  html[lang="en_US"] .right-nav {
    order: 2;
  }

  html[lang="en_US"] .nav-menu {
    left: 0;
    right: auto;
  }

  .right-nav .nav-item:not(.dropdown) {
    display: none;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 80px;
    right: 0;
    width: 100%;
    background-color: #11171e;
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    z-index: 99;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .nav-menu.active {
    display: flex;
  }

  /* Dropdown specific mobile styles */
  .dropdown {
    position: static;
      width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    text-align: center;
    padding: 1rem;
    display: block;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    display: none;
    margin-top: 10px;
    background-color: #1a2329;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
  }
  .dropdown.active .dropdown-menu,
  .dropdown:hover .dropdown-menu {
    display: block;
  }

  .dropdown-item {
    padding: 0.75rem 1.5rem;
    color: #ffffff;
  }

  /* Move nav items to menu in mobile view */
  .nav-menu .nav-item {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem;
  }

  .nav-menu .search-button,
  .nav-menu .dark-mode-toggle {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: center;
  }

  .cta-button {
    align-self: center !important;
  }
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
  z-index:999;
}

.dropdown-toggle {
  cursor: pointer;
  text-decoration: none;
  color: white;
}

.dropdown-toggle::after {
  content: "";
  display: inline-block;
  margin-left: 0.5em;
  vertical-align: middle;
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  z-index:999;
  left: 0;
  z-index: 1000;
  min-width: 200px;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  background-color: #11171e;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--navbar-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s;
  z-index:999;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.category-count {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .dropdown-menu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
  }

  .dropdown-item {
    padding: 0.75rem 1.5rem;
  }
}

/* Search styles */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  background: none;
  border: none;
  color: var(--navbar-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.search-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.search-bar {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--navbar-bg);
  padding: 5px;
  border-radius: 20px;
  display: none;
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
}

.search-bar.active {
  display: flex;
  align-items: center;
  width: 300px;
  background: rgba(255, 255, 255, 0.1);
}

.search-bar input {
  width: 100%;
  padding: 8px 15px;
  border: none;
  background: transparent;
  color: var(--navbar-text);
  font-size: 14px;
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-bar input:focus {
  outline: none;
}

.close-search {
  background: none;
  border: none;
  color: var(--navbar-text);
  font-size: 20px;
  cursor: pointer;
  padding: 0 10px;
}

/* RTL support */
html[dir="rtl"] .search-bar {
  right: auto;
  left: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .search-bar.active {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    transform: none;
    z-index: 1000;
  }
}
