/* ============================================================
   Sekai — sidebar.css
   Узкий иконочный сайдбар (как на макете): иконки + тултипы.
============================================================ */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: auto;
  align-self: flex-start;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-left: none;
  border-radius: 0 30px 30px 0;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: visible;
  z-index: 30;
}

/* Лого сверху — звезда SEKAI */
.sb-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(109, 140, 255, 0.16), rgba(109, 140, 255, 0.03));
  border: 1px solid var(--glass-line-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0;
  color: var(--text);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16),
              0 6px 18px rgba(40, 70, 180, 0.25);
  margin-bottom: 10px;
  cursor: default;
  position: relative;
}

.sb-logo-mark {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1c.9 6.6 4.5 10.2 11 11-6.5.8-10.1 4.4-11 11-.9-6.6-4.5-10.2-11-11 6.5-.8 10.1-4.4 11-11z' fill='%23e6edff'/%3E%3C/svg%3E") center / 22px no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: none;
}

.sb-logo-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Разделитель */
.sb-sep {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-line-hover), transparent);
  margin: 12px 0;
  flex-shrink: 0;
}

/* Навигация */
.sb-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow: visible;
  padding: 2px 0;
}

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

/* ============================================================
   САЙДБАР ПЛОЩАДОК (отдельный, склеен с основным слева)
   ============================================================ */
.sidebars-group {
  display: flex;
  align-items: flex-start;
  gap: 0;
  align-self: flex-start;
  margin: 16px 0;
  flex-shrink: 0;
}

.platforms-sidebar {
  width: 56px;
  min-width: 56px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 4px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-right: none;
  border-radius: 30px 0 0 30px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: visible;
  z-index: 30;
  flex-shrink: 0;
}

.ps-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ps-nav .sb-item { width: 48px; height: 48px; }

/* Пункт — квадратная иконка */
.sb-item {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  flex-shrink: 0;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  border-color: var(--glass-line);
}

.sb-item:active { transform: scale(0.94); }

.sb-item.active {
  background: linear-gradient(180deg, rgba(79, 125, 255, 0.32), rgba(79, 125, 255, 0.12));
  border-color: rgba(125, 155, 255, 0.45);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24),
              0 8px 22px rgba(50, 90, 240, 0.35);
}

.sb-item.active::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(79, 125, 255, 0.9);
}

.sb-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
  flex-shrink: 0;
}

.sb-item-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Тултипы при наведении */
.sb-item[data-tip]::after,
.sb-lang[data-tip]::after,
.sb-logout[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(8, 12, 26, 0.96);
  border: 1px solid var(--glass-line-hover);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.1px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity 180ms ease, transform 180ms ease;
}

.sb-item:hover[data-tip]::after,
.sb-lang:hover[data-tip]::after,
.sb-logout:hover[data-tip]::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Бейдж на иконке */
.sb-item-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #ff5f8f, #8b5cf6);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(6, 9, 20, 0.9);
  box-shadow: 0 3px 10px rgba(255, 95, 143, 0.45);
}

/* Окно времени — отдельная панель слева от сайдбара */
.time-panel {
  width: 128px;
  min-width: 128px;
  height: auto;
  max-height: calc(100vh - 32px);
  align-self: flex-start;
  margin: 16px 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: 30px;
  box-shadow: var(--glass-shadow);
  z-index: 25;
  overflow-y: auto;
  overflow-x: hidden;
}

.time-panel-title {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-4);
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-line);
}

.time-panel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.time-panel-flag { font-size: 16px; line-height: 1; }

.time-panel-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
}

.time-panel-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

/* Футер */
.sb-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

.sb-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.95);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
  flex-shrink: 0;
  position: relative;
}

.sb-status::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.4);
  animation: statusPulse 2.4s ease-out infinite;
}

@keyframes statusPulse {
  0%   { transform: scale(0.7); opacity: 1; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.sb-status.offline {
  background: rgba(255, 130, 130, 0.9);
  box-shadow: 0 0 12px rgba(255, 130, 130, 0.6);
}
.sb-status.offline::after { display: none; }

.sb-lang,
.sb-logout {
  width: 44px;
  height: 40px;
  border-radius: 13px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sb-lang:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-line);
  color: var(--text-2);
}

.sb-logout:hover {
  background: rgba(255, 100, 100, 0.10);
  border-color: rgba(255, 100, 100, 0.25);
  color: rgba(255, 150, 150, 0.95);
}

.sb-lang svg,
.sb-logout svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.6;
}
