/* Modern Floating Sidebar - 2025 Design */
:root {
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --sidebar-background: rgba(255, 255, 255, 0.95);
  --sidebar-accent: var(--dentist-blue);
  --sidebar-accent-light: var(--dentist-light-blue);
  --sidebar-text: var(--text-gray);
  --sidebar-text-active: var(--dentist-blue);
  --sidebar-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --sidebar-radius: 16px;
  --transition-speed: 0.3s;
}

/* Main Sidebar Container */
.modern-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-background);
  border-radius: var(--sidebar-radius);
  box-shadow: var(--sidebar-shadow);
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  transition: all var(--transition-speed) ease;
  backdrop-filter: blur(10px);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

/* Inner Scrollable Content */
.sidebar-content {
  height: 100%;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-accent-light) transparent;
}

/* Custom Scrollbar */
.sidebar-content::-webkit-scrollbar {
  width: 5px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: var(--sidebar-accent-light);
  border-radius: 20px;
}

/* Sidebar Header */
.sidebar-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--sidebar-accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.sidebar-header h3 i {
  margin-right: 0.5rem;
  font-size: 1.25rem;
}

/* Navigation Menu */
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.sidebar-nav li {
  margin-bottom: 0.3rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--sidebar-accent), var(--sidebar-accent-light));
  opacity: 0;
  transition: all 0.2s ease;
  border-radius: 0 2px 2px 0;
}

.sidebar-nav a:hover {
  color: var(--sidebar-text-active);
  background-color: rgba(33, 147, 176, 0.05);
}

.sidebar-nav a.active {
  color: var(--sidebar-text-active);
  background-color: rgba(33, 147, 176, 0.1);
  font-weight: 600;
}

.sidebar-nav a.active::before {
  opacity: 1;
}

.sidebar-nav a i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  color: var(--sidebar-accent-light);
  transition: all 0.2s ease;
}

.sidebar-nav a:hover i,
.sidebar-nav a.active i {
  color: var(--sidebar-accent);
}

/* Menu Item Indicator Dot */
.nav-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--sidebar-accent-light);
  margin-right: 0.75rem;
  transition: all 0.2s ease;
}

.sidebar-nav a:hover .nav-indicator,
.sidebar-nav a.active .nav-indicator {
  background-color: var(--sidebar-accent);
  box-shadow: 0 0 0 2px rgba(33, 147, 176, 0.2);
}

/* CTA Box */
.sidebar-cta {
  background: linear-gradient(135deg, var(--dentist-blue) 0%, var(--dentist-light-blue) 100%);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  margin-top: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.sidebar-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  transform: rotate(45deg);
  z-index: 1;
  animation: shimmer 15s linear infinite;
}

@keyframes shimmer {
  0% { transform: rotate(45deg) translateY(30%); }
  100% { transform: rotate(45deg) translateY(-30%); }
}

.sidebar-cta h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
}

.sidebar-cta p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.sidebar-cta .btn {
  width: 100%;
  background-color: white;
  color: var(--dentist-blue);
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.sidebar-cta .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Progress Indicator for sections */
.progress-container {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-container h4 {
  font-size: 0.875rem;
  color: var(--text-gray);
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 6px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.modern-sidebar .progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--dentist-blue, #2193b0), var(--dentist-light-blue, #6dd5ed));
  width: 0;
  transition: width 0.5s ease;
  border-radius: 3px;
}

/* Mobile Toggle Button */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: var(--dentist-blue);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle i {
  transition: transform 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 260px;
  }
}

@media (max-width: 992px) {
  :root {
    --sidebar-width: 240px;
  }
  
  .sidebar-nav a {
    padding: 0.7rem 0.8rem;
  }
}

@media (max-width: 768px) {
  .modern-sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: 280px;
    left: 0;
    top: 0;
    height: 100vh;
    border-radius: 0;
    border: none;
    z-index: 90;
  }

  .modern-sidebar.active {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modern-sidebar.active + .sidebar-toggle {
    display: none;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 89;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* Collapsed State for Medium Screens (Optional) */
@media (min-width: 768px) and (max-width: 992px) {
  .modern-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
  }
  
  .modern-sidebar.collapsed .sidebar-header h3 span,
  .modern-sidebar.collapsed .sidebar-nav a span,
  .modern-sidebar.collapsed .sidebar-cta p,
  .modern-sidebar.collapsed .sidebar-cta h4,
  .modern-sidebar.collapsed .progress-container {
    display: none;
  }
  
  .modern-sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 0.8rem;
  }
  
  .modern-sidebar.collapsed .sidebar-nav a i {
    margin-right: 0;
    font-size: 1.25rem;
  }
  
  .modern-sidebar.collapsed .sidebar-cta {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modern-sidebar.collapsed .sidebar-cta .btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }
  
  .modern-sidebar.collapsed .sidebar-cta .btn span {
    display: none;
  }
  
  .modern-sidebar.collapsed .sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modern-sidebar.collapsed .sidebar-header h3 {
    margin-bottom: 0;
  }
  
  .modern-sidebar.collapsed .sidebar-header h3 i {
    margin-right: 0;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .modern-sidebar {
    --sidebar-background: rgba(30, 41, 59, 0.95);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
  }
  
  .sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
  
  .progress-container {
    border-top-color: rgba(255, 255, 255, 0.05);
  }
  
  .progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-nav a:hover {
    background-color: rgba(33, 147, 176, 0.1);
  }
  
  .sidebar-nav a.active {
    background-color: rgba(33, 147, 176, 0.15);
  }
}