/* ═══════════════════════════════════════════
   MODALS.CSS — все модалки, профиль, настройки, меню, аккаунты
   ═══════════════════════════════════════════ */

/* ═══ ОБЩИЕ МОДАЛКИ ═══ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: var(--sidebar);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
  position: relative;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.modal-close:hover {
  background: var(--hover);
  color: var(--text);
}

/* ═══ СПИСКИ ПОЛЬЗОВАТЕЛЕЙ (user-result) ═══ */
.user-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.user-result:hover {
  background: var(--hover);
}

.user-result .info {
  flex: 1;
  min-width: 0;
}

.user-result .name {
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-result .uname {
  color: var(--muted);
  font-size: 13px;
}

.user-result input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ═══ ТЕГИ ═══ */
.tag-owner {
  background: #e6b800;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 4px;
}

.tag-admin {
  background: var(--active);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 4px;
}

/* ═══ ПРОФИЛЬ ═══ */
.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: #5288c1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.profile-avatar img,
.profile-avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.profile-name {
  text-align: center;
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-uname {
  text-align: center;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.profile-uname:hover {
  background: var(--hover);
  text-decoration: underline;
}

.profile-status {
  text-align: center;
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--muted);
}

.profile-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}

.profile-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 8px;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}

.profile-action-btn:hover {
  background: var(--hover);
}

.profile-action-btn .icon {
  color: var(--accent);
}

.profile-action-btn span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.profile-action-btn .icon.muted {
  color: var(--muted);
}

.profile-info-block {
  background: var(--bg);
  border-radius: 12px;
  padding: 4px 16px;
  display: flex;
  flex-direction: column;
  margin: 0 20px 16px;
}

.profile-info-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-info-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.profile-info-value {
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-username-link {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
}

.profile-username-link:hover {
  text-decoration: underline;
}

.copy-icon {
  cursor: pointer;
  color: var(--muted);
}

.copy-icon:hover {
  color: var(--accent);
}

.profile-more-menu {
  position: absolute;
  top: 60px;
  right: 20px;
  background: var(--sidebar);
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  z-index: 50;
  width: 220px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-more-item {
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: background 0.15s;
}

.profile-more-item:hover {
  background: var(--hover);
}

.profile-more-item.danger {
  color: var(--danger);
}

/* ═══ ТЕМЫ ═══ */
.theme-swatch {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.theme-swatch .swatch-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-swatch:hover .swatch-circle {
  transform: scale(1.08);
}

.theme-swatch.active .swatch-circle {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--sidebar), 0 0 0 4px var(--accent);
}

.theme-swatch span {
  font-size: 11px;
  color: var(--muted);
}

.theme-swatch.active span {
  color: var(--accent);
  font-weight: 600;
}

/* ═══ ПУНКТЫ МЕНЮ (настройки, группы, аккаунты) ═══ */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item:hover {
  background: var(--hover);
}

.menu-item .icon {
  width: 24px;
  display: flex;
  justify-content: center;
  color: var(--muted);
}

.menu-item .label {
  flex: 1;
}

.menu-item .sub {
  color: var(--muted);
  font-size: 12px;
}

.menu-item.danger {
  color: var(--danger);
}

.menu-item.danger .icon {
  color: var(--danger);
}

/* ═══ НАСТРОЙКИ ═══ */
.settings-back-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.settings-back-btn:hover {
  opacity: 0.8;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  transition: background 0.15s;
}

.settings-item-label {
  font-size: 15px;
  flex: 1;
}

.privacy-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 30px 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23708499%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 8px top 50%;
  background-size: 10px auto;
}

/* ═══ SWITCH / TOGGLE ═══ */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--muted);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ═══ ГАЛЕРЕЯ И ПРОГРЕСС ═══ */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.photo-gallery img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}

.upload-progress {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s;
}

/* ═══ СТАРОЕ МЕНЮ ВНУТРИ САЙДБАРА (оставлено для совместимости) ═══ */
.menu-screen {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  overflow-y: auto;
  height: 100%;
}

.menu-list {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
}

.menu-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.menu-list-item:last-child {
  border-bottom: none;
}

.menu-list-item:hover {
  background: var(--hover);
}

.menu-list-item .icon {
  color: var(--muted);
  display: flex;
}

.menu-list-item .label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.menu-list-item .switch {
  flex-shrink: 0;
}

/* ═══ АККАУНТЫ ═══ */
.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.15s;
}

.account-chip:hover {
  background: var(--hover);
}

.account-chip.active {
  background: var(--active);
}

.account-chip .avatar-btn {
  width: 36px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
}

.account-chip-name {
  font-weight: 500;
  font-size: 14px;
}