/* Контейнер меню */
.menu-container {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    height: 100vh;
    display: flex;
    align-items: flex-start; /* Изменено с center на flex-start */
    padding-top: 40px; /* Добавлен отступ сверху */
}

/* Кнопка-переключатель - УБРАНА БЕЛАЯ ПОЛОСА */
.menu-toggle {
    position: absolute;
    right: 0;
    top: 40px; /* Позиционируем от верха контейнера */
    transform: translateY(0); /* Убрали transform */
    width: 130px;
    height: 60px;
    background-color: #1a1a1a;
    border: 2px solid #333;
    border-right: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}


.menu-icon {
    position: absolute;
    left: 20px;
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}

.close-icon {
    opacity: 0;
}

/* Выдвижная панель - НАЧИНАЕТСЯ ОТ КНОПКИ */
.menu-slide {
    position: absolute;
    right: -496px;
    top: 100px; /* Начинается от кнопки меню */
    width: 496px;
    height: calc(100% - 100px); /* Высота минус отступ сверху */
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-left: 2px solid #333;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.menu-container.menu-open .menu-slide {
    right: 0;
}

.menu-container.menu-open .menu-toggle {
    width: 496px;
}

.menu-container.menu-open .burger-icon {
    opacity: 0;
}

.menu-container.menu-open .close-icon {
    opacity: 1;
}

/* Навигация в меню */
.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Убрали margin-top: 60px; - теперь меню начинается с кнопок */
}

.menu-nav-item {
    background: none;
    border: none;
    color: white;
    font-family: 'Georgia', serif;
    font-size: 1.5rem; /* 24px */
    text-align: left;
    padding: 12px 0;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
    position: relative;
}

.menu-nav-item:hover {
    color: #ccc;
}

.menu-nav-item:active {
    color: #aaa;
    transition-duration: 0.1s;
}

/* Панель настроек */
.settings-panel {
    display: none;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px; /* Отступ от кнопки настроек */
}

.menu-container.settings-open .settings-panel {
    display: flex;
}

.menu-container.settings-open .menu-nav {
    display: flex;
    flex-direction: column;
}

/* Кнопка "Скачать артбук" теперь всегда видна */
.menu-nav-item:last-child {
    margin-top: auto; /* Прижимаем к низу */
    padding-top: 20px;
    border-top: 1px solid #333;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-title {
    font-size: 1.5rem; /* 24px */
    font-weight: normal;
    color: #fff;
}

/* Слайдер размера текста */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 6px;
    background-color: #333;
    border-radius: 3px;
    cursor: pointer;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    z-index: 2;
    transition: left 0.2s ease;
}

.slider-marker {
    position: absolute;
    top: 50%;
    width: 2px;
    height: 10px;
    background-color: #666;
    transform: translateY(-50%);
}

.slider-marker[data-value="1"] { left: 0; }
.slider-marker[data-value="2"] { left: 50%; }
.slider-marker[data-value="3"] { left: 100%; }

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #999;
}

/* Превью текста */
.text-preview {
    background-color: #222;
    padding: 20px;
    border-radius: 4px;
}

.preview-title {
    font-size: 2.5rem; /* 40px - состояние по умолчанию (2) */
    margin-bottom: 15px;
    color: #fff;
}

.preview-text {
    font-size: 1.25rem; /* 20px - состояние по умолчанию (2) */
    line-height: 1.5;
    color: #ccc;
}

/* Переключатель звука */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-label {
    font-size: 1.5rem; /* 24px */
    color: #fff;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4CAF50;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Адаптивность меню */
@media (max-width: 768px) {
    .menu-container {
        padding-top: 20px; /* Меньший отступ на мобильных */
    }
    
    .menu-toggle {
        width: 100px;
        height: 50px;
        top: 20px; /* Соответственно отступу контейнера */
    }
    
    .menu-slide {
        width: 100vw;
        right: -100vw;
        top: 20px;
        height: calc(100% - 20px);
    }
    
    .menu-container.menu-open .menu-toggle {
        width: 100vw;
    }
    
    .preview-title {
        font-size: 2rem;
    }
    
    .preview-text {
        font-size: 1rem;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .menu-container {
        padding-top: 10px;
    }
    
    .menu-toggle {
        width: 80px;
        height: 40px;
        top: 10px;
    }
    
    .menu-slide {
        top: 10px;
        height: calc(100% - 10px);
        padding: 20px;
    }
    
    .menu-icon {
        left: 15px;
        width: 18px;
        height: 18px;
    }
}

/* Стили для футера с кнопкой скачивания */
.settings-footer {
    display: none;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.settings-footer .menu-nav-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: white;
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    padding: 12px 0;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease;
}

.settings-footer .menu-nav-item:hover {
    color: #ccc;
}

.settings-footer .menu-nav-item:active {
    color: #aaa;
    transition-duration: 0.1s;
}