/* /tools/anagram/style.css */

.text-center { text-align: center; }

/* === 1. НОВЫЙ ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМОВ (TABS) === */
.mode-switcher-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.toggle-switch {
    position: relative;
    display: flex;
    background-color: var(--base-color); /* ИСПОЛЬЗУЕМ ПЕРЕМЕННУЮ */
    border-radius: 30px;
    padding: 4px;
    /* Тени через переменные */
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    user-select: none;
}

.toggle-switch input[type="radio"] {
    display: none;
}

.toggle-option {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 40px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color-secondary); /* Цвет текста через переменную */
    transition: color 0.3s ease;
    border-radius: 25px;
}

/* Бегающая синяя плашка */
.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 120px;
    height: 40px;
    background-color: var(--accent-color); /* Синий цвет из переменной */
    border-radius: 25px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1;
    /* Тень плашки - чуть мягче в темной теме */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* === ЛОГИКА ПЕРЕКЛЮЧЕНИЯ === */

#mode-solve:checked ~ .toggle-slider {
    transform: translateX(0);
}
#mode-solve:checked + label {
    color: #fff; /* На синем фоне текст всегда белый */
}

#mode-create:checked ~ .toggle-slider {
    transform: translateX(100%);
}
#mode-create:checked + label {
    color: #fff; /* На синем фоне текст всегда белый */
}


/* === 2. ОПЦИИ (ЧЕКБОКС) === */
.options-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: opacity 0.3s ease;
}

.options-container.hidden {
    display: none;
}

.neumorphic-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-color-secondary); /* Текст чекбокса */
}

.neumorphic-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Квадратик чекбокса */
.checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background-color: var(--base-color); /* Фон квадратика */
    border-radius: 6px;
    margin-right: 10px;
    /* Вдавленные тени через переменные */
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    transition: all 0.2s ease;
}

/* Галочка */
.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.neumorphic-checkbox:hover input ~ .checkmark {
    /* Небольшое затемнение при наведении (через фильтр работает везде) */
    filter: brightness(0.95); 
}

/* Включенное состояние */
.neumorphic-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-color);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.2);
}

.neumorphic-checkbox input:checked ~ .checkmark::after {
    display: block;
}


/* === 3. БЛОК РЕЗУЛЬТАТОВ === */
#results-container {
    margin-top: 2rem;
    display: none; 
}

.results-summary {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-color); /* Основной цвет текста */
}

.result-group { margin-bottom: 2rem; }

.group-title {
    font-size: 1rem;
    color: var(--text-color-secondary);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent-color);
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center; 
}

/* КНОПКИ СО СЛОВАМИ */
.word-chip {
    padding: 0.6rem 1.2rem;
    background-color: var(--base-color); /* Фон кнопки */
    border-radius: 20px;
    font-weight: bold;
    color: var(--text-color); /* Цвет текста слова */
    font-size: 1.1rem;
    /* Тени через переменные (авто-адаптация к темной теме) */
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.word-chip:active {
    transform: scale(0.96);
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.word-chip.copied {
    background-color: #2ecc71 !important;
    color: #fff !important;
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2);
}

/* === ВСПОМОГАТЕЛЬНЫЕ ЭЛЕМЕНТЫ === */
.error-msg {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
    font-weight: bold;
}

#loading-indicator {
    display: none;
    text-align: center;
    margin-top: 1rem;
    color: var(--text-color-secondary);
    font-style: italic;
}

.loading-search {
    text-align: center;
    color: var(--text-color-secondary);
    font-style: italic;
    padding: 2rem;
}
/* === TOAST NOTIFICATION (Всплывашка) === */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--base-color); /* Адаптив под тему */
    color: var(--text-color);
    text-align: center;
    border-radius: 50px; /* Закругленная пилюля */
    padding: 12px 20px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: bold;
    
    /* Неоморфный стиль для всплывашки */
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    border: 1px solid rgba(255,255,255,0.1);
    
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px; /* Небольшая анимация всплытия */
}