/* app/static/css/ui/theme-switcher.css */
/* Стили переключателя темы */

.theme-switcher {
    display: inline-flex;
    align-items: center;
}

.btn-color-mode-switch {
    display: inline-block;
    margin: 0;
    position: relative;
}

.btn-color-mode-switch > .btn-color-mode-switch-inner {
    margin: 0;
    width: 45px; /* Уменьшили ширину с 50px до 45px */
    height: 20px;
    background: #a9a9a9;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid #4b4b4b;
    display: block;
    cursor: pointer;
}

/* Эффект при наведении */
.btn-color-mode-switch > .btn-color-mode-switch-inner:hover {
    box-shadow: 0 0 0 1px #7a7a7a;
}

/* Иконки слева и справа */
.btn-color-mode-switch > .btn-color-mode-switch-inner::before,
.btn-color-mode-switch > .btn-color-mode-switch-inner::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
    z-index: 1;
}

/* Иконка солнца справа - видна в светлой теме (бегунок слева) */
[data-theme="light"] .btn-color-mode-switch > .btn-color-mode-switch-inner::after {
    right: 7px; /* Отрегулировали под новую ширину */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234b4b4b'%3E%3Cpath d='M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .btn-color-mode-switch > .btn-color-mode-switch-inner::after {
    display: none;
}

/* Иконка луны слева - видна в темной теме (бегунок справа) */
[data-theme="dark"] .btn-color-mode-switch > .btn-color-mode-switch-inner::before {
    left: 7px; /* Отрегулировали под новую ширину */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238b8b8b'%3E%3Cpath d='M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z'/%3E%3C/svg%3E");
}

[data-theme="light"] .btn-color-mode-switch > .btn-color-mode-switch-inner::before {
    display: none;
}

/* Бегунок */
.btn-color-mode-switch .switch-slider {
    position: absolute;
    left: 4px; /* Отступ от левой границы */
    top: 4px; /* Отступ от верхней границы */
    width: 8px;
    height: 8px;
    background: #a9a9a9;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 2px solid #4b4b4b;
    box-sizing: border-box;
    z-index: 2;
}

/* Темная тема активна */
[data-theme="dark"] .btn-color-mode-switch > .btn-color-mode-switch-inner {
    background: #212529;
    border-color: #8b8b8b;
}

[data-theme="dark"] .btn-color-mode-switch .switch-slider {
    /* 45px (новая ширина) - 8px (ширина слайдера) - 4px (левый отступ) - 4px (отступ справа) = 29px */
    left: 29px;
    background: #212529;
    border-color: #8b8b8b;
}

/* Убираем стандартные эффекты фокуса */
.btn-color-mode-switch > .btn-color-mode-switch-inner:focus {
    outline: none;
}