/* ===================================================================
   Theme Switcher & Dark Mode Styles
====================================================================== */

/* Общая коррекция для изображений, чтобы они не были слишком яркими */
:root[data-theme="dark"] img {
    filter: brightness(.8) contrast(1.2); 
}

/* Исключения для логотипов и иконок */
:root[data-theme="dark"] .header__logo img,
:root[data-theme="dark"] .footer-4__logo img,
:root[data-theme="dark"] .thinking-ai-6__icon img,
:root[data-theme="dark"] .our-features__item .icon img,
:root[data-theme="dark"] .why-choose-us__item-icon img {
    filter: none;
}


/* CSS переменные для темной темы */
:root[data-theme="dark"] {
    --rr-body-primary: #0D1117;
    --rr-common-white: #0D1117;
    --rr-common-black: #F0F6FC;
    --rr-heading-primary: #F0F6FC;
    --rr-heading-secondary: #E6EDF3;
    --rr-text-body: rgba(240, 246, 252, 0.7);
    --rr-text-primary: #F0F6FC;
    --rr-text-primary1: #E6EDF3;
    --rr-text-primary2: #7D8590;
    --rr-text-primary3: #656D76;
    --rr-border-primary: 1px solid rgba(240, 246, 252, 0.14);
    --rr-section-1: #161B22;
    --rr-section-2: #21262D;
    --rr-theme-footer-bg-1: #010409;
    --rr-menu-primary: #8B949E;
}

:root[data-theme="dark"] .thinking-ai-6__title {
    color: var(--rr-heading-primary) !important;
}

:root[data-theme="dark"] .thinking-ai-6__dec {
    color: var(--rr-text-body) !important;
}

:root[data-theme="dark"] p {
    color: var(--rr-text-body) !important;
}

/* Переключатель темы */
.theme-switcher-wrapper {
    /* margin-left: 15px; */
}

.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--rr-heading-primary);
}

.theme-switcher:hover {
    background: rgba(1, 9, 21, 0.1);
    transform: scale(1.05);
}

/* :root[data-theme="dark"] .theme-switcher:hover {
    background: rgba(240, 246, 252, 0.1);
} */

.switcher-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.switcher-icon svg {
    position: absolute;
    transition: all 0.3s ease;
    color: currentColor;
}

/* Светлая тема - показываем солнце */
.switcher-icon .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.switcher-icon .moon-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

/* Темная тема - показываем луну */
:root[data-theme="dark"] .switcher-icon .sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

:root[data-theme="dark"] .switcher-icon .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Темная тема для основных элементов */
:root[data-theme="dark"] body {
    background-color: var(--rr-body-primary);
    color: var(--rr-text-body);
}

:root[data-theme="dark"] .header__area {
    background-color: #161B22;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

:root[data-theme="dark"] .banner {
    background-color: #1e2734;
}

:root[data-theme="dark"] .thinking-ai-6__area,
:root[data-theme="dark"] .our-features,
:root[data-theme="dark"] .services-provided,
:root[data-theme="dark"] .why-choose-us,
:root[data-theme="dark"] .cool-amazing {
    background-color: #0D1117;
}

/* Карточки и элементы */
:root[data-theme="dark"] .thinking-ai-6__item,
:root[data-theme="dark"] .our-features__item,
:root[data-theme="dark"] .cool-amazing__item {
    background-color: #161B22;
    border: 1px solid rgba(240, 246, 252, 0.1);
}

:root[data-theme="dark"] .thinking-ai-6__item:hover,
:root[data-theme="dark"] .our-features__item:hover {
    background-color: #21262D;
    transform: translateY(-5px);
}

/* Табы */
:root[data-theme="dark"] .services-provided__tab li button {
    color: var(--rr-text-body);
    background-color: transparent;
    border: 1px solid rgba(240, 246, 252, 0.1);
}

:root[data-theme="dark"] .services-provided__tab li button.active,
:root[data-theme="dark"] .services-provided__tab li button:hover {
    background-color: #21262D;
    color: var(--rr-heading-primary);
    border-color: var(--rr-wifly-primary3);
}

/* Кнопки */
:root[data-theme="dark"] .rr-btn__theme-6 {
    background: var(--rr-wifly-primary3);
    color: var(--rr-common-white);
}

:root[data-theme="dark"] .rr-btn__theme-6:hover {
    background: var(--rr-wifly-primary2);
}



/* Языковое меню в темной теме */
:root[data-theme="dark"] .language-dropdown {
    background: #161B22;
    border: 1px solid rgba(240, 246, 252, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .language-dropdown::before {
    border-bottom-color: #161B22;
}

:root[data-theme="dark"] .language-dropdown li a {
    color: var(--rr-text-primary) !important;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

:root[data-theme="dark"] .language-dropdown li:last-child a {
    border-bottom: none;
}

:root[data-theme="dark"] .language-dropdown li a:hover {
    background: linear-gradient(135deg, #21262D 0%, #30363D 100%);
    color: var(--rr-heading-primary) !important;
}

/* Мобильное меню в темной теме */
:root[data-theme="dark"] .offcanvas__area {
    background: #161B22;
    border-left: 1px solid rgba(240, 246, 252, 0.1);
}

:root[data-theme="dark"] .offcanvas__top {
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

/* Попапы */
:root[data-theme="dark"] .popup-content {
    background: #161B22;
    color: var(--rr-text-primary);
    border: 1px solid rgba(240, 246, 252, 0.1);
}

:root[data-theme="dark"] .popup-title {
    color: var(--rr-text-primary);
}

:root[data-theme="dark"] .popup-text {
    color: var(--rr-text-body);
}

:root[data-theme="dark"] .popup-close {
    color: var(--rr-text-body);
}

:root[data-theme="dark"] .popup-close:hover {
    color: var(--rr-heading-primary);
}

/* Партнеры */

:root[data-theme="dark"] .brand__thumb img {
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

:root[data-theme="dark"] .brand__thumb:hover img {
    opacity: 1;
    filter: brightness(0) invert(0.8);
}

/* Аудитория секция */

:root[data-theme="dark"] .why-choose-us__item-bar {
    border: 1px dashed rgba(205, 205, 205, 0.49) !important;
}

:root[data-theme="dark"] .why-choose-us__item-arrow-bottom img {
    content: url("../imgs/audience/audience_item-bottom-arrow-dark.png");
}

:root[data-theme="dark"] .why-choose-us__item__content {
    transition: all 0.3s ease;
    background-color: #21262D;
}


/* Форматы баннеров */


/* Адаптация для мобильных устройств */
@media (max-width: 991px) {
    .theme-switcher-wrapper {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Футер */

:root[data-theme="dark"] .footer__area-common {
    background-color: #010409;
}

:root[data-theme="dark"] .footer__bottom-wrapper {
    background-color: #010409;
    /* border-top: 1px solid rgba(240, 246, 252, 0.1); */
}

:root[data-theme="dark"] .footer-4__left-bg {
    background-color: #010409;
}

:root[data-theme="dark"] .footer-4__right-bg {
    background-color: #010409;
}

:root[data-theme="dark"] .footer-4__top-bg {
    background-color: #010409;
}

:root[data-theme="dark"] .footer-4__info-item .text a
{
    color: var(--rr-text-body) !important;
}

:root[data-theme="dark"] .footer-4__widget-title h3 {
    color: var(--rr-text-body) !important;
}

/* Анимация переключения темы */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Инпуты в темной теме */
:root[data-theme="dark"] input[type=text],
:root[data-theme="dark"] input[type=email],
:root[data-theme="dark"] input[type=tel],
:root[data-theme="dark"] input[type=number],
:root[data-theme="dark"] input[type=password],
:root[data-theme="dark"] input[type=date],
:root[data-theme="dark"] textarea {
    background-color: #21262D;
    border: 1px solid rgba(240, 246, 252, 0.2);
    color: var(--rr-heading-primary) !important;
}

:root[data-theme="dark"] input[type=text]:focus,
:root[data-theme="dark"] input[type=email]:focus,
:root[data-theme="dark"] input[type=tel]:focus,
:root[data-theme="dark"] input[type=number]:focus,
:root[data-theme="dark"] input[type=password]:focus,
:root[data-theme="dark"] input[type=date]:focus,
:root[data-theme="dark"] textarea:focus {
    border-color: var(--rr-wifly-primary3);
    box-shadow: 0 0 0 2px rgba(102, 152, 210, 0.2);
}

/* Пункты меню в темной теме - десктоп */
:root[data-theme="dark"] .main-menu ul li a {
    color: #F0F6FC !important;
}

@media (max-width: 1210px) {
    .offcanvas__area .mobile-menu ul li a,
    .mobile-menu ul li a,
    .mean-container .mean-nav ul li a,
    .offcanvas__content .mobile-menu a {
        text-transform: uppercase !important;
    }
}

:root[data-theme="dark"] .offcanvas__area .mobile-menu ul li a,
:root[data-theme="dark"] .mobile-menu ul li a,
:root[data-theme="dark"] .mean-container .mean-nav ul li a {
    text-transform: uppercase !important;
    color: #F0F6FC !important;
}

:root[data-theme="dark"] .main-menu ul li a:hover {
    color: var(--rr-wifly-primary3) !important;
}

:root[data-theme="dark"] .main-menu ul li.active a {
    color: var(--rr-wifly-primary3) !important;
}

/* SVG иконки в меню */
:root[data-theme="dark"] .main-menu ul li a svg {
    color: #F0F6FC !important;
    stroke: #F0F6FC !important;
}

:root[data-theme="dark"] .main-menu ul li a:hover svg {
    color: var(--rr-wifly-primary3) !important;
    stroke: var(--rr-wifly-primary3) !important;
}

/* Мобильное меню (гамбургер) в темной теме */
:root[data-theme="dark"] .offcanvas__area .mobile-menu ul li a,
:root[data-theme="dark"] .mobile-menu ul li a,
:root[data-theme="dark"] .mean-container .mean-nav ul li a {
    color: #F0F6FC !important;
}

:root[data-theme="dark"] .offcanvas__area .mobile-menu ul li a:hover,
:root[data-theme="dark"] .mobile-menu ul li a:hover,
:root[data-theme="dark"] .mean-container .mean-nav ul li a:hover {
    color: var(--rr-wifly-primary3) !important;
}

/* Языковое меню в мобильном меню */
:root[data-theme="dark"] .offcanvas__area .language-dropdown li a,
:root[data-theme="dark"] .mobile-menu .language-dropdown li a,
:root[data-theme="dark"] .mean-container .language-dropdown li a {
    color: #F0F6FC !important;
    background: transparent !important;
}

:root[data-theme="dark"] .offcanvas__area .language-dropdown li a:hover,
:root[data-theme="dark"] .mobile-menu .language-dropdown li a:hover,
:root[data-theme="dark"] .mean-container .language-dropdown li a:hover {
    color: #F0F6FC !important;
    background: linear-gradient(135deg, #6698d2 0%, #8dcaf0 100%) !important;
}

/* Иконки в мобильном меню */
:root[data-theme="dark"] .offcanvas__area svg,
:root[data-theme="dark"] .mobile-menu svg,
:root[data-theme="dark"] .mean-container svg {
    stroke: #F0F6FC !important;
    color: #F0F6FC !important;
}

:root[data-theme="dark"] .offcanvas-close-icon {
    color: #F0F6FC !important;
}

/* Mean menu специфичные стили */
:root[data-theme="dark"] .mean-nav {
    background: #161B22 !important;
}

:root[data-theme="dark"] .mean-nav ul li a.mean-expand {
    color: #F0F6FC !important;
    background: transparent !important;
}

:root[data-theme="dark"] .mean-nav ul li a.mean-expand:hover {
    background: rgba(240, 246, 252, 0.1) !important;
}

/* Разделители в мобильном меню */
:root[data-theme="dark"] .mobile-menu ul li,
:root[data-theme="dark"] .mean-nav ul li {
    border-color: rgba(240, 246, 252, 0.1) !important;
}


/* Замена иконок услуг в темной теме */
:root[data-theme="dark"] .thinking-ai-6__icon img[src*="b-class.png"] {
    content: url("../imgs/functions/b-class-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="map.png"] {
    content: url("../imgs/functions/map-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="shop.png"] {
    content: url("../imgs/functions/shop-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="chat.png"] {
    content: url("../imgs/functions/chat2-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="seat.png"] {
    content: url("../imgs/functions/seat-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="preorder.png"] {
    content: url("../imgs/functions/preorder2-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="play2.png"] {
    content: url("../imgs/functions/play2-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="headphones.png"] {
    content: url("../imgs/functions/headphones-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="kids.png"] {
    content: url("../imgs/functions/kids-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="games.png"] {
    content: url("../imgs/functions/games-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="music.png"] {
    content: url("../imgs/functions/music-dark.png");
}

:root[data-theme="dark"] .thinking-ai-6__icon img[src*="book.png"] {
    content: url("../imgs/functions/book-dark.png");
}

/* Форма обратной связи */
:root[data-theme="dark"] .contact-us__background:after {
    background: #1e2734;
}

/* :root[data-theme="dark"] .contact-us__form {
    background: #161B22;
    border: 1px solid rgba(240, 246, 252, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
} */
:root[data-theme="dark"] .contact-us__box {
    background: #0d1014;
}