/* ========================================
   SPA.CSS - СТИЛИ ДЛЯ SPA-СТРАНИЦ И ФУТЕРА
   ========================================
   
   Содержит:
   - Стили для контейнеров страниц
   - Стили для футер-меню
   - Стили для активных/неактивных страниц и кнопок
*/

/* === ФИКС ГОРИЗОНТАЛЬНОГО СКРОЛЛА === */
.spa-container, .spa-modal, .spa-main, .spa-header {
  max-width: 100vw !important;
  min-width: 0 !important;
  width: 100vw !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}
@media (max-width: 600px) {
  .spa-container, .spa-modal, .spa-main, .spa-header {
    max-width: 98vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding-left: 2vw !important;
    padding-right: 2vw !important;
  }
}

/* Скрытие header на страницах статистики и настроек */
#stats-page.active ~ .header,
#settings-page.active ~ .header {
  display: none;
}

/* Скрываем header когда активны страницы статистики или настроек */
#stats-page.active ~ .header,
#settings-page.active ~ .header {
  display: none;
}

/* Скрытие header когда активны страницы статистики или настроек */
#stats-page.active ~ .header,
#settings-page.active ~ .header {
  display: none;
}

/* Альтернативный способ - скрываем header когда активны другие страницы */
.page:not(.active) ~ .header {
  display: none;
}

.page {
  display: none;
  min-height: 300px;
}
.page.active {
  display: block;
}

.footer-nav {
  position: fixed !important;
  left: 50% !important;
  bottom: 8px !important;
  transform: translateX(-50%) !important;
  background: rgba(35, 39, 47, 0.7) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  height: 64px !important;
  border-radius: 16px !important;
  /*border: 1px solid #444a56 !important;*/
  z-index: 100 !important;
  gap: 32px !important;
  padding: 0 16px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
  transition: transform 0.3s ease-in-out !important;
}

/* Класс для скрытого футера */
.footer-nav.hidden {
  transform: translateX(-50%) translateY(100px) !important;
}

.nav-btn {
  width: 48px;
  height: 48px;
  background: #353942;
  border: none;
  color: #a6b1c2;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7em;
  padding: 0;
  margin: 0 4px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav-btn.active {
  color: #44bd32;
  background: #23272f;
  font-weight: bold;
  box-shadow: 0 4px 16px rgba(68,189,50,0.08);
}

.nav-btn svg {
  width: 28px;
  height: 28px;
  display: block;
}

@media (max-width: 600px) {
  .footer-nav {
    height: 56px;
    gap: 12px;
    padding: 0 12px;
    bottom: 6px;
  }
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3em;
  }
  .nav-btn svg {
    width: 22px;
    height: 22px;
  }
}

/* Wallet selector (шапка) */
.wallet-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.85em !important;
  font-weight: bold;
  cursor: pointer;
  gap: 4px;                 /* Добавляем небольшой отступ между элементами */
  user-select: none;
  min-height: 32px;
  border: none !important;
  box-shadow: none !important;
}
.wallet-selector-btn {
  color: #f5f6fa;
  padding: 4px 12px;
  border-radius: 6px;
  transition: background 0.2s;
  font-size: 1em !important;
  font-weight: bold;
}
.wallet-selector-btn:hover {
  background: #353942;
}
.wallet-dropdown {
  min-width: 180px;
  max-width: 320px;
  width: 220px;
  background: #353942;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  padding: 0 !important;
  font-size: 0.97em;
}
.wallet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.97em;
  min-height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid #2e323a;
  transition: background 0.2s;
}
.wallet-item.selected {
  background: #444a56;
}
.wallet-item:hover, .wallet-item:focus-within {
  background: #353942;
}
.wallet-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.wallet-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.wallet-action-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0 2px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}
.wallet-action-btn svg {
  width: 18px;
  height: 18px;
  fill: #a6b1c2;
}
.wallet-action-btn.edit:hover svg { fill: #44bd32; }
.wallet-action-btn.delete:hover svg { fill: #e84118; }
.wallet-action-btn:active { background: #23272f; }

/* Инпут редактирования */
.wallet-rename-input {
  flex: 1 1 auto;
  background: #353942;
  color: #f5f6fa;
  border: 1.5px solid #44bd32;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 15px;
  outline: none;
  margin-right: 6px;
}
.wallet-edit-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.wallet-edit-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}
.wallet-edit-btn svg {
  width: 18px;
  height: 18px;
  fill: #a6b1c2;
}
.wallet-edit-btn.ok:hover svg { fill: #44bd32; }
.wallet-edit-btn.cancel:hover svg { fill: #e84118; }

/* Удаление подтверждение */
.wallet-delete-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.wallet-delete-btn, .wallet-cancel-btn {
  background: none;
  border: none;
  color: #e84118;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.wallet-cancel-btn {
  color: #a6b1c2;
  background: #23272f;
}
.wallet-delete-btn:hover { background: #e84118; color: #fff; }
.wallet-cancel-btn:hover { background: #353942; }

@media (max-width: 600px) {
  .wallet-item, .wallet-name, .wallet-rename-input {
    font-size: 16px !important;
    min-height: 40px;
  }
  .wallet-action-btn, .wallet-edit-btn {
    width: 32px;
    height: 32px;
  }
  .wallet-action-btn svg, .wallet-edit-btn svg {
    width: 24px;
    height: 24px;
  }
}

/* Модалка создания кошелька: выезд сверху, по центру */
#createWalletModal.modal-bg {
  display: none;
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: flex-start;
  animation: fadeIn 0.3s;
}
#createWalletModal.modal-bg[style*="display: flex"] .modal {
  animation: slideDownModal 0.4s cubic-bezier(.4,1.6,.6,1) both;
}
#createWalletModal .modal {
  margin: 48px auto 0 auto;
  min-width: 320px;
  max-width: 90vw;
  background: #2e323a;
  border-radius: 12px;
  padding: 28px 24px 20px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  text-align: center;
}
@keyframes slideDownModal {
  0% { transform: translateY(-80px) scale(0.98); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.wallet-selector,
.wallet-selector-btn,
.wallet-dropdown,
.wallet-item {
  font-size: 0.95em !important;
  padding: 2px 8px !important;
}
.wallet-selector-btn {
  min-height: 28px !important;
}
.wallet-dropdown {
  min-width: 120px !important;
}

.wallet-rename-input, .delete-confirm-input {
  background: #353942;
  color: #f5f6fa;
  border: 1px solid #444a56;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  margin: 0 4px 0 0;
  width: 70%;
  box-sizing: border-box;
}
.wallet-rename-input:focus, .delete-confirm-input:focus {
  border-color: #44bd32;
}
.rename-wallet-btn, .delete-wallet-btn {
  font-size: 1em !important;
  margin-left: 4px !important;
  padding: 2px 4px !important;
  width: 22px;
  height: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.delete-wallet-btn { color: #e84118 !important; }

.wallet-name {
  font-size: 14px !important;
}

.wallet-menu-btn {
  background: none !important;
  border: none !important;
  color: #a6b1c2;
  font-size: 1.3em;        /* Немного уменьшаем размер */
  margin-left: 4px;         /* Уменьшаем отступ */
  padding: 2px 6px;         /* Уменьшаем отступы */
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  box-shadow: none !important;
  outline: none !important;
}
.wallet-menu-btn:hover, .wallet-menu-btn:focus {
  background: #353942;
  color: #44bd32;
}
#editWalletModal .modal, #deleteWalletModal .modal {
  min-width: 320px;
  max-width: 90vw;
  background: #2e323a;
  border-radius: 12px;
  padding: 28px 24px 20px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  text-align: center;
}
#editWalletModal .modal-actions, #deleteWalletModal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 18px;
}
#editWalletModal .ok-btn, #deleteWalletModal .ok-btn {
  background: #44bd32;
  color: #fff;
}
#editWalletModal .close-btn, #deleteWalletModal .close-btn {
  background: #e84118;
  color: #fff;
}

.add-wallet-btn {
  width: 90%;
  margin: 10px auto 8px auto;
  padding: 8px 0;
  border-radius: 20px;
  font-size: 0.97em;
  border: 2px solid #44bd32;
  background: none;
  color: #44bd32;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.add-wallet-btn:hover, .add-wallet-btn:focus {
  background: #44bd32;
  color: #fff;
  border-color: #44bd32;
}

#walletMenuPopup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
}
.wallet-menu-action {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  background: none;
  color: #f5f6fa;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin: 0;
}
#walletMenuRename.wallet-menu-action {
  background: #353942;
  color: #44bd32;
}
#walletMenuRename.wallet-menu-action:hover {
  background: #44bd32;
  color: #fff;
}
#walletMenuDelete.wallet-menu-action {
  background: #353942;
  color: #e84118;
}
#walletMenuDelete.wallet-menu-action:hover {
  background: #e84118;
  color: #fff;
}

.wallets-list-modal {
  min-width: 320px;
  max-width: 90vw;
  background: #2e323a;
  border-radius: 14px;
  padding: 28px 24px 20px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  text-align: center;
}
#walletsListContainer {
  margin: 18px 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallets-list-item {
  background: #353942;
  color: #f5f6fa;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1.05em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: left;
  border: 2px solid transparent;
}
.wallets-list-item.selected {
  background: #44bd32;
  color: #fff;
  border-color: #44bd32;
}
.wallets-list-item:hover {
  background: #353942;
  color: #fff;
  border-color: #353942;
}
.add-wallet-btn-modal {
  width: 100%;
  margin: 10px 0 0 0;
  padding: 12px 0;
  border-radius: 24px;
  border: 2px solid #44bd32;
  background: none;
  color: #44bd32;
  font-weight: 600;
  font-size: 1.08em;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.add-wallet-btn-modal:hover, .add-wallet-btn-modal:focus {
  background: #44bd32;
  color: #fff;
  border-color: #44bd32;
}

.create-wallet-modal {
  min-width: 260px;
  max-width: 90vw;
  padding: 18px 16px 14px 16px;
  border-radius: 12px;
  background: #2e323a;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  text-align: center;
}
.small-input {
  padding: 7px 10px;
  font-size: 0.97em;
  border-radius: 7px;
} 

@media (max-width: 500px) {
  .wallets-list-item {
    padding: 5px 16px;
  }
}