/* ===== КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ ===== */
.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}
.btn-theme-toggle:hover {
    background: #f0f0f0;
    border-color: #aaa;
}
/* Светлая тема: показываем луну (предлагаем переключить в тёмную) */
[data-theme="light"] .btn-theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: block; }
/* Тёмная тема: показываем солнце (предлагаем переключить в светлую) */
body[data-theme="dark"]  .btn-theme-toggle .icon-moon { display: none; }
body[data-theme="dark"]  .btn-theme-toggle .icon-sun  { display: block; }

/* ===== ТЁМНАЯ ТЕМА ===== */
body[data-theme="dark"] {
    color-scheme: dark;
}

/* Фон и основные цвета */
body[data-theme="dark"] body,
body[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* Хедер */
body[data-theme="dark"] .header {
    background-color: #212121;
    border-bottom-color: #333;
}

/* Кнопки выбора модели/ассистента */
body[data-theme="dark"] .btn-model-select,
body[data-theme="dark"] .btn-model-select-mobile,
body[data-theme="dark"] .btn-assistant-select,
body[data-theme="dark"] .btn-vector-select,
body[data-theme="dark"] .btn-multimedia-model-select {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
body[data-theme="dark"] .btn-model-select:hover,
body[data-theme="dark"] .btn-assistant-select:hover,
body[data-theme="dark"] .btn-vector-select:hover {
    background-color: #333;
}

/* Кнопка темы в тёмном режиме */
body[data-theme="dark"] .btn-theme-toggle {
    border-color: #444;
    color: #ccc;
}
body[data-theme="dark"] .btn-theme-toggle:hover {
    background: #333;
    border-color: #666;
}

/* Ссылки-пилюли */
body[data-theme="dark"] .header-pill-link {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
body[data-theme="dark"] .header-pill-link:hover {
    background-color: #333;
}

/* Баланс */
body[data-theme="dark"] .balance,
body[data-theme="dark"] .balance-mobile {
    color: #ccc;
}

/* Логотип — если используется цветной, можно добавить фильтр */
body[data-theme="dark"] .logo img {
    filter: brightness(0.9);
}

/* Основной контент */
body[data-theme="dark"] .chat-area,
body[data-theme="dark"] .main-content,
body[data-theme="dark"] .content-area {
    background-color: #1a1a1a;
}

/* Сайдбар */
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] aside {
    background-color: #212121;
    border-right-color: #333;
}
body[data-theme="dark"] .sidebar-item,
body[data-theme="dark"] .chat-item {
    color: #ccc;
}
body[data-theme="dark"] .sidebar-item:hover,
body[data-theme="dark"] .chat-item:hover {
    background-color: #2a2a2a;
}

/* Инпуты и формы */
body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: #666;
}

/* Чат — поле ввода */
body[data-theme="dark"] .chat-input-wrapper,
body[data-theme="dark"] .input-area,
body[data-theme="dark"] .message-input-container {
    background-color: #212121;
    border-color: #333;
}

/* Сообщения */
body[data-theme="dark"] .message-user {
    background-color: #2d3748;
    color: #e0e0e0;
}
body[data-theme="dark"] .message-assistant,
body[data-theme="dark"] .message-ai {
    background-color: #252525;
    color: #e0e0e0;
}

/* Карточки и модалки */
body[data-theme="dark"] .card,
body[data-theme="dark"] .modal-content {
    background-color: #252525;
    border-color: #333;
    color: #e0e0e0;
}
body[data-theme="dark"] .modal-overlay {
    background-color: rgba(0,0,0,0.7);
}
body[data-theme="dark"] .modal-header {
    border-bottom-color: #333;
}

/* Разделители */
body[data-theme="dark"] hr,
body[data-theme="dark"] .divider {
    border-color: #333;
}

/* Скроллбар */
body[data-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
body[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1a1a;
}
body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}
body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Счётчик токенов */
body[data-theme="dark"] .token-counter,
body[data-theme="dark"] .tokens-info {
    color: #888;
}

/* Кнопки действий */
body[data-theme="dark"] .btn-primary {
    background-color: #2563eb;
}
body[data-theme="dark"] .btn-send,
body[data-theme="dark"] .btn-submit {
    background-color: #2563eb;
    color: #fff;
}

/* Пиктограмма загрузки файла */
body[data-theme="dark"] .upload-area,
body[data-theme="dark"] .drop-zone {
    border-color: #444;
    color: #888;
}

/* Таблицы code/pre */
body[data-theme="dark"] pre,
body[data-theme="dark"] code {
    background-color: #2a2a2a;
    border-color: #444;
}

/* Multimedia страница */
body[data-theme="dark"] .multimedia-container,
body[data-theme="dark"] .generation-area {
    background-color: #1a1a1a;
}
body[data-theme="dark"] .result-area,
body[data-theme="dark"] .preview-area {
    background-color: #252525;
    border-color: #333;
}

/* Гамбургер */
body[data-theme="dark"] .hamburger span {
    background-color: #ccc;
}

/* Profile link */
body[data-theme="dark"] .profile-link {
    color: #ccc;
}
body[data-theme="dark"] .profile-link:hover {
    color: #fff;
}

/* Кнопки вход/регистрация */
body[data-theme="dark"] .btn-login {
    border-color: #444;
    color: #ccc;
    background: #2a2a2a;
}
body[data-theme="dark"] .btn-register {
    background-color: #2563eb;
}

/* ===== CHAT-SPECIFIC DARK STYLES ===== */

/* Сайдбар */
body[data-theme="dark"] .sidebar {
    background-color: #1c1c1c;
    border-right-color: #333;
}
body[data-theme="dark"] .sidebar-header {
    border-bottom-color: #333;
}
body[data-theme="dark"] .newChatBtn_Fiat_lux {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}
body[data-theme="dark"] .newChatBtn_Fiat_lux:hover {
    background-color: #333;
}
body[data-theme="dark"] .deleteAllChatsBtn_Fiat_lux {
    background-color: #2a2a2a;
    border-color: #444;
}
body[data-theme="dark"] .deleteAllChatsBtn_Fiat_lux:hover {
    background-color: #3d1f1f;
}

/* Сообщение пользователя */
body[data-theme="dark"] .us_text_Fiat_lux .message_text_Fiat_lux {
    background-color: #2d3748;
    color: #e0e0e0;
    border-color: #4a5568;
}

/* Сообщение ассистента */
body[data-theme="dark"] .ai_message_Fiat_lux .message_text_Fiat_lux {
    background-color: #252525;
    color: #e0e0e0;
}

/* Поле ввода */
body[data-theme="dark"] .inputBox_Fiat_lux {
    background-color: #252525;
    border-color: #444;
}
body[data-theme="dark"] .inputBox_Fiat_lux:focus-within {
    border-color: #666;
}
body[data-theme="dark"] .message-input {
    background-color: #252525;
    color: #e0e0e0;
}
body[data-theme="dark"] .message-input::placeholder {
    color: #666;
}

/* Кнопки отправки и прикрепления */
body[data-theme="dark"] .attach-btn,
body[data-theme="dark"] .sendBtn_Fiat_lux {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
body[data-theme="dark"] .attach-btn:hover,
body[data-theme="dark"] .sendBtn_Fiat_lux:hover {
    background-color: #333;
    color: #fff;
}

/* Заблокированное состояние */
body[data-theme="dark"] .inputBox_Fiat_lux.disabled .message-input,
body[data-theme="dark"] .inputBox_Fiat_lux.disabled .attach-btn,
body[data-theme="dark"] .inputBox_Fiat_lux.disabled .sendBtn_Fiat_lux {
    background-color: #222;
}

/* ===== MODALS ===== */
body[data-theme="dark"] .modal-content {
    background-color: #252525;
    color: #e0e0e0;
}
body[data-theme="dark"] .modal-header {
    border-bottom-color: #333;
}
body[data-theme="dark"] .modal-header h3 {
    color: #e0e0e0;
}
body[data-theme="dark"] .modal-close {
    color: #888;
}
body[data-theme="dark"] .modal-close:hover {
    background-color: #333;
    color: #e0e0e0;
}
body[data-theme="dark"] .modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}
body[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
    background: #444;
}
body[data-theme="dark"] .modal-footer {
    background-color: #1e1e1e;
    border-top-color: #333;
}
body[data-theme="dark"] .modal-footer h4 {
    color: #aaa;
}

/* model-item внутри модалок */
body[data-theme="dark"] .model-item {
    border-color: #333;
    color: #e0e0e0;
}
body[data-theme="dark"] .model-item:hover {
    background-color: #2a2a2a;
    border-color: #444;
}
body[data-theme="dark"] .model-item.active {
    background-color: #1a2a3a;
    border-color: #3b82f6;
}

/* assistant-modal-btn */
body[data-theme="dark"] .assistant-modal-btn {
    border-color: #333;
    color: #e0e0e0;
}
body[data-theme="dark"] .assistant-modal-btn:hover {
    background-color: #2a2a2a;
}
body[data-theme="dark"] .assistant-modal-btn.active {
    background-color: #1a2a3a;
    border-color: #3b82f6;
}

/* ===== FAQ ===== */
body[data-theme="dark"] .faq-section {
    background-color: transparent;
}
body[data-theme="dark"] .faqCard_Fiat_lux {
    background-color: #252525;
    border-color: #333;
}
body[data-theme="dark"] .faqQ_Fiat_lux {
    background-color: #252525;
    color: #e0e0e0;
}
body[data-theme="dark"] .faqQ_Fiat_lux:hover {
    background-color: #2a2a2a;
}
body[data-theme="dark"] .faq-icon {
    color: #aaa;
}
body[data-theme="dark"] .faq-title {
    color: #e0e0e0;
}
body[data-theme="dark"] .faqA_Fiat_lux {
    color: #bbb;
    background-color: #252525;
}

/* ===== MULTIMEDIA PAGE ===== */
body[data-theme="dark"] .multimedia-preview,
body[data-theme="dark"] .multimedia-container,
body[data-theme="dark"] .generation-result,
body[data-theme="dark"] .multimedia-input-box {
    background-color: #252525;
    border-color: #333;
    color: #e0e0e0;
}
/* Белый превью-блок (пунктирная граница) */
body[data-theme="dark"] .preview-placeholder,
body[data-theme="dark"] [class*="preview"],
body[data-theme="dark"] [class*="result-area"] {
    background-color: #1e1e1e;
    border-color: #333;
    color: #666;
}

/* ===== MULTIMEDIA PAGE (inline styles override) ===== */
body[data-theme="dark"] .multimedia-generator-container {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
body[data-theme="dark"] .multimedia-main {
    background: #1a1a1a;
}
body[data-theme="dark"] .multimedia-output-placeholder {
    background: #1e1e1e;
    border-color: #444;
    color: #555;
}

/* ===== CHAT LIST ITEMS ===== */
body[data-theme="dark"] .chatItem_Fiat_lux {
    color: #ccc !important;
}
body[data-theme="dark"] .chatItem_Fiat_lux:hover {
    background-color: #2a2a2a !important;
}
body[data-theme="dark"] .chatItem_Fiat_lux.active {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}
body[data-theme="dark"] .chatItem_Fiat_lux svg {
    color: #888 !important;
}

/* ===== CHAR COUNTER (счётчик токенов) ===== */
body[data-theme="dark"] .char-counter {
    background: #2a2a2a !important;
    color: #999 !important;
    border: 1px solid #444;
}

/* === Fix: model card text colors in dark mode === */
body[data-theme="dark"] .model-name {
    color: #e0e0e0 !important;
}
body[data-theme="dark"] .model-description {
    color: #a0a0a0 !important;
}

/* === Fix: white divider lines in modal (dark mode) === */
body[data-theme="dark"] .modal-header {
    border-bottom-color: #333 !important;
}
body[data-theme="dark"] .modal-close {
    border-bottom-color: #333 !important;
    color: #e0e0e0 !important;
}
body[data-theme="dark"] .modal-header h3 {
    color: #e0e0e0 !important;
}

/* === Fix: model picker toolbar background in dark mode === */
body[data-theme="dark"] .mp-toolbar {
    background: #252525 !important;
    border-bottom-color: #333 !important;
}

/* === Fix: mp-toolbar shadow/border on scroll in dark mode === */
body[data-theme="dark"] .mp-toolbar {
    background: #252525 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}
body[data-theme="dark"] .mp-chips-wrap {
    border-bottom: none !important;
}

/* === Fix: mp-toolbar box-shadow white line in dark mode === */
body[data-theme="dark"] .mp-toolbar {
    box-shadow: 0 2px 0 #252525, 0 4px 8px -4px rgba(0, 0, 0, 0.4) !important;
}

/* === Fix: assistant modal dark mode === */
body[data-theme="dark"] .assistant-item {
    border-color: #333 !important;
    background-color: #2a2a2a !important;
}
body[data-theme="dark"] .assistant-item:hover {
    background-color: #303030 !important;
    border-color: #444 !important;
}
body[data-theme="dark"] .assistant-item.active {
    background-color: #1e3a5f !important;
    border-color: #3b82f6 !important;
}
body[data-theme="dark"] .assistant-item.no-assistant {
    background-color: #2a2a2a !important;
    border-color: #333 !important;
}
body[data-theme="dark"] .assistant-item.no-assistant.active {
    background-color: #1e3a5f !important;
    border-color: #3b82f6 !important;
}
body[data-theme="dark"] .assistant-name {
    color: #e0e0e0 !important;
}
body[data-theme="dark"] .assistant-description {
    color: #a0a0a0 !important;
}
body[data-theme="dark"] .assistant-action-btn {
    color: #666 !important;
}
body[data-theme="dark"] .assistant-action-btn:hover {
    background-color: #333 !important;
    color: #e0e0e0 !important;
}
body[data-theme="dark"] #assistantFormFooter {
    background-color: #252525 !important;
    border-top-color: #333 !important;
}

/* === Fix: assistant footer dark mode === */
body[data-theme="dark"] #assistantFormFooter {
    background-color: #252525 !important;
    border-top-color: #333 !important;
}

/* === Fix: modal footer white strip === */
body[data-theme="dark"] .modal-footer,
body[data-theme="dark"] .modal-content > div:last-child,
body[data-theme="dark"] #assistantFormFooter,
body[data-theme="dark"] [id*="Footer"],
body[data-theme="dark"] [class*="footer"] {
    background-color: #252525 !important;
    border-top-color: #333 !important;
}

/* === Fix: create assistant button dark mode === */
body[data-theme="dark"] .assistant-modal-btn {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}
body[data-theme="dark"] .assistant-modal-btn:hover {
    background-color: #333 !important;
    border-color: #555 !important;
}

/* === Fix: vector db modal dark mode === */
body[data-theme="dark"] .vector-item {
    border-color: #333 !important;
    background-color: #2a2a2a !important;
}
body[data-theme="dark"] .vector-item:hover {
    background-color: #303030 !important;
    border-color: #444 !important;
}
body[data-theme="dark"] .vector-item.active {
    background-color: #1e3a5f !important;
    border-color: #3b82f6 !important;
}
body[data-theme="dark"] .vector-item.no-vector {
    background-color: #2a2a2a !important;
    border-color: #333 !important;
}
body[data-theme="dark"] .vector-item.no-vector.active {
    background-color: #1e3a5f !important;
    border-color: #3b82f6 !important;
}
body[data-theme="dark"] .vector-name {
    color: #e0e0e0 !important;
}
body[data-theme="dark"] .vector-description {
    color: #a0a0a0 !important;
}
body[data-theme="dark"] .vector-action-btn {
    color: #666 !important;
}
body[data-theme="dark"] .vector-action-btn:hover {
    background-color: #333 !important;
    color: #e0e0e0 !important;
}
body[data-theme="dark"] #vectorFormFooter,
body[data-theme="dark"] .modal-footer-create {
    background-color: #252525 !important;
    border-top-color: #333 !important;
}
body[data-theme="dark"] .vector-modal-btn {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}
body[data-theme="dark"] .vector-modal-btn:hover {
    background-color: #333 !important;
    border-color: #555 !important;
}
body[data-theme="dark"] #howItWorksContent {
    background-color: #2a2a2a !important;
    color: #a0a0a0 !important;
}

/* === Fix: vector modal price/link dark mode (inline styles override) === */
body[data-theme="dark"] .modal-footer-info > div:first-child {
    background: #2a2a2a !important;
    color: #a0a0a0 !important;
}
body[data-theme="dark"] .modal-footer-info a {
    color: #a0a0a0 !important;
}
body[data-theme="dark"] .modal-footer-info a:hover {
    color: #e0e0e0 !important;
}

/* === Fix: vector price box and how-link === */
.vector-price-box {
    font-size: 13px;
    color: #626161;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}
.vector-how-link {
    color: #2d2d2d;
    font-size: 14px;
    cursor: pointer;
}
body[data-theme="dark"] .vector-price-box {
    background: #2a2a2a !important;
    color: #a0a0a0 !important;
}
body[data-theme="dark"] .vector-how-link {
    color: #888 !important;
}
body[data-theme="dark"] .vector-how-link:hover {
    color: #e0e0e0 !important;
}

/* === Fix: FAQ accordion dark mode === */
body[data-theme="dark"] .faqA_Fiat_lux {
    background-color: #252525 !important;
}
body[data-theme="dark"] .faqCard_Fiat_lux.active .faqA_Fiat_lux {
    background-color: #2a2a2a !important;
    border-top-color: #333 !important;
}
body[data-theme="dark"] .faqA_Fiat_lux p {
    color: #c0c0c0 !important;
}
body[data-theme="dark"] .faqCard_Fiat_lux {
    background-color: #252525 !important;
    border-color: #333 !important;
}
body[data-theme="dark"] .faqCard_Fiat_lux:hover {
    background-color: #2d2d2d !important;
}
body[data-theme="dark"] .faqQ_Fiat_lux {
    color: #e0e0e0 !important;
}

/* === Fix: .copy-btn dark mode (class found at line 2339) === */
body[data-theme="dark"] .copy-btn {
    background: #3a3a3a !important;
    color: #d4d4d4 !important;
    border: 1px solid #555 !important;
}
body[data-theme="dark"] .copy-btn:hover {
    background: #4a4a4a !important;
}
body[data-theme="dark"] .copy-btn.copied {
    background: #2d6a2d !important;
    color: #a8e6a8 !important;
}

/* === Fix: .code-block dark mode === */
body[data-theme="dark"] .code-block {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    border: 1px solid #333 !important;
}
body[data-theme="dark"] .code-block pre,
body[data-theme="dark"] .code-block code {
    color: #d4d4d4 !important;
    background: transparent !important;
}
/* Синтаксис (highlight.js) */
body[data-theme="dark"] .code-block .hljs-keyword  { color: #569cd6 !important; }
body[data-theme="dark"] .code-block .hljs-string    { color: #ce9178 !important; }
body[data-theme="dark"] .code-block .hljs-comment   { color: #6a9955 !important; }
body[data-theme="dark"] .code-block .hljs-class .hljs-title,
body[data-theme="dark"] .code-block .hljs-title     { color: #4ec9b0 !important; }
body[data-theme="dark"] .code-block .hljs-built_in  { color: #4ec9b0 !important; }
body[data-theme="dark"] .code-block .hljs-number    { color: #b5cea8 !important; }
body[data-theme="dark"] .code-block .hljs-variable  { color: #9cdcfe !important; }
body[data-theme="dark"] .code-block .hljs-attr      { color: #9cdcfe !important; }
