nav {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
}

nav {
  display: block;
}

/* Header Styles */
.header-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: transparent;
  padding: 20px 0;
  transition: all 0.5s ease;
  margin-right: 20px;
}

.main-nav {
  background: rgba(249, 249, 249, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: slideDown 0.5s ease-out;
}

.background-header .main-nav {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.logo img {
  max-height: 50px;
  width: auto;
  transition: all 0.3s ease;
}

@media screen and (max-width: 370px) {
    .logo img {
      max-height: 40px;
      width: auto;
    }
    .profile-trigger {
        padding: 5px 7px !important;
    }
    .menu-trigger span, .menu-trigger span:before, .menu-trigger span:after {
        width: 21px;
    }

    .profile-image1 {
        width: 25px;
        height: 25px;
    }
    .dropdown-arrow {
    font-size: 9px;

}
}

.nav {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 8px;
}

.nav li {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  color: #8865e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
  border-radius: 8px;
}

.nav-link:hover {
  background-color: rgba(136, 101, 225, 0.1);
  color: #6b46c1;
  transform: translateY(-1px);
}

/* Search Styles */
.search-container,
.main-search {
  position: relative;
}

.form-main-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(136, 101, 225, 0.2);
  padding: 2px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  margin: 0px !important;
}

.form-main-search:focus-within {
  border-color: #8865e1;
  box-shadow: 0 0 0 3px rgba(136, 101, 225, 0.1);
}
.input-main-search {
  border: none;
  outline: none;
  padding: 10px 15px;
  background: transparent;
  color: #1f2937;
  font-size: 14px;
  transition: all 0.3s ease;
}

/* الافتراضي (غير مسجل) */
.input-main-search.input-guest-user {
  width: 350px !important;
}

@media screen and (max-width: 1399px) {
  .input-main-search.input-guest-user {
    width: 200px !important;
  }
}

/* مسجل دخول */
.input-main-search.input-auth-user {
  width: 350px !important; /* غيّر القيمة حسب ما بدك */
}

@media screen and (max-width: 1399px) {
  .input-main-search.input-auth-user {
    width: 300px !important;
  }
}

.input-main-search::placeholder {
  color: #9ca3af;
}

.btn-main-search {
  background: linear-gradient(135deg, #8865e1, #6b46c1);
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-main-search:hover {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
  transform: scale(1.05);
}

.btn-main-search i {
  font-size: 16px;
}

/* Expert Button */
.expert-button {
  display: block;
  color: rgb(136, 101, 225);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  text-decoration: none;
  transition: 0.3s;
}


/* Auth Buttons */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-button {
  color: #8865e1;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 2px solid rgba(136, 101, 225, 0.3);
}

.login-button:hover {
  background-color: rgba(136, 101, 225, 0.1);
  border-color: #8865e1;
}

.signup-button {
  background: linear-gradient(135deg, #8865e1, #6b46c1);
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(136, 101, 225, 0.3);
}

.signup-button:hover {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(136, 101, 225, 0.4);
}

/* Mobile Auth Links */
.mobile-auth-item {
  display: none;
  width: 100%;
}

.mobile-auth-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 600;
  margin: 5px 20px;
  transition: all 0.3s ease;
}

.mobile-auth-link.login-link {
  color: #8865e1 !important;
  border: 2px solid rgba(136, 101, 225, 0.3);
}

.mobile-auth-link.login-link:hover {
  background-color: rgba(136, 101, 225, 0.1);
  border-color: #8865e1;
}

.mobile-auth-link.signup-link {
  background: linear-gradient(135deg, #8865e1, #6b46c1);
  color: white !important;
}

.mobile-auth-link.signup-link:hover {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
}

.mobile-auth-link.expert-mobile-link {
  background: rgba(136, 101, 225, 0.1) !important;
  color: #8865e1 !important;
  border: 2px solid rgba(136, 101, 225, 0.3);
}

.mobile-auth-link.expert-mobile-link:hover {
  background: rgba(136, 101, 225, 0.2) !important;
  border-color: #8865e1;
}

/* Menu Toggle */
.menu-trigger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  transition: all 0.3s ease;
  z-index: 10001;
  position: relative;
}

.menu-trigger span,
.menu-trigger span:before,
.menu-trigger span:after {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #8865e1;
  transition: all 0.3s ease;
  position: relative;
}

.menu-trigger span:before,
.menu-trigger span:after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-trigger span:before {
  top: -8px;
}

.menu-trigger span:after {
  top: 8px;
}

.menu-trigger.active span {
  background-color: transparent;
}

.menu-trigger.active span:before {
  transform: rotate(45deg);
  top: 0;
}

.menu-trigger.active span:after {
  transform: rotate(-45deg);
  top: 0;
}

/* User Profile Dropdown Styles */
.user-profile-dropdown {
  position: relative;
  display: inline-block;
  z-index: 9999 !important;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(136, 101, 225, 0.3);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.profile-trigger:hover {
  background: rgba(136, 101, 225, 0.2);
  border-color: rgba(136, 101, 225, 0.5);
  transform: translateY(-1px);
}

.profile-image1 {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.dropdown-arrow {
  color: #8865e1;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.profile-trigger.active .dropdown-arrow {
  transform: rotate(180deg);
}

.user-profile-dropdown .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  background: rgba(255, 255, 254, 0.95) !important;
  backdrop-filter: blur(15px);
  border-radius: 12px !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  min-width: 180px !important;
  width: auto !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) !important;
  transition: all 0.3s ease !important;
  z-index: 10000 !important;
  margin-top: 8px !important;
  border: 1px solid rgba(136, 101, 225, 0.2) !important;
  padding: 0 !important;
  display: block !important;
  float: none !important;
}

.user-profile-dropdown .dropdown-menu.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.user-profile-dropdown .dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 18px !important;
  color: #1e1e1e !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  transition: all 0.3s ease !important;
  border-bottom: 1px solid rgba(136, 101, 225, 0.1) !important;
  width: 100% !important;
  white-space: nowrap !important;
}

.user-profile-dropdown .dropdown-item:last-child {
  border-bottom: none !important;
}

.user-profile-dropdown .dropdown-item:hover {
  background: rgba(136, 101, 225, 0.1) !important;
  color: #8865e1 !important;
  transform: translateX(3px) !important;
}

.user-profile-dropdown .dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

.user-profile-dropdown .dropdown-item i {
  font-size: 16px !important;
  width: 16px !important;
  text-align: center !important;
}

/* Language Toggle Switch Styles */
.language-toggle-container {
  display: flex;
  align-items: center;
  margin-right: 15px;
}

.language-toggle {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(136, 101, 225, 0.3);
  border-radius: 25px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  width: 80px;
  height: 40px;
}

.language-toggle:hover {
  border-color: rgba(136, 101, 225, 0.5);
  transform: translateY(-1px);
}

.lang-option {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #8865e1;
  transition: all 0.3s ease;
  padding: 8px 0;
  cursor: pointer;
}

.lang-option.active {
  color: white;
}

.toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 36px;
  height: 32px;
  background: linear-gradient(135deg, #8865e1, #6b46c1);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(136, 101, 225, 0.3);
}

.language-toggle.arabic .toggle-slider {
  transform: translateX(36px);
}

/* Navigation Dropdown Styles */
.dropdown-nav-item {
  position: relative;
}

.dropdown-trigger {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.dropdown-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.dropdown-nav-item:hover .dropdown-icon,
.dropdown-nav-item.active .dropdown-icon {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 254, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  margin-top: 8px;
  border: 1px solid rgba(136, 101, 225, 0.2);
  padding: 8px 0;
}

.dropdown-nav-item:hover .nav-dropdown-menu,
.dropdown-nav-item.active .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: #1e1e1e;
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 0 8px;
}

.dropdown-nav-link:hover {
  background: rgba(136, 101, 225, 0.1);
  color: #8865e1;
  transform: translateX(3px);
}

.dropdown-nav-link i {
  font-size: 18px;
  color: #8865e1;
  width: 20px;
  text-align: center;
}

.dropdown-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.dropdown-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.2;
}

.dropdown-nav-link:hover .dropdown-desc {
  color: #8865e1;
}

/* Mobile Navigation Items */
.mobile-nav-item {
  display: none;
}

.mobile-language-toggle {
  display: none;
  width: 100%;
  justify-content: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(136, 101, 225, 0.1);
  margin: 0px 0;
}

.desktop-only {
  display: flex;
}

.search-nav-item {
  display: none;
}

/* Responsive Design */
@media (max-width: 1199px) {
  
  .search-nav-item {
    display: block;
    width: 100%;
    padding: 15px 20px;
  }

  .search-nav-item .search-input {
    width: 100%;
  }
  
  .desktop-search,
  .expert-button,
  .auth-buttons {
    display: none !important;
  }
  .header-area {
    padding: 15px 0;
  }

  .main-nav {
    padding: 12px 20px;
    margin: 0 10px;
    flex-wrap: wrap;
    position: relative;
  }

  .logo {
    order: 1;
    flex: 0 0 auto;
  }

  .user-profile-dropdown {
    order: 2;
    flex: 0 0 auto;
    margin: 0 auto;
  }

  .menu-trigger {
    display: flex;
    order: 3;
    flex: 0 0 auto;
  }

  .main-search,
  .expert-button,
  .auth-buttons {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }

  .nav {
    order: 4;
    width: 100%;
    flex-direction: column;
    background: rgba(233, 225, 254, 0.95);
    backdrop-filter: blur(15px);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10000;
    gap: 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }

  .nav.active {
    max-height: 800px;
    opacity: 1;
    visibility: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav.active li {
    opacity: 1;
    transform: translateY(0);
    animation: slideInItem 0.3s ease forwards;
  }

  .nav.active li:nth-child(1) {
    animation-delay: 0.1s;
  }

  .nav.active li:nth-child(2) {
    animation-delay: 0.15s;
  }

  .nav.active li:nth-child(3) {
    animation-delay: 0.2s;
  }

  .nav.active li:nth-child(4) {
    animation-delay: 0.25s;
  }

  .nav.active li:nth-child(5) {
    animation-delay: 0.3s;
  }

  .nav.active li:nth-child(6) {
    animation-delay: 0.35s;
  }

  .nav.active li:nth-child(7) {
    animation-delay: 0.4s;
  }

  .nav.active li:nth-child(8) {
    animation-delay: 0.45s;
  }

  @keyframes slideInItem {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav li {
    display: block;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    animation: none;
  }

  
  .nav li:last-child {
    border-bottom: none;
    margin-bottom: 10px;
  }
.nav li:not(:nth-last-child(2)):not(:last-child) {
  border-bottom: 1px solid rgba(136, 101, 225, 0.1);
}


  .nav-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px 20px;
    font-size: 15px;
    color: #1f2937;
    border-radius: 0;
  }

  .nav-link:hover {
    background-color: rgba(136, 101, 225, 0.1);
    color: #8865e1;
    transform: none;
  }

  /* Hide dropdown items, show direct links */
  .dropdown-nav-item {
    display: none !important;
  }

  .mobile-nav-item {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(136, 101, 225, 0.1);
    text-align: center;
  }

  .mobile-nav-item:last-of-type {
    border-bottom: none;
  }

  .mobile-nav-item .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    padding: 15px 20px;
    font-size: 15px;
    color: #1f2937;
  }

  .mobile-nav-item .nav-link i {
    font-size: 16px;
    color: #8865e1;
    display: none;
  }

  .mobile-nav-item .nav-link:hover {
    background-color: rgba(136, 101, 225, 0.1);
    color: #8865e1;
  }

  .search-nav-item {
    display: block;
    width: 100%;
    padding: 15px 20px;
  }

  .search-nav-item .input-main-search {
    width: 100%;
  }

  .mobile-language-toggle {
    display: flex;
  }

  .mobile-language-toggle .language-toggle-container {
    margin: 0;
    justify-content: center;
  }

  .mobile-auth-item {
    display: block;
  }

  /* Ensure all dropdown elements are hidden on mobile */
  .nav-dropdown-menu,
  .dropdown-content,
  .dropdown-nav-link {
    display: none !important;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .main-nav {
    padding: 12px 18px;
  }
}

@media (max-width: 768px) {
  .main-nav {
    padding: 10px 15px;
    margin: 0 5px;
  }

  .user-profile-dropdown {
    margin-right: 10px;
  }

  .profile-trigger {
    padding: 6px 12px;
  }

  .profile-image1 {
    width: 30px;
    height: 30px;
  }

  .input-main-search {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Better mobile menu trigger positioning */
  .menu-trigger {
    padding: 8px;
  }

  .menu-trigger span,
  .menu-trigger span:before,
  .menu-trigger span:after {
    width: 22px;
    height: 2px;
  }


 
}

@media (max-width: 480px) {
  
  .container {
    padding: 0 10px;
  }

  .main-nav {
    padding: 8px 12px;
    margin: 0;
    border-radius: 0;
  }

  .nav {
    border-radius: 0;
  }
}

/* RTL Support */
[dir="rtl"] .language-toggle-container {
  margin-right: 0;
  margin-left: 15px;
}

[dir="rtl"] .toggle-slider {
  left: auto;
  right: 4px;
}

[dir="rtl"] .language-toggle.arabic .toggle-slider {
  transform: translateX(-36px);
}

[dir="rtl"] .nav-dropdown-menu {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

[dir="rtl"] .dropdown-nav-item:hover .nav-dropdown-menu,
[dir="rtl"] .dropdown-nav-item.active .nav-dropdown-menu {
  transform: translateX(50%) translateY(0);
}

[dir="rtl"] .dropdown-nav-link:hover {
  transform: translateX(-3px);
}

[dir="rtl"] .user-profile-dropdown .dropdown-item:hover {
  transform: translateX(-3px) !important;
}






/* Search Styles */
.search-container,
.desktop-search {
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(136, 101, 225, 0.2);
  padding: 2px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-form:focus-within {
  border-color: #8865e1;
  box-shadow: 0 0 0 3px rgba(136, 101, 225, 0.1);
}

.search-input {
  border: none;
  outline: none;
  padding: 10px 15px;
  background: transparent;
  color: #1f2937;
  font-size: 14px;
  width: 350px;
  transition: all 0.3s ease;
}

/* الافتراضي (غير مسجل) */
.search-input.guest-input {
  width: 350px;
}

@media screen and (max-width: 1399px) {
.search-input.guest-input {
  width: 200px;
  }
}


/* مسجل دخول */
.search-input.auth-input {
  width: 450px; /* غيّر القيمة حسب ما بدك */
}
@media screen and (max-width: 1399px) {
.search-input.auth-input {
  width: 300px;
  }
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-btn {
  background: linear-gradient(135deg, #8865e1, #6b46c1);
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
  transform: scale(1.05);
}

.search-btn i {
  font-size: 16px;
}

.search-nav-item {
  display: none;
}




html[dir="rtl"] .user-profile-dropdown{
  flex-direction: row-reverse;
}



