/* Основные стили приложения */
:root {
  /* Базовые переменные определены в variables.css */
  /* Дополнительные переменные для макета */
  --header-height: 60px;
  --footer-height: 50px;
  --column-gap: 24px;
  --container-padding: 24px;
  --border-radius: 30px;
  --transition-duration: 0.3s;
}

/* Общие стили */
body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Стили для заголовка */
.app-header {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  position: relative;
}

.logo {
  margin-right: auto; /* Логотип прижимается к левому краю */
}

.logo img {
  width: auto;
  height: 50px;
}

/* Контейнер для кнопок - выравниваем вправо */
.header-controls {
  display: flex;
  gap: 16px;
  margin-left: auto; /* Прижимаем кнопки к правому краю */
  margin-right: 15px; /* Отступ справа минимум 15px */
}

/* Стили для кнопок в шапке */
.btn-share {
  background: linear-gradient(135deg, #2b3a8e88, #3d2e9a88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  height: 40px;
  white-space: nowrap; /* Предотвращаем перенос текста */
}

.btn-settings {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-share:hover, .btn-settings:hover {
  background: linear-gradient(135deg, #3a4db088, #5645c388);
  transform: translateY(-1px);
}

/* Стили для кнопки "Что это и зачем?" */
.about-btn {
  margin-left: 20px; /* Отступ от логотипа */
}

/* Основное содержимое */
.profile-content {
  display: flex;
  flex: 1;
  gap: var(--column-gap);
  margin: 0px 0;
}

.visualization-column {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.details-column {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Контейнеры */
.particle-container, 
.controls-container, 
.details-container, 
.charts-container {
  background-color: var(--color-card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.particle-container {
  flex: 1;
  min-height: 400px; /* было 500px — минус 20% */
  position: relative;
}

.controls-container {
  padding: 16px;
}

.details-container {
  flex: 0 0 auto;
  padding: 10px;
}

.charts-container {
  flex: 1;
  padding: 10px;
  margin-top: 5px;
  display: flex;
  flex-direction: column;
}

/* Футер */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--footer-height);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.329);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  padding: 0 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: rgba(127, 78, 253, 0.525);
  text-decoration: none;
  transition: color var(--transition-duration) ease;
}

.footer-links a:hover {
  color: #00a6ffa9;
}

/* Для светлой темы */
[data-theme="light"] .app-footer {
  color: rgba(0, 0, 0, 0.487);
}

[data-theme="light"] .footer-links a {
  color: rgba(127, 78, 253, 0.525);
}

[data-theme="light"] .footer-links a:hover {
  color: #00a6ffa9;
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--color-background);
  margin: auto;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
  opacity: 0.7;
  transition: all 0.2s ease;
}

.close-modal:hover {
  opacity: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 60px);
}

/* Фиксированная высота для кнопки */
.btn-retry {
  height: 40px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Загрузчик */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 2, 33, 0.7);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid transparent;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 1024px) {
  .profile-content {
    flex-direction: column;
  }
  
  .visualization-column,
  .details-column {
    width: 100%;
  }
  
  .particle-container {
    min-height: 320px; /* было 400px — минус 20% */
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
    --border-radius: 30px;
  }
  
  .app-header {
    height: 60px;
  }
  
  .logo img {
    height: 32px;
  }
  

  
  .particle-container {
    min-height: 240px; /* было 300px — минус 20% */
  }
  
  .footer-links {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 12px;
    --column-gap: 16px;
  }
  
  .profile-content {
    margin: 16px 0;
  }
  
  .details-container,
  .charts-container {
    padding: 16px;
  }
  
  .app-footer {
    flex-direction: column;
    height: auto;
    padding: 16px;
    text-align: center;
    gap: 12px;
  }
}

/* Модальное окно ошибки */
.error-modal {
  display: none;
}

.error-modal .modal-header {
  background-color: var(--color-error);
  color: white;
}

.btn-retry {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 16px;
  font-weight: 500;
  transition: background-color 0.3s;
}

.btn-retry:hover {
  background-color: var(--color-primary-dark);
}

/* Загрузчик - расширение существующих стилей */
.loading-text {
  margin-top: 16px;
  font-size: 16px;
  color: var(--color-text-light);
  text-align: center;
}

/* И уменьшаем отступ после заголовка диаграмм */
.charts-header {
  margin-bottom: 5px;
}

/* Переключатель темы */
.theme-toggle {
  position: fixed;
  right: 20px;
  top: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-button);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--gradient-button-hover);
}

.theme-icon {
  font-size: 18px;
}

/* Адаптивный дизайн для мобильных устройств */
@media (max-width: 768px) {
  :root {
    --header-height: 50px;
    --footer-height: 40px;
    --column-gap: 16px;
    --container-padding: 16px;
    --border-radius: 20px;
  }
  
  .container {
    padding: var(--mobile-padding);
  }
  
  .section-title {
    font-size: 24px;
    margin-bottom: 15px;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-title {
    font-size: 18px;
  }
  
  .modal-body {
    padding: 16px 20px;
  }
  
  .theme-toggle {
    width: 36px;
    height: 36px;
    right: 15px;
    top: 15px;
  }
  
  .theme-icon {
    font-size: 16px;
  }
  
  /* Улучшенный скроллинг на мобильных */
  body {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 20px;
    --column-gap: 10px;
    --border-radius: 30px;
  }
  
  .section-title {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .modal-header {
    padding: 12px 16px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .modal-body {
    padding: 12px 16px;
  }
  
  .theme-toggle {
    width: 32px;
    height: 32px;
    right: 10px;
    top: 10px;
  }
  
  .theme-icon {
    font-size: 14px;
  }
}

/* Общие стили для обеих версий waitlist-container */
.waitlist-container,
.waitlist-container-mobile {
  background: linear-gradient(135deg, rgba(27, 30, 61, 0.4), rgba(13, 2, 33, 0.4));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.waitlist-content {
  max-width: 600px;
  margin: 0 auto;
}

.waitlist-content h3 {
  font-size: 20px;
  color: var(--color-text);
  margin-bottom: 16px;
  font-weight: 600;
}

.upcoming-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.upcoming-features li {
  margin: 8px 0;
  color: var(--color-text-light);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Фиксируем высоту кнопки waitlist */
.waitlist-submit {
  height: 40px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0; /* Предотвращаем сжатие */
}

/* Создаем контейнер для поля ввода, чтобы сообщения об ошибках не сдвигали кнопку */
.waitlist-form {
  display: flex;
  gap: 10px;
  margin: 10px;
}

.waitlist-form input {
  flex: 1;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 12px 20px;
  color: var(--color-text);
  font-size: 14px;
  transition: all 0.3s ease;
}

/* Светлая тема для поля ввода - для ОБЕИХ версий */
[data-theme="light"] .waitlist-form input {
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.waitlist-form button {
  background: linear-gradient(135deg, #2b3a8e88, #3d2e9a88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-radius: 30px;
  padding: 12px 24px;
  
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.waitlist-form button:hover {
  background: linear-gradient(135deg, #3a4db088, #5645c388);
  transform: translateY(-1px);
}

.waitlist-note {
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
}

/* Светлая тема */
[data-theme="light"] .waitlist-container {
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.891), rgba(233, 236, 239, 0.877));
}

/* По умолчанию мобильная версия скрыта */
.waitlist-container-mobile {
  display: none;
}

/* На мобильных устройствах */
@media (max-width: 768px) {
  .waitlist-container {
    display: none;
  }

  .waitlist-container-mobile {
    display: block;
    order: 998;
    margin: 20px 10px;
    
  }
  [data-theme="light"] .waitlist-container-mobile {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.891), rgba(233, 236, 239, 0.877));
  }

  .waitlist-container-mobile .waitlist-form {
    flex-direction: column;
  }

  .waitlist-container-mobile .waitlist-form input {
    width: 100%;
  }

  .waitlist-container-mobile .waitlist-form button {
    width: 100%;
  }

  .app-footer {
    order: 999;
  }
}

/* Стили для модального окна с сообщениями */
.error-modal .modal-body {
  text-align: center;
  padding: 30px;
}

#error-message {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Стили для модального окна с ошибкой */
.error-modal.error-state .modal-header {
  background: rgba(255, 85, 85, 0.1);
  border-bottom: 1px solid rgba(255, 85, 85, 0.3);
}

.error-modal.error-state .btn-retry {
  background: linear-gradient(135deg, #d32f2f, #ff5555);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(211, 47, 47, 0.2);
}

.error-modal.error-state .btn-retry:hover {
  background: linear-gradient(135deg, #f44336, #ff6b6b);
  transform: translateY(-2px);
}

/* Стили для модального окна с успехом */
.error-modal.success-state .modal-header {
  background: rgba(77, 233, 76, 0.1);
  border-bottom: 1px solid rgba(77, 233, 76, 0.3);
}

.error-modal.success-state .btn-retry {
  background: linear-gradient(135deg, #32b432, #4de94c);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(50, 180, 50, 0.2);
}

.error-modal.success-state .btn-retry:hover {
  background: linear-gradient(135deg, #43c843, #5df75c);
  transform: translateY(-2px);
}

/* Стили для сообщений об ошибках в поле */
.field-error-message {
  color: #ff5555;
  font-size: 12px;
  margin-top: 5px;
  padding: 0 8px;
  animation: fadeIn 0.3s ease;
  font-weight: 500;
}

/* Стиль для поля с ошибкой */
.input-error {
  border-color: #ff5555 !important;
  background-color: rgba(255, 85, 85, 0.05) !important;
}

/* Анимация появления сообщения */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
} 


.chat-button {
  position: fixed;
  top: 20px;
  right: 25px;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.chat-icon {
  font-size: 14px;
  margin-right: 0px;
  display: inline-flex;
}

.chat-text {
  font-size: 1em;
}

/* Стили для ссылки внутри кнопки */
.btn-share a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

/* По умолчанию показываем десктопную версию текста и скрываем мобильную */
.mobile-text {
  display: none;
}

.desktop-text {
  display: inline;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  /* В мобильной версии меняем отображение текста */
  .mobile-text {
    display: inline;
  }
  
  .desktop-text {
    display: none;
  }
  
  /* Оптимизируем отступы для мобильных */
  .btn-share {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  /* Уменьшаем отступ между кнопками */
  .header-controls {
    gap: 8px;
  }
  
  /* Уменьшаем отступ от логотипа на мобильных */
  .about-btn {
    margin-left: 20px;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 380px) {
  .btn-share {
    padding: 4px 8px;
    font-size: 10px;
  }
  
  .header-controls {
    gap: 6px;
    margin-right: 8px; /* Уменьшаем правый отступ */
  }
  
  /* Минимальный отступ от логотипа */
  .about-btn {
    margin-left: 10px;
  }
}

/* Стили для текста в кнопках */
.about-text, .chat-text {
  white-space: nowrap; /* Дополнительная защита от переноса */
}
