/* Permanent Left Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 80px;
  height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  border-right: 1px solid #e2e8f0;
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
}

.sidebar:hover {
  width: 280px;
}

.sidebar-header {
  padding: 0 1rem 1.5rem;
  border-bottom: 1px solid #cbd5e1;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #7c3aed;
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  opacity: 1;
  transition: all 0.3s ease;
}

.sidebar-logo span {
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.sidebar:hover .sidebar-logo span {
  opacity: 1;
  width: auto;
}

.sidebar-logo::before {
  content: "";
  width: 36px;
  height: 36px;
  background-image: url('../images/Logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.sidebar-nav a:last-child {
  border-bottom: none;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #7c3aed;
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: bottom;
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
  transform: scaleY(1);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.05);
}

.sidebar-nav a.active {
  background: rgba(124, 58, 237, 0.1);
  font-weight: 600;
}

.sidebar-nav a i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav a span {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar:not(:hover) .sidebar-nav a span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Content adjustment for permanent sidebar */
.main-content {
  margin-left: 80px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar.sidebar-expanded,
  .sidebar:hover {
    width: 250px;
  }
  .main-content {
    margin-left: 60px;
  }
  .sidebar-nav a {
    padding: 0.75rem;
  }
  .sidebar-nav a i {
    font-size: 1.1rem;
  }
  .sidebar.sidebar-expanded .sidebar-logo span,
  .sidebar.sidebar-expanded .sidebar-nav a span {
    opacity: 1;
    width: auto;
    transition: opacity 0.3s, width 0.3s;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 50px;
  }
  .sidebar.sidebar-expanded,
  .sidebar:hover {
    width: 220px;
  }
  .main-content {
    margin-left: 50px;
  }
  .sidebar.sidebar-expanded .sidebar-logo span,
  .sidebar.sidebar-expanded .sidebar-nav a span {
    opacity: 1;
    width: auto;
    transition: opacity 0.3s, width 0.3s;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 50px;
  }
  
  .sidebar:hover {
    width: 220px;
  }
  
  .main-content {
    margin-left: 50px;
  }
}
