/* --------------------
   СТРАНИЦА НАСТРОЕК
--------------------- */

#settings-page {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  /* height управляется в spa.css через .page */
  color: #e6e6e6;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 15px 20px 15px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* В settings.css */
#settings-page::-webkit-scrollbar {
  display: none;
}

/* --- User Info --- */
.user-info-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  margin-top: 0;
  /*background: #23242a;
  box-shadow: none;*/
  padding: 18px 18px 12px 18px;
}
.user-photo-name {
  display: flex;
  align-items: center;
}
.user-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  margin-right: 18px;
  border: 2px solid #444;
}
.user-names {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-fullname {
  font-size: 1.15em;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.user-fullname:hover {
  background-color: rgba(74, 144, 226, 0.15);
}

/* Стили для редактирования display_name */
.display-name-input {
  font-size: 1.15em;
  font-weight: 600;
  background: transparent;
  color: #fff;
  border: 1.5px solid #4a90e2;
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 150px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.display-name-input:focus {
  border-color: #5ba3ff;
}

.display-name-input.error {
  border-color: #e74c3c;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.user-nick {
  font-size: 1em;
  color: #a6b1c2;
}

/* Кнопка "Мой ID" */
.my-id-button {
  background: #555;
  color: #e6e6e6;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  min-width: 100px;
}

/* --- Current Wallet --- */
.current-wallet-block .wallet-name {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 4px;
}

/* --- Участники кошелька --- */
.wallet-members-container {
  margin-top: 16px;
}

.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.members-header h3 {
  font-size: 1.08em;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.add-btn {
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.add-btn:hover {
  background: #357abd;
}

/* --- Новый стиль для списка участников --- */
.members-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
  margin: 0;
  padding: 0;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 0;
  color: #fff;
  font-size: 1em;
  /**/background-color: 1px solid #333;
}

.member-item:last-child {
  border-bottom: none;
}

.member-info {
  display: flex;
  align-items: center;
  flex: 1;
}

.member-number {
  color: #8ca0c8;
  font-size: 0.9em;
  margin-right: 12px;
  min-width: 20px;
}

.member-name {
  color: #fff;
  font-size: 1em;
}

.member-role {
  color: #8ca0c8;
  font-size: 0.85em;
  margin-left: 8px;
  font-style: italic;
}

.member-crown {
  margin-right: 8px;
  font-size: 1.1em;
}

.delete-btn {
  margin-left: 8px;
  color: #f44336;
  font-size: 1.1em;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  border-radius: 50%;
  transition: background 0.15s;
}

.delete-btn:hover {
  background: rgba(244, 67, 54, 0.2);
}

/* --- Скрытые счета --- */
.hidden-accounts-container {
  margin-top: 20px;
}

.hidden-accounts-header {
  margin-bottom: 8px;
}

.hidden-accounts-header h3 {
  font-size: 1.08em;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.hidden-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hidden-account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: #e6e6e6;
  font-size: 1em;
  border-bottom: 1px solid #333;
}

.hidden-account-item:last-child {
  border-bottom: none;
}

.account-name {
  color: #e6e6e6;
  font-size: 1.1em;
}

.show-account-btn {
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.show-account-btn:hover {
  background: #357abd;
}

/* --- Модальное окно --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.modal-content {
  background: #23242a;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #e6e6e6;
  box-sizing: border-box;
}

.modal-content h3 {
  margin: 0 0 16px 0;
  color: #fff;
}

.modal-content p {
  margin: 0 0 12px 0;
  color: #a6b1c2;
}

.modal-content input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #2e323a;
  color: #e6e6e6;
  font-size: 1em;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Общие стили кнопок вынесены в base.css */

.section-title {
  font-size: 1.08em;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}
.section-subtitle {
  font-size: 0.98em;
  color: #a6b1c2;
}

/* --- Контейнер текущего кошелька и участников: общий стиль приложения --- */
.wallet-main-container, .wallet-members-main-container {
  background: #2e323a;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 16px 16px 12px 16px;
  margin-bottom: 20px;
  border: none !important;
}
.wallet-title-block h3 {
  font-size: 1.13em;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: #fff;
}
.wallet-info-block {
  font-size: 0.8em;
  color: #f5f6fa;
  font-weight: 400;
}

.delete-wallet-btn {
  background: #ff2d2d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 40px;
  font-size: 0.8em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px #ff2d2d22;
  margin-left: 12px;
}

.delete-wallet-btn:hover {
  background: #e60000;
  box-shadow: 0 4px 16px #ff2d2d44;
}

.delete-wallet-btn:active {
  transform: translateY(1px);
}

.wallet-title-main {
  font-weight: 600;
  color: #fff;
}
.wallet-op-count {
  color: #8ca0c8;
  font-size: 0.98em;
  margin-left: 10px;
}
.wallet-members-main-container {
  margin-top: 10px;
}


/* --- Invite Block --- */
.invite-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-code-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #23242a;
  color: #e6e6e6;
  font-size: 1em;
  margin-bottom: 6px;
}
.invite-error-msg {
  color: #f44336;
  font-size: 0.97em;
  margin-top: 2px;
  min-height: 18px;
}

/* --- Список кошельков --- */
.wallets-list-block {
  margin-bottom: 0;
}

.wallets-header {
  margin-bottom: 16px;
}

.wallets-header h3 {
  font-size: 1.08em;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

#settings-wallets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #2e323a;
  box-shadow: 0 1px 4px rgba(30,40,60,0.13);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  font-size: 1.08em;
  color: #f2f4fa;
  border: 1px solid #444;
}

.wallet-list-item.selected {
  background: #23242a;
  box-shadow: 0 2px 8px rgba(80,120,255,0.18);
  border: 2px solid #4a90e2;
}

.wallet-list-item:hover {
  background: #393b41;
}

.wallet-icon {
  font-size: 1.2em;
}

.wallet-title {
  font-weight: 500;
  flex: 1;
  color: #e6e6e6;
}

.wallet-operations-count {
  color: #8ca0c8;
  font-size: 0.95em;
}

.wallet-role {
  color: #888;
  font-size: 0.85em;
  margin-left: 8px;
  font-style: italic;
}

.wallet-current-note {
  color: #4a90e2;
  font-size: 0.9em;
  font-weight: 600;
  margin-left: 8px;
}

.wallet-list-item .wallet-default-star {
  margin-right: 8px;
  font-size: 1.2em;
}
.wallet-list-item .wallet-access-note {
  color: #4a90e2;
  font-size: 0.95em;
  margin-left: 10px;
}
/* --- Flex-контейнер для центрирования кнопки --- */
.settings-btn-center {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 32px 0 0 0;
}
/* --- Кнопка "Показать все скрытые счета" --- */
#showHiddenAccountsBtn {
  background: #23242a;
  color: #f2f4fa;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 1.08em;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(30,40,60,0.13);
  transition: background 0.18s, color 0.18s;
  outline: none;
  margin: 0;
}
#showHiddenAccountsBtn:hover {
  background: #4a90e2;
  color: #fff;
}
/* ----------------------------- */

@media (max-width: 600px) {
  #settings-page {
    padding: 12px 0 80px 0;
  }
  .settings-section {
    padding: 14px 8px 12px 8px;
  }
  .user-photo {
    width: 44px;
    height: 44px;
  }
} 

/* --- Компактный стиль для списка кошельков в настройках --- */
.wallets-list-block, #settings-wallets-list {
  padding: 0 0 0 0 !important;
  margin: 0 !important;
}
#settings-wallets-list .wallet-list-item {
  padding: 4px 8px !important;
  margin: 2px 0 !important;
  border-radius: 4px !important;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  font-size: 0.98em !important;
  color: #b0b0b0 !important;
}
#settings-wallets-list .wallet-list-item.selected {
  background: #232323 !important;
  color: #fff !important;
  font-weight: 500 !important;
}
#settings-wallets-list .wallet-list-item:hover {
  background: #23232322 !important;
}
/* Отключить выбор кошельков в настройках */
#settings-wallets-list .wallet-list-item {
  pointer-events: none !important;
  cursor: default !important;
}

.delete-wallet-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 32px 0 0 0;
}

/* ========================================
   КНОПКИ УПРАВЛЕНИЯ КЭШЕМ
   ======================================== */


.cache-control-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.cache-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 140px;
}

.clear-cache-btn {
  background: #dc3545;
  color: white;
}

.clear-cache-btn:hover {
  background: #c82333;
}

.refresh-data-btn {
  background: #007bff;
  color: white;
}

.refresh-data-btn:hover {
  background: #0056b3;
}

.logout-btn {
  background: #ff6b6b;
  color: white;
}

.logout-btn:hover {
  background: #ff5252;
}

.cache-btn:active {
  transform: translateY(1px);
}

.sound-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #13b92f;
  color: #fff;
  min-width: 50%;
}

.sound-control-buttons {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.version-block {
text-align: center;
font-size: 12px;
color: #333;
}



/* ========================================
   УЛУЧШЕННЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ======================================== */

@media (max-width: 500px) {
  #settings-page {
    padding: 20px 5px 35px 5px;
    max-width: 600px;
    margin: 0;
    /* Дополнительные улучшения скролла для мобильных устройств */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    /* Предотвращаем горизонтальный скролл */
    overflow-x: hidden;
  }
  
  .settings-section {
    
    padding: 5px 14px;
    border-radius: 12px;
  }
  
  .user-info-block {
    margin-top: 0;
    padding: 14px 14px;
  }
  
  .user-photo {
    width: 48px;
    height: 48px;
    margin-right: 14px;
  }
  
  .user-fullname {
    font-size: 1.05em;
  }
  
  .user-nick {
    font-size: 0.9em;
  }
  
  .wallet-main-container, .wallet-members-main-container {
    padding: 12px 14px;
  }
  
  .wallet-title-block h3 {
    font-size: 1em;
    margin-bottom: 8px;
  }
  
  .wallet-info-block {
    font-size: 0.9em;
  }
  
  .delete-wallet-btn {
    padding: 4px 8px;
    font-size: 0.8em;
    margin-left: 8px;
  }
  
  .members-header h3 {
    font-size: 1em;
  }
  
  .add-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  
  .member-item {
    padding: 6px 0;
    font-size: 0.9em;
  }
  
  .member-number {
    font-size: 1.1em;
    margin-right: 8px;
  }
  
  .member-name {
    font-size: 1.1em;
  }
  
  .member-role {
    font-size: 0.95em;
  }
  
  .delete-btn {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  
  .wallets-list-block, #settings-wallets-list {
    margin-top: 16px;
  }
  
  #settings-wallets-list .wallet-list-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
  }
  
  .wallet-title {
    font-size: 0.95em;
  }
  
  .wallet-operations-count {
    font-size: 0.8em;
  }
  
  .wallet-role {
    font-size: 0.75em;
  }
  
  .cache-control-buttons {
    flex-direction: row;
    gap: 8px;
  }
  
  .cache-btn {
    max-width: none;
    padding: 12px 16px;
    font-size: 0.9em;
  }
  .version-block {
    margin-bottom: 0;
    padding: 10px 18px;
    background: transparent;
    box-shadow: none;
    border: none;
    text-align: center;
  }
  
  .version-text {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 500px;
  }
  
  /* --- Настройки звука --- */
  .sound-control-block {
    margin-bottom: 18px;
  }
  
  .sound-control-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
  }
  
  .sound-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #13b92f;
    color: #fff;
  }
  
  .sound-btn:hover {
    background: #6ac267;
  }
  
  .sound-btn:active {
    transform: scale(0.95);
  }
  
  .toggle-sound-btn {
    background: #44bd32;
  }
  
  .toggle-sound-btn:hover {
    background: #3da829;
  }
  
  .toggle-sound-btn.sound-off {
    background: #e84118;
  }
  
  .toggle-sound-btn.sound-off:hover {
    background: #c23616;
  }
}
.telegram-webapp .settings-container,
.telegram-webapp #settings-page {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Отключаем overscroll для остальных элементов */
.telegram-webapp .user-info-block,
.telegram-webapp .settings-section,
.telegram-webapp .wallet-main-container,
.telegram-webapp .wallet-members-main-container {
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* Улучшенные стили для кнопок в настройках */
.telegram-webapp .add-btn,
.telegram-webapp .delete-btn,
.telegram-webapp .cache-btn,
.telegram-webapp .delete-wallet-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}




@media (max-width: 480px) {
  .sound-control-buttons {
    gap: 8px;
  }
  
  .sound-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95em;
  }

   .cache-control-buttons {
    flex-direction: row;
    gap: 8px;
  }
  
  .cache-btn {
    max-width: none;
  }
}

/* =====================================================
   PUSH-УВЕДОМЛЕНИЯ
===================================================== */

.notification-control-block {
  margin-bottom: 18px;
  padding: 18px;
}

.notification-control-block h3 {
  margin: 0 0 12px 0;
  font-size: 1.1em;
  color: #e6e6e6;
}

.notification-status {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.notification-status p {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.4;
}

.notification-status small {
  font-size: 0.85em;
  opacity: 0.8;
}

.notification-control-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.enable-push-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
}

.enable-push-btn:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.test-push-btn {
  background: linear-gradient(135deg, #FF9500, #FF8500);
  color: white;
}

.test-push-btn:active {
  transform: scale(0.98);
}

.disable-push-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e6e6e6;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.disable-push-btn:active {
  background: rgba(255, 255, 255, 0.15);
}
