/* ================= Стили для Да/Нет ================= */

/* Общие стили для обертки */
.yes-no-tool {
    padding: 1.5rem;
}

/* Стилизация выпадающего списка пресетов */
#preset-select {
    margin-bottom: 1rem;
}

/* Уменьшаем высоту поля textarea */
#question-input {
    height: auto;
    min-height: 60px; /* Примерно 2 строки */
    resize: vertical;
}

/* Область для результата и анимации */
.result-area {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    margin-bottom: 2rem; /* Отступ под сферой */
}

/* --- Стили для Сферы Предсказаний --- */
.sphere {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: var(--base-color);
    box-shadow: 10px 10px 20px var(--shadow-dark),
                -10px -10px 20px var(--shadow-light);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

/* Внутренняя тень */
.sphere::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border-radius: 50%;
    box-shadow: inset 5px 5px 10px var(--shadow-dark),
                inset -5px -5px 10px var(--shadow-light);
    z-index: 1;
}

/* --- Анимация "Думания" --- */
.sphere.thinking {
    animation: sphere-pulse 1.5s infinite ease-in-out;
}

/* Анимация пульсации */
@keyframes sphere-pulse {
    0%, 100% {
        box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
        transform: scale(1);
    }
    50% {
        box-shadow: 15px 15px 30px var(--shadow-dark), -15px -15px 30px var(--shadow-light);
        transform: scale(1.03);
    }
}

/* Эффект "тумана" */
.sphere.thinking::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(200,200,220,0.15) 30%, transparent 60%);
    animation: sphere-swirl 2s linear infinite;
    z-index: 2;
    opacity: 0.7;
}

/* Вращение "тумана" */
@keyframes sphere-swirl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Стили для Текста Ответа --- */
#result-text {
    font-family: 'Lato', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: transparent;
    text-align: center;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, color 0.5s ease;
}

/* Появление текста */
.sphere:not(.thinking) #result-text {
    opacity: 1;
    transform: scale(1);
}

/* Цвет "ДА" */
.sphere.result-yes #result-text {
    color: #4CAF50; /* Зеленый */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Цвет "НЕТ" */
.sphere.result-no #result-text {
    color: #F44336; /* Красный */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Адаптивность */
@media (max-width: 400px) {
    .sphere { width: 160px; height: 160px; }
    #result-text { font-size: 2.8rem; }
}

/* ========================================================
   === СТИЛИ ДЛЯ БЛОКА СТАТИСТИКИ (v3 - "Аккордеон") ===
   ======================================================== */
.stats-block {
    margin-top: 0px; 
    padding: 0;
    text-align: center;
    color: var(--text-color-secondary);
}

.stats-title-toggle {
    cursor: pointer;
    padding: 1rem 1.25rem;
    margin: 0;
    text-align: center; 
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
    transition: color 0.2s ease; 
}

.stats-title-toggle:hover {
    color: var(--accent-color); 
}

/* === Блок с контентом (скрытый/открытый) === */
.stats-content {
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.3s ease-out; 
    padding-left: 0px;
    padding-right: 0px;
}

/* --- Открытое состояние --- */
.stats-block.open .stats-content {
    max-height: 300px; 
    padding: 0 0px 1rem 0px; 
}

/* === Контейнер для бара и подписей === */
.stats-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding-top: 1rem; 
    border-top: 1px solid var(--shadow-dark);
}

/* Текст "Да (0%)" */
.stats-label-yes {
    font-size: 0.9rem;
    font-weight: bold;
    color: #4CAF50;
    white-space: nowrap;
}

/* Текст "Нет (0%)" */
.stats-label-no {
    font-size: 0.9rem;
    font-weight: bold;
    color: #F44336;
    white-space: nowrap;
}

/* Дополнительные классы цветов, если используются */
.text-green { color: #4CAF50; }
.text-red { color: #F44336; }

/* "Трек" */
.stats-bar-track {
    position: relative; /* Важно для слайдера */
    flex-grow: 1;
    height: 24px;
    background-color: var(--base-color-depressed);
    border-radius: 12px;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), 
                inset -2px -2px 4px var(--shadow-light);
    display: flex; /* Обязательно flex для order */
    overflow: visible; /* Чтобы смайлик мог выступать */
    align-items: center;
}

/* --- ЖЕЛЕЗНЫЕ ПРАВИЛА (Смайлик на стыке) --- */

/* Зеленая полоска (ДА) - Всегда СЛЕВА */
.stats-bar-fill-yes {
    background-color: #4CAF50;
    height: 100%;
    order: 1; /* Первое место */
    border-radius: 12px 0 0 12px; /* Закругляем левый край */
    transition: width 0.5s ease; /* <--- ВОТ ЭТО ВЕРНУЛО ПЛАВНОСТЬ */
}

/* Красная полоска (НЕТ) - Всегда СПРАВА */
.stats-bar-fill-no {
    background-color: #F44336;
    height: 100%;
    order: 2; /* Второе место */
    border-radius: 0 12px 12px 0; /* Закругляем правый край */
    transition: width 0.5s ease; /* <--- И ВОТ ЭТО ТОЖЕ */
}

/* --- Бегунок (Смайлик) --- */
#stats-slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%); 
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--base-color);
    box-shadow: 3px 3px 6px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    z-index: 10;
    transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease; 
    cursor: default;
    user-select: none;
    border: 2px solid transparent; 
}

/* Иконки по бокам */
.stats-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin: 0 4px; 
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.1));
}

#icon-left { margin-right: 0px; }
#icon-right { margin-left: 0px; }

/* Общий счетчик и кнопка сброса */
.stats-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}

.stats-total-text {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}

.stats-total-text span {
    font-weight: bold;
    color: var(--text-color);
}

/* Кнопка сброса */
#stats-reset-button {
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-color-secondary);
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
#stats-reset-button:hover { opacity: 1; }
#stats-reset-button:active {
    color: var(--accent-color);
    box-shadow: none;
    background-color: transparent;
}

/* --- Анимации слайдера --- */
.pop-effect { animation: pop-emoji 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes pop-emoji {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.4); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.pulse-glow { animation: pulse-red 1.5s infinite; border-color: #ff4d4d; }
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

.shake-bad { animation: shake-blue 0.5s infinite; border-color: #4CAF50; }
@keyframes shake-blue {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-52%, -50%) rotate(-5deg); }
    75% { transform: translate(-48%, -50%) rotate(5deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

/* ========================================================
   === СТИЛИ ДЛЯ FAQ-АККОРДЕОНА ===
   ======================================================== */
.faq-section .faq-item {
    background-color: var(--base-color);
    border-radius: 12px;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transition: all 0.15s ease-in-out;
}

.faq-section .faq-item h3.faq-question-title,
.faq-section .faq-item h3[itemprop="name"] {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin: 0;
    text-align: left;
    font-size: 1.1rem;
    color: var(--text-color);
}

.faq-section .faq-item h3.faq-question-title::after,
.faq-section .faq-item h3[itemprop="name"]::after {
    content: ' ▼';
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    display: inline-block;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-section .faq-item.open {
    background-color: var(--base-color-depressed);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.faq-section .faq-item.open h3.faq-question-title,
.faq-section .faq-item.open h3[itemprop="name"] {
    color: var(--accent-color);
    padding-bottom: 1rem;
}

.faq-section .faq-item.open h3.faq-question-title::after,
.faq-section .faq-item.open h3[itemprop="name"]::after {
    transform: rotate(180deg);
}

.faq-section .faq-item > div,
.faq-section .faq-item div[itemprop="acceptedAnswer"] {
    display: none;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.faq-section .faq-item.open > div,
.faq-section .faq-item.open div[itemprop="acceptedAnswer"] {
    display: block;
    padding-top: 1rem;
    border-top: 1px solid var(--shadow-dark);
}

.text-content-block h2,
.text-content-block h3 {
    text-align: center;
}

/* === МОБИЛЬНАЯ АДАПТАЦИЯ === */
@media (max-width: 480px) {
    .stats-percent {
        display: none;
    }
}