/* ===================================
   MELLSTROY SIDEBAR CSS
   Извлечено из sidebar-final-complete.html
   =================================== */

/* CSS Variables */
:root {
  --sidebar-width-expanded: 272px;
  --sidebar-width-collapsed: 68px;
  --sidebar-color-bg: #281837;
  --sidebar-rounding-full: 20px;
  --sidebar-rounding-compact: 20px;
  
  --color-content-base-primary: #e6e6e6;
  --color-content-base-secondary: #a1a1a1;
  --color-content-base-static-white: #ffffff;
  
  --color-background-base-alfa-neutral-8: rgba(138, 202, 255, 0.08);
  --color-background-base-alfa-neutral-12: rgba(138, 202, 255, 0.12);
  --color-background-base-alfa-neutral-16: rgba(138, 202, 255, 0.16);
  --color-background-base-alfa-static-white-20: rgba(255, 255, 255, 0.2);
  --color-background-base-alfa-static-white-24: rgba(255, 255, 255, 0.24);
  
  --color-border-base-alfa-divider: rgba(138, 202, 255, 0.12);
  
  --menu-tab-color-fg-selected: #c65eff;
  --menu-tab-color-fg-hover: #b633fe;
  --menu-tab-badge-color-bg: #9ee806;
  --menu-tab-badge-color-fg: #000000;
  
  --spacing-2: 2px;
  --spacing-4: 4px;
  --spacing-6: 6px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  
  --size-control-xxs: 24px;
  --size-control-xs: 28px;
  --size-control-s: 32px;
  --size-control-m: 36px;
  --size-control-l: 40px;
  
  --rounding-control-m: 10px;
  --rounding-control-xl: 12px;
  --rounding-max: 999px;
  --rounding-component-badge: 999px;
  
  --opacity-item-active: 0.86;
  
  --font-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body-regular-font-size: 14px;
  --font-body-regular-font-weight: 400;
  --font-body-regular-line-height: 20px;
  --font-body-semibold-font-size: 14px;
  --font-body-semibold-font-weight: 600;
  --font-body-semibold-line-height: 20px;
  
  --font-caption-s-regular-font-size: 12px;
  --font-caption-s-regular-font-weight: 400;
  --font-caption-s-regular-line-height: 16px;
  --font-caption-s-semibold-font-size: 12px;
  --font-caption-s-semibold-font-weight: 600;
  --font-caption-s-semibold-line-height: 16px;
  
  --z-index-sidebar: 130;
  
  --sidebar__transition-duration: 0.4s;
  --sidebar__transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar__close-transition-duration: 400ms;
}

/* Sidebar Root */
.sidebar-mellstroy {
  position: fixed;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: var(--sidebar-width-expanded);
  background-color: var(--sidebar-color-bg);
  border-radius: var(--sidebar-rounding-full);
  z-index: var(--z-index-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--sidebar__transition-duration) var(--sidebar__transition-easing);
  will-change: width;
}

.sidebar-mellstroy.collapsed {
  width: var(--sidebar-width-collapsed);
}

/* Scrollable Content */
.sidebar-mellstroy__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: none;
}

.sidebar-mellstroy__content::-webkit-scrollbar {
  display: none;
}

/* Players Online Section */
.sidebar-mellstroy__online {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px 16px;
  gap: 8px;
}

.sidebar-mellstroy__online-label {
  font-family: var(--font-body-font-family);
  font-size: var(--font-body-regular-font-size);
  font-weight: var(--font-body-regular-font-weight);
  line-height: var(--font-body-regular-line-height);
  color: var(--color-content-base-secondary);
}

.sidebar-mellstroy__online-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-mellstroy__online-dot {
  width: 6px;
  height: 6px;
  background-color: #05bd7d;
  border-radius: 50%;
  position: relative;
}

.sidebar-mellstroy__online-dot::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  width: 16px;
  height: 16px;
  background-color: #05bd7d;
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse 0.4s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(0.7); }
}

.sidebar-mellstroy__online-count {
  font-family: var(--font-body-font-family);
  font-size: var(--font-body-semibold-font-size);
  font-weight: var(--font-body-semibold-font-weight);
  line-height: var(--font-body-semibold-line-height);
  color: var(--color-content-base-primary);
}

/* Expand/Collapse Button Container */
.sidebar-mellstroy__expand-container {
  position: relative;
  height: 1px;
  background: var(--color-border-base-alfa-divider);
  margin: 0 16px;
}

.sidebar-mellstroy__expand-btn {
  position: absolute;
  top: 50%;
  right: calc(var(--size-control-s) / 2 * -1);
  transform: translateY(-50%);
  z-index: 2;
  
  min-width: var(--size-control-s);
  min-height: var(--size-control-s);
  border-radius: var(--rounding-max);
  background-color: var(--sidebar-color-bg);
  color: var(--color-background-base-alfa-neutral-12);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: none;
  transition: background-color 0.1s;
  overflow: hidden;
}

.sidebar-mellstroy__expand-btn:focus-visible {
  outline: none;
}

.sidebar-mellstroy__expand-btn:hover .sidebar-mellstroy__expand-icon,
.sidebar-mellstroy__expand-btn:active .sidebar-mellstroy__expand-icon {
  background-color: var(--color-background-base-alfa-neutral-16);
  color: var(--color-content-base-primary);
}

.sidebar-mellstroy__expand-icon {
  padding: 4px;
  background-color: var(--color-background-base-alfa-neutral-12);
  color: var(--color-content-base-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-mellstroy__expand-icon svg {
  width: 16px;
  height: 16px;
  transition: transform var(--sidebar__transition-duration) var(--sidebar__transition-easing);
}

/* Поворот стрелочки при сворачивании */
.sidebar-mellstroy.collapsed .sidebar-mellstroy__expand-icon svg {
  transform: rotate(180deg);
}

/* Profile Section */
.sidebar-mellstroy__profile-section {
  padding: 0 12px;
  margin-bottom: 12px;
}

.sidebar-mellstroy__profile {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.1s, opacity 0.1s;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.sidebar-mellstroy__profile:hover {
  background-color: var(--color-background-base-alfa-neutral-8);
}

.sidebar-mellstroy__profile:active {
  opacity: var(--opacity-item-active);
}

.sidebar-mellstroy__profile:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.sidebar-mellstroy__profile:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.sidebar-mellstroy__profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-background-base-alfa-neutral-12);
  color: var(--color-content-base-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 600;
}

.sidebar-mellstroy__profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.sidebar-mellstroy__profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-mellstroy__profile-name {
  font-family: var(--font-body-font-family);
  font-size: var(--font-body-semibold-font-size);
  font-weight: var(--font-body-semibold-font-weight);
  line-height: var(--font-body-semibold-line-height);
  color: var(--color-content-base-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.sidebar-mellstroy__profile-id {
  font-family: var(--font-body-font-family);
  font-size: var(--font-caption-s-regular-font-size);
  font-weight: var(--font-caption-s-regular-font-weight);
  line-height: var(--font-caption-s-regular-line-height);
  color: var(--color-content-base-secondary);
}

.sidebar-mellstroy__profile-arrow {
  width: 24px;
  height: 24px;
  color: var(--color-content-base-secondary);
  flex-shrink: 0;
}

/* Menu Tabs (Casino/Sport) */
.sidebar-mellstroy__tabs {
  padding: 0 12px;
  margin-bottom: 12px;
}

.sidebar-mellstroy__tabs-container {
  display: flex;
  width: 100%;
  padding: 2px;
  border-radius: var(--rounding-control-xl);
  background: var(--color-background-base-alfa-neutral-12);
  gap: 3px;
}

.sidebar-mellstroy__tab {
  flex: 1;
  height: var(--size-control-l);
  border-radius: var(--rounding-control-xl);
  background: transparent;
  color: var(--color-content-base-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.1s, opacity 0.1s;
  font-family: var(--font-body-font-family);
  font-size: var(--font-body-semibold-font-size);
  font-weight: var(--font-body-semibold-font-weight);
  line-height: var(--font-body-semibold-line-height);
  border: none;
  text-decoration: none;
}

.sidebar-mellstroy__tab:not(.active):hover {
  background: var(--color-background-base-alfa-neutral-8);
}

.sidebar-mellstroy__tab:not(.active):active {
  opacity: var(--opacity-item-active);
}

.sidebar-mellstroy__tab.active {
  background: linear-gradient(180deg, #993EF7 0%, #B83DF7 100%);
  color: #e6e6e6;
}

.sidebar-mellstroy__tab-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

/* Menu Items */
.sidebar-mellstroy__menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 12px;
}

.sidebar-mellstroy__menu-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-mellstroy__menu-item {
  width: 100%;
  height: var(--size-control-m);
  border-radius: var(--rounding-control-m);
  background: transparent;
  color: var(--color-content-base-secondary);
  cursor: pointer;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  user-select: none;
  transition: background-color 0.1s, opacity 0.1s, color 0.1s;
  font-family: var(--font-body-font-family);
  font-size: 15px;
  font-weight: 600;
  line-height: var(--font-body-regular-line-height);
  border: none;
  text-decoration: none;
  position: relative;
}

.sidebar-mellstroy__menu-item:active {
  opacity: var(--opacity-item-active);
}

.sidebar-mellstroy__menu-item.active {
  color: var(--menu-tab-color-fg-selected);
}

.sidebar-mellstroy__menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: linear-gradient(180deg, #993EF7 0%, #B83DF7 100%);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.sidebar-mellstroy__menu-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: filter 0.1s;
}

.sidebar-mellstroy__menu-icon svg,
.sidebar-mellstroy__menu-icon img {
  width: 24px;
  height: 24px;
  color: var(--color-content-base-secondary);
  fill: currentColor;
  transition: filter 0.1s;
  /* Фильтр для изменения цвета серых иконок (#a1a1a1) */
  filter: brightness(0) saturate(100%) invert(71%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(92%) contrast(87%);
}

.sidebar-mellstroy__menu-item.active .sidebar-mellstroy__menu-icon svg,
.sidebar-mellstroy__menu-item.active .sidebar-mellstroy__menu-icon img {
  color: var(--menu-tab-color-fg-selected);
  fill: currentColor;
  /* Фильтр для изменения цвета фиолетовых иконок (#c65eff) */
  filter: brightness(0) saturate(100%) invert(67%) sepia(89%) saturate(4825%) hue-rotate(238deg) brightness(101%) contrast(101%);
}

.sidebar-mellstroy__menu-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar-mellstroy__menu-badge {
  margin-left: auto;
  border-radius: var(--rounding-component-badge);
  background: var(--menu-tab-badge-color-bg);
  color: var(--menu-tab-badge-color-fg);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 28px;
  padding: 2px 6px;
  font-family: var(--font-body-font-family);
  font-size: var(--font-caption-s-semibold-font-size);
  font-weight: var(--font-caption-s-semibold-font-weight);
  line-height: var(--font-caption-s-semibold-line-height);
}

/* Separator */
.sidebar-mellstroy__separator {
  height: 1px;
  background: var(--color-border-base-alfa-divider);
  margin: 0 20px;
}

/* Footer */
.sidebar-mellstroy__footer {
  padding: 12px;
  background-color: var(--sidebar-color-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-mellstroy__lang {
  width: 100%;
  height: var(--size-control-m);
  padding: 0 8px;
  border-radius: var(--rounding-control-m);
  background-color: var(--color-background-base-alfa-neutral-12);
  color: var(--color-content-base-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  transition: background-color 0.1s, opacity 0.1s;
  font-family: var(--font-body-font-family);
  font-size: var(--font-body-regular-font-size);
  font-weight: var(--font-body-regular-font-weight);
  line-height: var(--font-body-regular-line-height);
  border: none;
}

.sidebar-mellstroy__lang:hover,
.sidebar-mellstroy__lang:active {
  background-color: var(--color-background-base-alfa-neutral-16);
}

.sidebar-mellstroy__lang:active {
  opacity: var(--opacity-item-active);
}

.sidebar-mellstroy__lang-icon {
  width: 20px;
  height: 20px;
  padding: 2px;
}

.sidebar-mellstroy__lang-arrow {
  margin-left: auto;
  color: var(--color-content-base-secondary);
  width: 14px;
  height: 14px;
}

.sidebar-mellstroy__social {
  display: flex;
  gap: 8px;
}

.sidebar-mellstroy__social-link {
  width: var(--size-control-m);
  height: var(--size-control-m);
  border-radius: var(--rounding-control-m);
  background-color: var(--color-background-base-alfa-neutral-12);
  color: var(--color-content-base-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.1s, opacity 0.1s;
  text-decoration: none;
}

.sidebar-mellstroy__social-link:hover {
  background-color: var(--color-background-base-alfa-neutral-16);
}

.sidebar-mellstroy__social-link:active {
  opacity: var(--opacity-item-active);
}

.sidebar-mellstroy__social-link svg {
  width: 20px;
  height: 20px;
}

/* Collapsed State */
.sidebar-mellstroy.collapsed .sidebar-mellstroy__online-label,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__online-count,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__profile-info,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__profile-arrow,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__menu-text,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__menu-badge,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__separator,
.sidebar-mellstroy.collapsed .sidebar-mellstroy__tab span {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0s 0.2s, width 0s 0.2s;
}

/* Плавное появление элементов при разворачивании */
.sidebar-mellstroy__online-label,
.sidebar-mellstroy__online-count,
.sidebar-mellstroy__profile-info,
.sidebar-mellstroy__profile-arrow,
.sidebar-mellstroy__menu-text,
.sidebar-mellstroy__menu-badge,
.sidebar-mellstroy__tab span {
  opacity: 1;
  visibility: visible;
  width: auto;
  transition: opacity 0.3s ease 0.2s, visibility 0s 0s, width 0s 0s;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__online {
  justify-content: center;
  padding: 4px 12px 16px;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__profile-section {
  padding: 0 10px;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__profile {
  justify-content: center;
  padding: 8px 12px;
  gap: 0;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__tabs {
  padding: 0 10px;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__tabs-container {
  flex-direction: column;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__tab {
  padding: 0;
  justify-content: center;
  gap: 0;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__menu {
  padding: 0 10px;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__menu-item {
  padding: 0 12px;
  justify-content: center;
  gap: 0;
}

/* Убираем margin-left у badge в свернутом состоянии */
.sidebar-mellstroy.collapsed .sidebar-mellstroy__menu-badge {
  margin-left: 0;
  position: absolute;
  pointer-events: none;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__footer {
  padding: 12px 10px;
  align-items: center;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__lang {
  padding: 0 12px;
  justify-content: center;
}

.sidebar-mellstroy.collapsed .sidebar-mellstroy__social {
  flex-direction: column;
}

/* Desktop Only (768px+) */
@media (min-width: 768px) {
  .sidebar-mellstroy {
    display: flex;
  }
}

@media (max-width: 767px) {
  .sidebar-mellstroy {
    display: none;
  }
}

/* Main Content Adjustment */
.main-content-wrapper {
  margin-left: calc(var(--sidebar-width-expanded) + 16px);
  transition: margin-left var(--sidebar__transition-duration) var(--sidebar__transition-easing);
  will-change: margin-left;
}

.main-content-wrapper.sidebar-collapsed {
  margin-left: calc(var(--sidebar-width-collapsed) + 16px);
}

/* Alternative: using body class */
body.sidebar-collapsed .main-content-wrapper {
  margin-left: calc(var(--sidebar-width-collapsed) + 16px);
}

@media (max-width: 767px) {
  .main-content-wrapper {
    margin-left: 0;
  }
}
