/* ===========================
   UMEID WEBSITE - NAVIGATION SIDEBAR
   Left sidebar navigation styling
   =========================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background-color: #FFFFFF;
  color: var(--text-primary);
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-lg);
  border-right: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.nav-item {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background-color: var(--bg-light-gray);
  color: var(--primary);
}

.nav-item.active {
  background-color: transparent;
  color: var(--text-secondary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background-color: var(--primary-light);
  border-radius: 0 2px 2px 0;
}

/* Submenu - Absolute positioning below parent */
.nav-submenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  flex-direction: column;
  gap: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  margin-top: 0.5rem;
  min-width: 160px;
  z-index: 100;
  width: 100%;
}

.nav-submenu.active {
  display: flex;
}

.nav-submenu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-submenu.active {
  display: flex;
}

.nav-submenu-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 0;
  transition: all 0.3s ease;
  width: 100%;
  text-align: left;
}

.nav-submenu-item:hover {
  background-color: var(--bg-light-gray);
  color: var(--primary);
}

.nav-submenu-item.active {
  background-color: rgba(107, 70, 193, 0.1);
  color: var(--primary);
  font-weight: 600;
}

/* Submenu Toggle */
.nav-item.has-submenu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
}

.nav-item.has-submenu::after {
  content: '▼';
  font-size: 0.65rem;
  transition: transform 0.3s ease;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.nav-item.has-submenu.active::after {
  transform: rotate(-180deg);
}

.nav-item.has-submenu:hover::after {
  color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: var(--spacing-lg);
  margin-top: auto;
}

.sidebar-cta {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-bottom: var(--spacing-md);
}

.sidebar-cta:hover {
  background-color: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
}

.sidebar-footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  font-size: 0.85rem;
}

.sidebar-footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidebar-footer-link:hover {
  color: var(--primary);
}

/* Mobile Logo */
.mobile-logo {
  display: none;
  position: fixed;
  top: var(--spacing-md);
  left: var(--spacing-md);
  z-index: 500;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
}

/* Mobile Hamburger Menu */
.hamburger {
  display: none;
  position: fixed;
  top: var(--spacing-md);
  left: var(--spacing-md);
  width: 40px;
  height: 40px;
  background-color: white;
  border: 2px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
  z-index: 1001;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  overflow: hidden;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background-color: var(--primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: block;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive - Tablet and below */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .hamburger {
    display: flex;
  }

  body {
    flex-direction: column;
  }

  main {
    margin-left: 0;
  }

  /* Submenu on mobile - revert to inline style */
  .nav-submenu {
    position: static;
    left: auto;
    display: none;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
    background-color: transparent;
    margin-left: var(--spacing-md);
    margin-top: 0.5rem;
    border-left: 2px solid var(--primary);
    padding-left: var(--spacing-md);
  }

  .nav-submenu.active {
    display: flex;
  }
}

/* Mobile - Small screens */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
  }

  .sidebar-header {
    position: relative;
    padding-right: 50px;
  }

  .mobile-logo {
    display: block;
  }

  .hamburger {
    display: flex;
    left: auto;
    right: var(--spacing-md);
    width: 44px;
    height: 44px;
  }

  .hamburger span {
    width: 18px;
  }
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(107, 70, 193, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 70, 193, 0.5);
}
