/* UI themes — всегда в head; превью через data-theme на <html> */

/* Dark */
html[data-theme="dark"] body{background:#09090b!important;color:#fafafa!important}
        html[data-theme="dark"] nav,
html[data-theme="dark"] footer{background:#18181b!important;border-color:#3f3f46!important}
        html[data-theme="dark"] .bg-slate-900{background:#09090b!important}
        html[data-theme="dark"] .bg-slate-800{background:#18181b!important}
        html[data-theme="dark"] .bg-slate-700{background:#27272a!important}
        html[data-theme="dark"] .border-slate-900,
html[data-theme="dark"] .border-slate-800,
html[data-theme="dark"] .border-slate-700,
html[data-theme="dark"] .border-slate-600{border-color:#3f3f46!important}
        html[data-theme="dark"] .text-white{color:#fafafa!important}
        html[data-theme="dark"] .text-slate-200,
html[data-theme="dark"] .text-slate-300{color:#d4d4d8!important}
        html[data-theme="dark"] .text-slate-400,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-600{color:#71717a!important}
        html[data-theme="dark"] .text-indigo-400,
html[data-theme="dark"] .text-indigo-500{color:#a78bfa!important}
        html[data-theme="dark"] .bg-indigo-600{background:#a78bfa!important}
        html[data-theme="dark"] .border-indigo-500,
html[data-theme="dark"] .border-indigo-400{border-color:#a78bfa!important}
        html[data-theme="dark"] input:not([type=radio]):not([type=checkbox]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#09090b!important;border-color:#3f3f46!important;color:#fafafa!important}
        html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#71717a!important}

/* Light */
html[data-theme="light"] body{background:#f1f5f9!important;color:#0f172a!important}
        html[data-theme="light"] nav{background:#ffffff!important;border-color:#e2e8f0!important;box-shadow:0 1px 3px rgba(0,0,0,.08)!important}
        html[data-theme="light"] footer{background:#ffffff!important;border-color:#e2e8f0!important}
        html[data-theme="light"] .bg-slate-800{background:#ffffff!important}
        html[data-theme="light"] .bg-slate-900{background:#f8fafc!important}
        html[data-theme="light"] .bg-slate-700{background:#e2e8f0!important}
        html[data-theme="light"] .border-slate-900,
html[data-theme="light"] .border-slate-800,
html[data-theme="light"] .border-slate-700,
html[data-theme="light"] .border-slate-600{border-color:#e2e8f0!important}
        html[data-theme="light"] .text-white{color:#0f172a!important}
        html[data-theme="light"] .text-slate-200,
html[data-theme="light"] .text-slate-300{color:#334155!important}
        html[data-theme="light"] .text-slate-400,
html[data-theme="light"] .text-slate-500,
html[data-theme="light"] .text-slate-600{color:#64748b!important}
        /* Opacity-утилиты Tailwind (text-*/90) не ловятся селекторами выше — цвет остаётся светлым */
        html[data-theme="light"] [class*="text-white/"],
html[data-theme="light"] [class*="text-slate-50"],
html[data-theme="light"] [class*="text-slate-100"],
html[data-theme="light"] [class*="text-slate-200/"],
html[data-theme="light"] [class*="text-slate-300/"]{color:#0f172a!important}
        html[data-theme="light"] [class*="text-amber-50"],
html[data-theme="light"] [class*="text-amber-100"],
html[data-theme="light"] [class*="text-amber-200\/"]{color:#78350f!important}
        html[data-theme="light"] [class*="text-amber-300\/"]{color:#92400e!important}
        html[data-theme="light"] [class*="text-indigo-50"],
html[data-theme="light"] [class*="text-indigo-100"],
html[data-theme="light"] [class*="text-indigo-200\/"]{color:#334155!important}
        /* Кнопки с цветным фоном: белый текст (общий .text-white выше делает его тёмным) */
        /* Не трогаем .home-action-btn — в светлой теме у неё белый фон и тёмный текст */
        html[data-theme="light"] .bg-indigo-600.text-white:not(.home-action-btn),
html[data-theme="light"] .bg-indigo-500.text-white:not(.home-action-btn),
html[data-theme="light"] a.bg-indigo-600:not(.home-action-btn),
html[data-theme="light"] button.bg-indigo-600:not(.home-action-btn),
html[data-theme="light"] .bg-sky-500.text-white,
html[data-theme="light"] a.bg-sky-500,
html[data-theme="light"] button.bg-sky-500,
html[data-theme="light"] .bg-red-600.text-white,
html[data-theme="light"] a.bg-red-600,
html[data-theme="light"] button.bg-red-600,
html[data-theme="light"] .bg-blue-600.text-white,
html[data-theme="light"] a.bg-blue-600,
html[data-theme="light"] button.bg-blue-600{color:#ffffff!important}
        /* Курсы / книги: запись партии и комментарии */
        html[data-theme="light"] #study-comment,
html[data-theme="light"] #study-comment p,
html[data-theme="light"] #lichess-move-column,
html[data-theme="light"] #variation-moves{color:#334155!important}
        html[data-theme="light"] #study-comment .text-slate-200,
html[data-theme="light"] #study-comment .text-slate-300,
html[data-theme="light"] #study-comment .text-amber-100\/90{color:#334155!important}
        html[data-theme="light"] #lichess-move-column .text-slate-100,
html[data-theme="light"] #lichess-move-column .text-slate-200,
html[data-theme="light"] #lichess-move-column .text-slate-300{color:#334155!important}
        html[data-theme="light"] #lichess-move-column .text-slate-500{color:#64748b!important}
        html[data-theme="light"] #lichess-move-column .hover\:bg-slate-600\/70:hover{background:#e2e8f0!important}
        html[data-theme="light"] #lichess-move-column .move-active{background:#4f46e5!important;color:#fff!important}
        html[data-theme="light"] #lichess-move-column .move-user{color:#047857!important}
        html[data-theme="light"] .border-l-2.border-amber-500\/40{border-left-color:#f59e0b!important}
        html[data-theme="light"] .text-indigo-400,
html[data-theme="light"] .text-indigo-500{color:#4f46e5!important}
        html[data-theme="light"] .bg-indigo-600{background:#4f46e5!important}
        html[data-theme="light"] .hover\:bg-indigo-700:hover,
html[data-theme="light"] .hover\:bg-indigo-500:hover{background:#4338ca!important}
        html[data-theme="light"] .border-indigo-500,
html[data-theme="light"] .border-indigo-400{border-color:#4f46e5!important}
        html[data-theme="light"] input:not([type=radio]):not([type=checkbox]),
html[data-theme="light"] select,
html[data-theme="light"] textarea{background:#ffffff!important;border-color:#e2e8f0!important;color:#0f172a!important}
        html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder{color:#94a3b8!important}
        html[data-theme="light"] nav a:not(.bg-indigo-600){color:#334155!important}
        html[data-theme="light"] nav a:hover:not(.bg-indigo-600){color:#4f46e5!important}
        /* Блок совета тренера и блок цитаты AI разбора — без фона, чтобы не было наложения */
        html[data-theme="light"] .bg-indigo-600\/5,
html[data-theme="light"] .bg-indigo-600\/10{background:transparent!important;border-color:#e2e8f0!important}
        /* Убираем фиолетовую левую рамку на блоке AI разбора */
        html[data-theme="light"] .border-l-4.border-indigo-500{border-left-color:#e2e8f0!important}
        /* Жёлтый/amber на светлом фоне плохо читается — тёмные оттенки */
        html[data-theme="light"] .text-amber-100,
html[data-theme="light"] .text-amber-200{color:#78350f!important}
        html[data-theme="light"] .text-amber-300{color:#92400e!important}
        html[data-theme="light"] .text-amber-400,
html[data-theme="light"] .text-amber-500{color:#b45309!important}
        html[data-theme="light"] .bg-amber-500\/5,
html[data-theme="light"] .bg-amber-500\/10,
html[data-theme="light"] .bg-amber-500\/15,
html[data-theme="light"] .bg-amber-500\/20{background:#fffbeb!important}
        html[data-theme="light"] .border-amber-500\/25,
html[data-theme="light"] .border-amber-500\/30,
html[data-theme="light"] .border-amber-500\/40{border-color:#fcd34d!important}
        /* Успех / Premium — тёмно-зелёный на светлом фоне */
        html[data-theme="light"] .text-emerald-200,
html[data-theme="light"] .text-emerald-300{color:#065f46!important}
        html[data-theme="light"] .text-emerald-400{color:#047857!important}
        html[data-theme="light"] .bg-emerald-500\/10{background:#ecfdf5!important}
        html[data-theme="light"] .border-emerald-500\/30{border-color:#6ee7b7!important}
        /* Светлая тема: главные кнопки — контур, не сплошной фиолетовый */
        html[data-theme="light"] .home-action-btn{background:#ffffff!important;border:1px solid #c7d2fe!important;color:#4338ca!important;box-shadow:0 1px 2px rgba(15,23,42,.06)!important}
        html[data-theme="light"] .home-action-btn:hover{background:#eef2ff!important;border-color:#818cf8!important;color:#3730a3!important}
        html[data-theme="light"] .home-action-btn,
html[data-theme="light"] .home-action-btn span,
html[data-theme="light"] .home-action-btn i{color:#4338ca!important}
        html[data-theme="light"] .home-action-btn:hover,
html[data-theme="light"] .home-action-btn:hover span,
html[data-theme="light"] .home-action-btn:hover i{color:#3730a3!important}
        html[data-theme="light"] .home-action-btn.text-white{color:#4338ca!important}
        html[data-theme="light"] .trainer-ai-plan-btn{background:#ffffff!important;border-color:#c7d2fe!important;box-shadow:0 1px 3px rgba(79,70,229,.08)!important}
        html[data-theme="light"] .trainer-ai-plan-btn:hover{background:#f8fafc!important;border-color:#818cf8!important}
        html[data-theme="light"] .trainer-ai-plan-btn h4{color:#1e293b!important}
        html[data-theme="light"] .trainer-ai-plan-btn p{color:#475569!important}
        html[data-theme="light"] .trainer-ai-plan-btn>div:first-child{background:#eef2ff!important;color:#4f46e5!important}
        /* Реплики бота в тренажёре — индиго вместо бледно-жёлтого */
        html[data-theme="light"] .ai-bot-reply{background:#eef2ff!important;border-color:#c7d2fe!important;border-left-color:#4f46e5!important}
        html[data-theme="light"] .ai-bot-reply-label{color:#4338ca!important}
        html[data-theme="light"] .ai-bot-reply-text{color:#1e293b!important}
        /* Тренажёр: ответы ИИ, панель тренера */
        html[data-theme="light"] .text-indigo-100,
html[data-theme="light"] .text-indigo-100\/85,
html[data-theme="light"] .text-indigo-200,
html[data-theme="light"] .text-indigo-50{color:#334155!important}
        html[data-theme="light"] .text-indigo-300{color:#4338ca!important}
        html[data-theme="light"] .bg-indigo-950\/30,
html[data-theme="light"] .bg-indigo-950\/50,
html[data-theme="light"] .bg-indigo-500\/10{background:#eef2ff!important}
        html[data-theme="light"] .border-indigo-500\/30,
html[data-theme="light"] .border-indigo-500\/25{border-color:#c7d2fe!important}
        html[data-theme="light"] .training-coach-card{background:#ffffff!important;border-color:#c7d2fe!important;box-shadow:0 1px 3px rgba(79,70,229,.1)!important}
        html[data-theme="light"] .training-coach-feedback{color:#334155!important}
        html[data-theme="light"] #coach-feedback,
html[data-theme="light"] #coach-feedback p,
html[data-theme="light"] #coach-feedback .leading-relaxed{color:#334155!important}
        html[data-theme="light"] #plan-ai-result,
html[data-theme="light"] #conversion-ai-comment-loader{background:#eef2ff!important;border-color:#c7d2fe!important;color:#1e293b!important}
        html[data-theme="light"] .training-task-banner{background:#eef2ff!important;border-color:#c7d2fe!important}
        html[data-theme="light"] .training-task-banner__title{color:#1e293b!important}
        html[data-theme="light"] .training-task-banner__sub{color:#475569!important}
        html[data-theme="light"] #theory-study-comment{background:#f8fafc!important;border-color:#e2e8f0!important;color:#334155!important}
        html[data-theme="light"] #theory-variation-container{background:#eef2ff!important;border-color:#c7d2fe!important}
        html[data-theme="light"] #theory-variation-moves,
html[data-theme="light"] #theory-lichess-move-column{color:#334155!important}
        /* Разбор партии: запись ходов и комментарии ИИ */
        html[data-theme="light"] #critical-explainer,
html[data-theme="light"] #lichess-move-column,
html[data-theme="light"] #notation-list{background:#f8fafc!important;border-color:#e2e8f0!important;color:#334155!important}
        html[data-theme="light"] #critical-explainer .text-slate-200,
html[data-theme="light"] #critical-explainer .text-slate-300,
html[data-theme="light"] #critical-explainer .leading-relaxed{color:#334155!important}
        html[data-theme="light"] #critical-explainer .text-slate-500{color:#64748b!important}
        html[data-theme="light"] #lichess-move-column .text-slate-300,
html[data-theme="light"] #lichess-move-column .text-slate-200{color:#334155!important}
        html[data-theme="light"] #lichess-move-column .move-number{color:#64748b!important}
        html[data-theme="light"] #lichess-move-column .move-active{background:#4f46e5!important;color:#fff!important}
        html[data-theme="light"] .move-row:hover{background:#e2e8f0!important}
        html[data-theme="light"] .move-cell:hover{background:#cbd5e1!important}
        html[data-theme="light"] .move-inaccuracy{color:#b45309!important}
        html[data-theme="light"] .move-mistake{color:#c2410c!important}
        html[data-theme="light"] .move-blunder{color:#b91c1c!important}
        html[data-theme="light"] .move-brilliant{color:#047857!important}
        html[data-theme="light"] .move-great{color:#1d4ed8!important}
        html[data-theme="light"] .move-plan{color:#0369a1!important}

/* Профиль: панель настроек и сайдбар — явно светлые при превью темы */
html[data-theme="light"] .profile-settings-panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}
html[data-theme="light"] .profile-settings-aside h1,
html[data-theme="light"] .profile-settings-panel h2 {
  color: #0f172a !important;
}
html[data-theme="light"] .profile-settings-aside .tab-btn {
  color: #64748b !important;
}
html[data-theme="light"] .profile-settings-aside .tab-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .profile-settings-aside .tab-btn.bg-indigo-600,
html[data-theme="light"] .profile-settings-aside .tab-btn.bg-indigo-600:hover {
  background: #4f46e5 !important;
  color: #ffffff !important;
}

/* Полупрозрачные тёмные фоны Tailwind (bg-slate-900/60 и т.п.) — иначе текст «тонет» */
html[data-theme="light"] [class*="bg-slate-900/"],
html[data-theme="light"] [class*="bg-slate-800/"] {
  background: #f1f5f9 !important;
}
html[data-theme="light"] [class*="hover:bg-slate-800/"]:hover,
html[data-theme="light"] [class*="hover:bg-slate-700/"]:hover {
  background: #e2e8f0 !important;
}

/* Переключатель Игрок / Тренер */
html[data-theme="light"] .profile-role-switch {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}
html[data-theme="light"] .profile-role-btn {
  color: #475569 !important;
}
html[data-theme="light"] .profile-role-btn:hover:not(.is-active):not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .profile-role-btn.is-active,
html[data-theme="light"] .profile-role-btn.bg-indigo-600 {
  background: #4f46e5 !important;
  color: #ffffff !important;
}

/* Тексты и подписи внутри панели профиля */
html[data-theme="light"] .profile-settings-panel .text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .profile-settings-panel .text-slate-200,
html[data-theme="light"] .profile-settings-panel .text-slate-300 {
  color: #334155 !important;
}
html[data-theme="light"] .profile-settings-panel .text-slate-400,
html[data-theme="light"] .profile-settings-panel .text-slate-500,
html[data-theme="light"] .profile-settings-panel .text-slate-600 {
  color: #64748b !important;
}
html[data-theme="light"] .profile-settings-panel .bg-indigo-600,
html[data-theme="light"] .profile-settings-panel .bg-indigo-600.text-white,
html[data-theme="light"] .profile-settings-panel button.bg-indigo-600,
html[data-theme="light"] .profile-settings-panel a.bg-indigo-600,
html[data-theme="light"] .profile-settings-panel .bg-red-600,
html[data-theme="light"] .profile-settings-panel .bg-red-600.text-white,
html[data-theme="light"] .profile-settings-panel button.bg-red-600 {
  color: #ffffff !important;
}
html[data-theme="light"] .profile-settings-panel .peer-checked\:bg-indigo-600:checked + div,
html[data-theme="light"] .profile-settings-panel .peer:checked + .peer-checked\:bg-indigo-600,
html[data-theme="light"] .profile-settings-panel input:checked + div.peer-checked\:bg-indigo-600 {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
}
/* Дни недели: неактивный день читаемый, активный — белый текст */
html[data-theme="light"] .profile-settings-panel label .peer-checked\:bg-indigo-600 {
  color: #64748b !important;
}
html[data-theme="light"] .profile-settings-panel label:has(input:checked) .peer-checked\:bg-indigo-600,
html[data-theme="light"] .profile-settings-panel label:has(input:checked) > div {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
}
html[data-theme="light"] .profile-settings-panel .text-indigo-300 {
  color: #4338ca !important;
}
html[data-theme="light"] .profile-settings-panel .hover\:text-white:hover {
  color: #0f172a !important;
}
html[data-theme="light"] .profile-settings-panel .bg-indigo-600.hover\:text-white:hover,
html[data-theme="light"] .profile-settings-panel button.bg-indigo-600:hover {
  color: #ffffff !important;
}
html[data-theme="light"] .profile-settings-panel .plan-card .text-white,
html[data-theme="light"] .profile-settings-panel .plan-card span.text-white {
  color: #0f172a !important;
}
html[data-theme="light"] .profile-settings-panel table thead {
  color: #64748b !important;
}
html[data-theme="light"] .profile-settings-panel input:disabled,
html[data-theme="light"] .profile-settings-panel input[disabled] {
  background: #f8fafc !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}

