/* Темная тема для AMK WebApp */
.dark-theme {
  /* Переопределение переменных Telegram WebApp для темной темы */
  --tg-theme-bg-color: #1A1B1E !important;
  --tg-theme-text-color: #C1C2C5 !important;
  --tg-theme-hint-color: rgba(255, 255, 255, 0.4) !important;
  --tg-theme-link-color: #60a5fa !important;
  --tg-theme-button-color: #2196F3 !important;
  --tg-theme-button-text-color: #ffffff !important;
  --tg-theme-secondary-bg-color: #25262B !important;
  
  /* Дополнительные переменные для Mantine */
  --mantine-color-body: #1A1B1E;
  --mantine-color-text: #C1C2C5;
  --mantine-color-paper: #25262B;
}

/* Глобальное принудительное применение темной темы ко всему документу */
html.dark-theme {
  background-color: #1A1B1E !important;
}

/* Основные стили для темного режима, применяемые ко всему документу */
.dark-theme, 
.dark-theme body {
  background-color: var(--tg-theme-bg-color) !important;
  color: var(--tg-theme-text-color) !important;
}

/* Применяем темную тему к основному контейнеру приложения */
.dark-theme .telegram-app,
.dark-theme .min-h-screen,
.dark-theme .main-content {
  background-color: var(--tg-theme-bg-color) !important;
  color: var(--tg-theme-text-color) !important;
}

.dark-theme .mantine-AppShell-main {
  background-color: var(--tg-theme-bg-color) !important;
}

.dark-theme .mantine-Paper-root {
  background-color: var(--tg-theme-secondary-bg-color) !important;
  color: var(--tg-theme-text-color) !important;
}

.dark-theme .mantine-AppShell-navbar {
  background-color: var(--tg-theme-secondary-bg-color) !important;
}

.dark-theme .mantine-AppShell-header {
  background-color: var(--tg-theme-secondary-bg-color) !important;
}

.dark-theme .mantine-Text-root {
  color: var(--tg-theme-text-color) !important;
}

.dark-theme .mantine-Button-root:not(.mantine-Button-filled) {
  color: var(--tg-theme-text-color) !important;
}

.dark-theme a:not(.mantine-Button-root) {
  color: var(--tg-theme-link-color);
}

/* Дополнительные стили для темной темы */
.dark-theme .mantine-Tabs-tab[data-active] {
  color: var(--tg-theme-link-color) !important;
}

.dark-theme .mantine-Tabs-tab:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.dark-theme input, 
.dark-theme textarea, 
.dark-theme select {
  background-color: var(--tg-theme-secondary-bg-color) !important;
  color: var(--tg-theme-text-color) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Fix для темной темы в таблицах */
.dark-theme .mantine-Table-root th {
  background-color: var(--tg-theme-secondary-bg-color);
  color: var(--tg-theme-text-color);
}

.dark-theme .mantine-Table-root tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Дополнительные исправления для карточек и модальных окон */
.dark-theme .mantine-Modal-content,
.dark-theme .mantine-Dialog-content,
.dark-theme .mantine-Popover-dropdown {
  background-color: var(--tg-theme-secondary-bg-color) !important;
  color: var(--tg-theme-text-color) !important;
}

.dark-theme .mantine-Card-root {
  background-color: var(--tg-theme-secondary-bg-color) !important;
}

/* Фикс для заголовков */
.dark-theme h1, 
.dark-theme h2, 
.dark-theme h3, 
.dark-theme h4, 
.dark-theme h5, 
.dark-theme h6 {
  color: var(--tg-theme-text-color) !important;
}
