/* ============================================================================
   mobile-dock.css — мобильный докбар (position:fixed снизу) + шторки
   «•••» и «Предложка▾». Показывается только на экранах ≤820px.
   ============================================================================ */

/* ---- Докбар ---- */
.mobile-dock-wrap {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 8px));
  pointer-events: none;
}

.mobile-dock {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-radius: var(--radius-lg);
  padding: 6px;
  pointer-events: auto;
  position: relative;
}

/* ---- Индикатор активного пункта (плавное скольжение) ---- */
.dock-indicator {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, var(--accent-dim), rgba(139, 124, 246, 0.1));
  box-shadow: inset 0 0 0 1px rgba(232, 180, 216, 0.3);
  border-radius: 14px;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), width 0.32s cubic-bezier(0.4, 0, 0.2, 1), height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: none;
  font-family: var(--font-body);
  transition: color 0.2s ease, transform 0.15s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 1;
}

.dock-item:active {
  transform: scale(0.92);
}

.dock-item.active {
  color: var(--text);
  background: transparent;
}

.dock-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dock-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* ---- Кнопка «•••» ---- */
.dock-more {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: none;
  font-family: var(--font-body);
  transition: color 0.2s ease, transform 0.15s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 1;
}

.dock-more:active {
  transform: scale(0.92);
}

.dock-more.active {
  color: var(--text);
  background: transparent;
}

.dock-more-dots {
  font-size: 16px;
  line-height: 1;
  letter-spacing: 1px;
}

/* ---- Кнопка «Предложка▾» ---- */
.dock-suggest {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: none;
  font-family: var(--font-body);
  transition: color 0.2s ease, transform 0.15s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  z-index: 1;
}

.dock-suggest:active {
  transform: scale(0.92);
}

.dock-suggest.active {
  color: var(--text);
  background: transparent;
}

.dock-suggest-arrow {
  font-size: 8px;
  margin-left: 1px;
  transition: transform 0.2s ease;
}

.dock-suggest.open .dock-suggest-arrow {
  transform: rotate(180deg);
}

/* ---- Шторка «•••» (more-sheet) ---- */
.more-sheet {
  display: none;
  width: max-content;
  max-width: 100%;
  margin: 0 0 8px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: sheetIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom center;
  pointer-events: auto;
}

.more-sheet.open {
  display: block;
}

/* Резкое исчезновение было из-за того, что .open снимался сразу -> display:none
   мгновенно. Теперь при закрытии JS на время SHEET_CLOSE_MS вешает .closing,
   в течение которого шторка ещё display:block и проигрывает обратную анимацию. */
.more-sheet.closing {
  display: block;
  animation: sheetOut 0.16s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(8px) scaleY(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes sheetOut {
  from {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scaleY(0.95);
  }
}

.more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  transition: background 0.15s ease;
}

.more-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.more-item + .more-item {
  border-top: 1px solid var(--glass-border);
}

.more-item-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.more-item-icon svg {
  width: 100%;
  height: 100%;
}

.more-item.admin-item {
  color: var(--ban-c);
}

.more-item.admin-item .more-item-icon {
  color: var(--ban-c);
}

/* ---- Шторка «Предложка▾» (suggest-sheet) ---- */
.suggest-sheet {
  display: none;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 8px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: sheetIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom center;
  pointer-events: auto;
}

.suggest-sheet.open {
  display: block;
}

.suggest-sheet.closing {
  display: block;
  animation: sheetOut 0.16s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  transition: background 0.15s ease;
}

.suggest-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.suggest-item + .suggest-item {
  border-top: 1px solid var(--glass-border);
}

.suggest-item-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.suggest-item-icon svg {
  width: 100%;
  height: 100%;
}

/* ---- Показываем только на мобилках ---- */
@media (max-width: 820px) {
  .mobile-dock-wrap {
    display: block;
  }
}