/* ПЕРЕКЛЮЧАТЕЛЬ ТЕМ - ВЫРАВНИВАНИЕ ПО ВЕРХНЕМУ КРАЮ ХЕДЕРА */
/* МАКСИМАЛЬНО ВЫСОКОЕ ПОЛОЖЕНИЕ */

.theme-switch-container {
    display: inline-flex;
    align-items: flex-start !important;
    background: #f0f0f0;
    border-radius: 100px;
    padding: 0px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    font-size: 12px;
    vertical-align: top !important;
    margin-top: -5% !important;
    transform: translateY(0) !important;
    margin-bottom: 0 !important;
    top: auto !important;
}

/* Светлая тема */
.theme-switch-container.light-theme {
    background: #f0f0f0;
    border: 1px solid #ddd;
}

/* Темная тема */
.theme-switch-container.dark-theme {
    background: #2a2a2a;
    border: 1px solid #444;
}

.theme-switch-btn {
    display: inline-flex;
    align-items: flex-start !important;
    justify-content: center;
    padding: 8px 0px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    min-width: 70px;
    border: none;
    outline: none;
    background: transparent;
    white-space: nowrap;
    vertical-align: top !important;
}

.theme-switch-btn.light {
    color: #666;
}

.theme-switch-btn.dark {
    color: #999;
}

.theme-switch-btn.active {
    color: #fff;
    background: #4a90e2;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.theme-switch-btn:not(.active):hover {
    opacity: 0.8;
}

/* Анимированный индикатор */
.theme-switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: #4a90e2;
    border-radius: 100px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
    z-index: 1;
}

.theme-switch-container.dark-theme .theme-switch-slider {
    transform: translateX(calc(100% + 4px));
}

/* Иконки - выравнивание по верху */
.theme-switch-icon {
    width: 14px;
    height: 14px;
    margin-right: 0px;
    opacity: 0.9;
    flex-shrink: 0;
    display: inline-flex;
    align-items: flex-start !important;
    justify-content: center;
    vertical-align: top !important;
}

.theme-switch-btn.active .theme-switch-icon {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .theme-switch-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .theme-switch-icon {
        width: 14px;
        height: 14px;
        margin-right: 3px;
    }
    
    .theme-switch-container {
        font-size: 11px;
    }
}

/* Светлая тема - активная кнопка */
.theme-switch-container.light-theme .theme-switch-btn.active {
    background: #4a90e2;
    color: #fff;
}

/* Темная тема - активная кнопка */
.theme-switch-container.dark-theme .theme-switch-btn.active {
    background: #ff6b35;
    color: #fff;
}

.theme-switch-container.dark-theme .theme-switch-slider {
    background: #ff6b35;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

/* Темная тема - неактивные кнопки */
.theme-switch-container.dark-theme .theme-switch-btn:not(.active) {
    color: #ccc;
}

/* Фиксация иконок */
.theme-switch-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ПРИНУДИТЕЛЬНОЕ ВЫРАВНИВАНИЕ ПО ВЕРХУ */
.header-item .theme-switch-container {
    margin-top: -5% !important;
    transform: translateY(0);
    z-index: 1000;
}
