/* Анимация загрузки */
.export-icon.loading {
  animation: rotate 1.5s linear infinite;
}

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

/* Стили для уведомлений */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 30px;
  color: white;
  font-size: 14px;
  opacity: 0.95;
  z-index: 1000;
  animation: slide-in 0.3s ease;
}

.notification.success {
  background-color: #28a745;
  box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.notification.error {
  background-color: #dc3545;
  box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.notification.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Заголовок диаграмм */
.charts-header {
  font-size: 15px;
  margin-top: 5px;
  margin-bottom: 10px;
  color: #e0e0ff;
  font-weight: 500;
}

/* Стили для панели деталей частицы */
.particle-name {
  font-size: 22px;
  color: #e0e0ff;
  margin-bottom: 8px;
  font-weight: 600;
}

.particle-description {
  font-size: 14px;
  color: #c8d0e0;
  margin-bottom: 16px;
  line-height: 1.4;
}

@keyframes slide-in {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 0.95;
  }
}

/* Уменьшаем отступ под визуализацией */
#particle-container {
  margin-bottom: 0;
}

/* Уменьшаем отступ над диаграммами */
#charts-container {
  margin-top: 0;
  margin-bottom: 15px;
}


.markdown-content {
  padding: 20px;
  color: #e0e0ff;
  line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: #fff;
  margin: 1em 0 0.5em;
}

.markdown-content p {
  margin: 0.5em 0;
}

.markdown-content ul,
.markdown-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

/* Улучшенные стили для модального окна частицы */
.particle-info-modal .modal-content {
  max-width: 800px;
  max-height: 85vh;
  background: linear-gradient(135deg, rgba(25, 30, 60, 0.95), rgba(15, 20, 40, 0.95));
  border-radius: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.particle-info-modal .modal-header {
  position: sticky;
  top: 0;
  background: rgba(24, 28, 47, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.particle-info-modal .modal-title {
  margin: 0;
  font-size: 1.3rem;
  color: #fff;
  font-weight: 600;
}

.particle-info-modal .close-modal {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
  line-height: 0.8;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

/* Улучшенная прокрутка для контента */
.particle-info-modal .modal-body::-webkit-scrollbar {
  width: 8px;
}

.particle-info-modal .modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.particle-info-modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.particle-info-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Улучшения для контента в модальном окне */
.particle-info-modal .markdown-content code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.particle-info-modal .markdown-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
  margin-left: 0;
  color: rgba(224, 224, 255, 0.8);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {

  
  .markdown-content {
    padding: 15px;
    font-size: 14px;
  }
  
  .markdown-content h1 {
    font-size: 24px;
  }
  
  .markdown-content h2 {
    font-size: 20px;
  }
  
  .markdown-content h3 {
    font-size: 18px;
  }
  
  .particle-info-modal {
    width: 90%;
    margin: 5% auto;
  }
}

@media (max-width: 480px) {

  
  .markdown-content {
    padding: 10px;
    font-size: 13px;
  }
  
  .markdown-content h1 {
    font-size: 20px;
  }
  
  .markdown-content h2 {
    font-size: 18px;
  }
  
  .markdown-content h3 {
    font-size: 16px;
  }
  
  .notification {
    padding: 10px;
    bottom: 10px;
    right: 10px;
    max-width: 85%;
  }
  
  /* Улучшаем скроллинг модальных окон на мобильных */
  .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .particle-info-modal {
    width: 95%;
    margin: 2.5% auto;
  }
}

/* Оптимизация для очень маленьких экранов */
@media (max-width: 360px) {
  .particle-btn {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
  
  .category-separator {
    font-size: 9px;
    margin: 0 1px;
  }
}

/* Цветовая коррекция для светлой темы */
[data-theme="light"] .charts-header {
  color: #343a40;
}

[data-theme="light"] .particle-name {
  color: #212529;
}

[data-theme="light"] .particle-description {
  color: #495057;
}

[data-theme="light"] .markdown-content {
  color: #212529;
}

[data-theme="light"] .markdown-content h1,
[data-theme="light"] .markdown-content h2,
[data-theme="light"] .markdown-content h3 {
  color: #000;
}

[data-theme="light"] .markdown-content code {
  background-color: rgba(108, 117, 125, 0.1);
  color: #0077B6;
}

[data-theme="light"] .markdown-content pre {
  background-color: #F8F9FA;
  border: 1px solid #DEE2E6;
}

[data-theme="light"] .markdown-content blockquote {
  border-left-color: #ADB5BD;
  background-color: rgba(233, 236, 239, 0.5);
}

[data-theme="light"] .markdown-content a {
  color: #0077B6;
}

[data-theme="light"] .markdown-content a:hover {
  color: #0096C7;
}

/* Стили для модальных окон в светлой теме */
[data-theme="light"] .modal-wrapper {
  background-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .modal-content {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .modal-header h2 {
  color: #212529;
}

[data-theme="light"] .close-modal {
  color: #6c757d;
}

[data-theme="light"] .close-modal:hover {
  color: #343a40;
}

[data-theme="light"] .setting-item {
  color: #495057;
}

[data-theme="light"] .btn-save-settings {
  background: linear-gradient(to right, #0077B6, #00B4D8);
}

[data-theme="light"] .btn-save-settings:hover {
  background: linear-gradient(to right, #0096C7, #48CAE4);
}

[data-theme="light"] .toggle-slider {
  background-color: #ced4da;
}

[data-theme="light"] input:checked + .toggle-slider {
  background-color: #0077B6;
}

[data-theme="light"] .setting-item.experimental {
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

/* Специфические стили для модального окна частицы в светлой теме */
[data-theme="light"] .particle-info-modal .modal-content {
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.95), rgba(233, 236, 239, 0.95));
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .particle-info-modal .modal-header {
  background: rgba(233, 236, 239, 0.98);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .particle-info-modal .modal-title {
  color: #212529;
}

[data-theme="light"] .particle-info-modal .close-modal {
  color: #212529;
}

[data-theme="light"] .particle-info-modal .modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .particle-info-modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .particle-info-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.modal-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }
  
  .modal-wrapper.visible {
    display: flex;
  }
  
  .modal-content {
    background: linear-gradient(to bottom, #1e2342, #101123);
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .modal-header h2 {
    color: #e0e0ff;
    margin: 0;
    font-size: 20px;
  }
  
  .close-modal {
    background: none;
    border: none;
    color: #8890b5;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
  
  .close-modal:hover {
    color: #ffffff;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .settings-container {
    margin-bottom: 20px;
  }
  
  .setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #b0b8d0;
  }
  
  .btn-save-settings {
    background: linear-gradient(to right, #3e5faa, #6a4aa4);
    color: white;
    border: none;
    border-radius: 22px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
  }
  
  .btn-save-settings:hover {
    background: linear-gradient(to right, #476dc0, #7855b8);
  }
  
  .toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
  }
  
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2b304d;
    border-radius: 24px;
    transition: .4s;
  }
  
  .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
  }
  
  input:checked + .toggle-slider {
    background-color: #4a7de9;
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(26px);
  }
  
  .setting-item.experimental {
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 5px;
  }
  .settings-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, #3e5faa, #6a4aa4);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
  }
  
  .settings-button:hover {
    transform: rotate(30deg);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  }
  
/* Дополнительная стилизация для диаграмм в модальном окне */
.modal-body .chart-container {
  margin-bottom: 15px;
}

[data-theme="light"] .modal-body .chart-container {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .modal-body .chart-container {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Исправление для мобильных устройств */
@media (max-width: 480px) {
  .modal-body .chart-container {
    height: 200px;
    min-height: auto;
    margin-bottom: 10px;
  }
  
  .modal-body .chart-title {
    font-size: 13px;
    margin: 5px 0;
  }
}
  