/* Боковое меню с эффектом наведения - минималистичный стиль */
.hover-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 64px;
  background: transparent;
  z-index: 1000;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}

.hover-sidebar.expanded {
  width: 240px;
}

/* Кнопка закрытия */
.sidebar-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: none;
}

.hover-sidebar.expanded .sidebar-close {
  opacity: 1;
}

.sidebar-close:hover {
  color: #000;
}

.sidebar-close::before {
  content: '×';
  font-size: 28px;
  font-weight: 300;
}

/* Логотип в меню */
.sidebar-logo-section {
  padding: 32px 8px;
  
  min-height: 24px;
  width: 64px;
}

.sidebar-logo-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar-logo-full {
  display: none;
  align-items: center;
  width: 100%;
}

.hover-sidebar.expanded .sidebar-logo-compact {
  display: none;
}

.hover-sidebar.expanded .sidebar-logo-full {
  display: flex;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.hover-sidebar.expanded .sidebar-logo {
  width: auto;
  height: 32px;
  max-width: 180px;
}

/* Навигационное меню */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
}

.sidebar-menu-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-item {
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #FFF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
  border-radius: 8px;
  margin: 0 8px;
}

.sidebar-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: #000;
}

.sidebar-link.active {
  background-color: rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.sidebar-link-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0;
  transition: margin-right 0.3s ease;
}

.sidebar-link-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
}

.hover-sidebar.expanded .sidebar-link-icon {
  margin-right: 12px;
}

.sidebar-link-text {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
  flex: 1;
}

.hover-sidebar.expanded .sidebar-link-text {
  opacity: 1;
}

/* Кнопка установки плагина внизу меню */
.sidebar-footer {
  padding: 20px 0;
 
}

.sidebar-link-plugin {
  margin: 0 8px;
}

/* Адаптация основного контента */
body {
  transition: padding-left 0.3s ease;
  padding-left: 60px;
}

body.sidebar-expanded {
  padding-left: 240px;
}

/* Контейнер контента центрируется на оставшемся пространстве */
#the_page {
  transition: margin-left 0.3s ease, margin-right 0.3s ease;
  margin-left: 0;
  margin-right: 0;
}

/* Сохраняем стандартные стили контейнера с правильным центрированием */
#the_page.container {
  width: 100%;
  max-width: 1170px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
  .hover-sidebar {
    width: 0;
    box-shadow: none;
  }
  
  .hover-sidebar.expanded {
    width: 280px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
  }
  
  body {
    padding-left: 0 !important;
  }
  
  body.sidebar-expanded {
    padding-left: 0 !important;
  }
  
  #the_page.container {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100%;
  }
  
  /* Overlay для мобильных */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  body.sidebar-expanded .sidebar-overlay {
    display: block;
  }
}

/* Планшеты */
@media (min-width: 769px) and (max-width: 1024px) {
  .hover-sidebar.expanded {
    width: 220px;
  }
  
  body.sidebar-expanded {
    padding-left: 220px;
  }
}
