/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

/* Main Navbar */
.navbar {
  background-color: #7851A9;
  color: white;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  gap: 2rem; /* Increased gap between logo and menu */
}

.navbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.navbar-center {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Logo */
.logo {
  font-size: 1.6rem;
  font-weight: bold;
  font-family: 'Secular One', sans-serif;
  text-decoration: none;
  color: white;
  transition: color 0.3s ease;
}

.logo:hover {
  color: #ffd700;
}

/* Navigation Links */
.nav-links {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  direction: rtl;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Assistant', sans-serif;
}

.nav-link:hover {
  color: #ffd700;
  background-color: rgba(255,255,255,0.1);
}

/* Dropdown Styles */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #7851A9;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  min-width: 200px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease;
  font-family: 'Assistant', sans-serif;
}

.dropdown-menu a:hover {
  background-color: rgba(255,255,255,0.1);
  color: #ffd700;
}

/* User Menu Desktop */
.user-menu-desktop {
  position: relative;
}

.user-menu-btn {
  text-decoration: none;
  background: none;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Assistant', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
}

.user-menu-btn:hover {
  background-color: rgba(255,255,255,0.1);
  color: #ffd700;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #7851A9;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  min-width: 180px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 1001;
}

.user-menu-desktop:hover .user-dropdown {
  display: none !important;
}

.user-dropdown a {
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease;
  font-family: 'Assistant', sans-serif;
}

.user-dropdown a:hover {
  background-color: rgba(255,255,255,0.1);
  color: #ffd700;
}

.logout-btn {
  color: #ff6b6b !important;
}

.logout-btn:hover {
  color: #ff5252 !important;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
  background-color: rgba(255,255,255,0.1);
}

/* User Sidebar */
.user-sidebar {
  margin-top: 69px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background-color: #f8f9fa;
  border-right: 1px solid #e9ecef;
  z-index: 999;
  transition: width 0.3s ease;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  display: none;
}

.user-sidebar.active {
  display: block;
}


.sidebar-header {
  display: flex;
  gap: 0.75rem;
  background-color: #f8f9fa;
  color: white;
  padding: 1rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}
.sidebar-header h3 {
  color: #6816b9;
  margin: 0;
  font-size: 1.1rem;
  align-self: center;
}

.sidebar-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: #fff;
  background-color: #7851A9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  word-break: break-word;
}
.sidebar-email i {
  font-size: 1rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  gap: 12px;
  font-size: 1rem;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.sidebar-item:hover {
  background-color: #f2f2f2;
  cursor: pointer;
}

.sidebar-item i {
  font-size: 1.1rem;
  color: #555;
}

.sidebar-text {
  white-space: nowrap;
  overflow: hidden;
}


.logout-item {
  color: #dc3545;
}

.logout-item:hover {
  background-color: #f8d7da;
  color: #721c24;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: #7851A9;
  z-index: 1002;
  transition: right 0.3s ease;
  overflow-y: auto;
  direction: rtl;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-menu-header h3 {
  margin: 0;
  color: white;
  font-family: 'Assistant', sans-serif;
}

.close-menu {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.close-menu:hover {
  background-color: rgba(255,255,255,0.1);
}

.mobile-menu-section {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-section h4 {
  color: #ffd700;
  margin: 0 0 1rem 0;
  font-family: 'Assistant', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: white;
  text-decoration: none;
  font-family: 'Assistant', sans-serif;
  transition: color 0.3s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
  cursor: pointer;
}

.mobile-link:hover {
  color: #ffd700;
}

.mobile-dropdown {
  margin-bottom: 0.5rem;
}

.mobile-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  color: white;
  cursor: pointer;
  font-family: 'Assistant', sans-serif;
  transition: color 0.3s ease;
}

.mobile-dropdown-header:hover {
  color: #ffd700;
}

.dropdown-arrow {
  margin-right: 0.5em;
  font-size: 0.85em;
  vertical-align: middle;
  transition: transform 0.2s;
}
.dropdown.open > .nav-link .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-arrow.rotated {
  transform: rotate(180deg);
}

.mobile-dropdown-content {
  display: none;
  padding-right: 1rem;
  margin-top: 0.5rem;
}

.mobile-dropdown-content.active {
  display: block;
}

.mobile-dropdown-content .mobile-link {
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.logout-link {
  color: #ff6b6b;
}

.logout-link:hover {
  color: #ff5252;
}

/* Mobile Backdrop */
.mobile-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.5);
  z-index: 1001;
  display: none;
}

.mobile-backdrop.active {
  display: block;
}

.register-btn {
  background-color: #ffb82d;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: solid;
  font-size: medium;
  justify-content: center;
}

/* #registerBtn {
  display: inline-block;
  margin-left: auto;
} */

/* Responsive Design */
@media (max-width: 1024px) {
  .navbar {
    padding: 1rem;
  }
  
  .navbar-center {
    display: none;
  }

  .user-menu-btn {
    display: none !important;
  } 

  #registerBtn {
    display: none !important;
  }
  
  
.navbar-right {
  display: flex;
  flex:auto
}

  .mobile-menu-toggle {
    order: -1;              /* מופיע ראשון */
    margin-left: auto;      /* דוחף אותו לשמאל */
    margin-right: 0;
  }

  /* #registerBtn {
    display: none !important;
  }  */

  .user-menu-desktop {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
     margin-left: 0;
    margin-right: auto;
  }
  
  .user-sidebar {
    display: none !important;
  }
}

.user-sidebar.minimized {
  width: 60px;
}


.user-sidebar.minimized .sidebar-text {
  display: none;
}

.user-sidebar.minimized .sidebar-header h3 {
  display: none;
}

.user-sidebar .minimize-btn {
  background-color: #9085d1;
  border: none;
  color: #f8f9fa;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.2s ease;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
}

.user-sidebar .minimize-btn:hover {
  background-color: #7851A9;
  transform: scale(1.05);
}

.user-sidebar .minimize-btn[title]:hover:after {
  content: attr(title);
  position: absolute;
  left: 40px;
  top: 0;
  background: #333;
  color: #fff;
  padding: 2px 8px;
  border-radius: 1px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 2000;
}


@media (min-width: 1024px) {
  .navbar-center {
    display: flex;
    justify-content: flex-start;
    /* margin-left: 2rem; */
  }
  
  .nav-links {
    justify-content: flex-start;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
  
  .mobile-menu {
    display: none;
  }
  
  .mobile-backdrop {
    display: none;
  }
}

/* Animation for dropdown arrows */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

/* Additional utility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}
