/* Sidebar Navigation Styles */

#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background-color: white;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  transform: translateX(0);
}

#sidebar.sidebar-hidden {
  transform: translateX(-100%);
}

#toggle-sidebar {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#toggle-sidebar:hover {
  background-color: #2563eb;
}

.sidebar-content {
  padding: 60px 0 20px 0;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section h3 {
  padding: 0 20px 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 10px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #374151;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background-color: #f3f4f6;
  color: #3b82f6;
  border-left-color: #3b82f6;
}

.sidebar-nav a.active {
  background-color: #eff6ff;
  color: #3b82f6;
  border-left-color: #3b82f6;
  font-weight: 500;
}

.sidebar-nav i {
  width: 20px;
  margin-right: 12px;
  text-align: center;
  font-size: 16px;
}

.sidebar-nav .nav-text {
  font-size: 14px;
}

/* Sign out button styling */
.sidebar-nav .sign-out-form {
  width: 100%;
}

.sidebar-nav .sign-out-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  color: #374151;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.sidebar-nav .sign-out-btn:hover {
  background-color: #f3f4f6;
  color: #dc2626;
  border-left-color: #dc2626;
}

.sidebar-nav .sign-out-btn i {
  width: 20px;
  margin-right: 12px;
  text-align: center;
  font-size: 16px;
}

/* Main content adjustment */
body.sidebar-expanded main {
  margin-left: 250px;
  transition: margin-left 0.3s ease-in-out;
}

body:not(.sidebar-expanded) main {
  margin-left: 0;
  transition: margin-left 0.3s ease-in-out;
}

/* Content wrapper adjustment */
body.sidebar-expanded .content-wrapper {
  margin-left: 250px;
  transition: margin-left 0.3s ease-in-out;
}

body:not(.sidebar-expanded) .content-wrapper {
  margin-left: 0;
  transition: margin-left 0.3s ease-in-out;
}

/* Responsive design */
@media (max-width: 768px) {
  #sidebar {
    width: 280px;
  }
  
  body.sidebar-expanded main,
  body.sidebar-expanded .content-wrapper {
    margin-left: 0;
  }
  
  #sidebar {
    z-index: 1050;
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }
  
  body.sidebar-expanded .sidebar-overlay {
    display: block;
  }
}

/* Ensure sidebar content is scrollable */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}