/* User Sidebar Styles */

.user-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100vh;
  background: #1E1E1E;
  border-left: 1px solid #444444;
  z-index: 1050;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.user-sidebar.open {
  right: 0;
}

@media (max-width: 768px) {
  .user-sidebar {
    width: 100%;
    right: -100%;
  }
}

.user-sidebar-header {
  padding: 24px;
  border-bottom: 1px solid #444444;
  position: relative;
}

.user-sidebar-header .sidebar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #2D2D2D;
  border: 1px solid #444444;
  color: #E0E0E0;
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.user-sidebar-header .sidebar-close:hover {
  background: #3D3D3D;
}

.user-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
}

.user-profile .user-sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #8A2BE2;
  object-fit: cover;
}

.user-details {
  text-align: center;
}

.user-details h3 {
  margin: 0 0 8px 0;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.user-details .user-id {
  margin: 0;
  color: #8a2be2;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  filter: drop-shadow(0 0 4px rgba(138, 43, 226, 0.3));
}

.user-sidebar-nav {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  color: #E0E0E0;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background-color 0.2s ease;
  font-weight: 500;
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  background: #2D2D2D;
  border-color: #444444;
}

.sidebar-nav-item.active {
  background: #8A2BE2;
  color: #FFFFFF;
}

.sidebar-nav-item.active i {
  color: #FFFFFF;
}

.sidebar-nav-item i {
  font-size: 16px;
  color: #B0B0B0;
  width: 20px;
  text-align: center;
}

.sidebar-nav-item span {
  font-size: 14px;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 20px 0;
  border: none;
}

.admin-item {
  color: #ffc107;
}

.admin-item i {
  color: #ffc107;
}

.admin-item:hover {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
}

.user-sidebar-logout {
  padding: 16px 24px;
  border-top: 1px solid #444444;
}

.logout-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: #F44336;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logout-button:hover {
  background: #D32F2F;
}

.logout-button i {
  font-size: 16px;
}

.user-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1049;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.user-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-sidebar-header {
    padding: 24px;
  }

  .user-profile {
    gap: 16px;
  }

  .user-profile .user-sidebar-avatar {
    width: 64px;
    height: 64px;
  }

  .user-details h3 {
    font-size: 18px;
  }

  .user-details .user-id {
    font-size: 12px;
  }

  .user-sidebar-nav {
    padding: 20px;
  }

  .sidebar-nav-item {
    padding: 12px 14px;
    font-size: 14px;
  }

  .sidebar-nav-item i {
    font-size: 16px;
  }

  .user-sidebar-logout {
    padding: 20px;
  }

  .logout-button {
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* No complex animations - just simple slide transition */

/* Custom scrollbar for sidebar nav */
.user-sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.user-sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.user-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(138, 43, 226, 0.5);
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 43, 226, 0.8);
}

/* Accessibility improvements */
.sidebar-nav-item:focus {
  outline: 2px solid #4facfe;
  outline-offset: 2px;
  background: rgba(79, 172, 254, 0.2);
}

.logout-button:focus {
  outline: 2px solid #ff4757;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .user-sidebar {
    border-left: 2px solid #fff;
    background: #000;
  }

  .sidebar-nav-item {
    border: 1px solid transparent;
  }

  .sidebar-nav-item:hover {
    border-color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .user-sidebar,
  .user-sidebar-overlay {
    transition: none;
  }

  .user-sidebar.open {
    animation: none;
  }
}
