/*********** Общие стили для страницы генерации поста ***********/

/* Контейнер формы */
.ai-content-wizard-form-container textarea {
    width: 100%; /* Полная ширина контейнера */
    padding: 8px; /* Уменьшено с 10px */
    margin-bottom: 12px; /* Уменьшено с 15px */
    font-size: 14px; /* Уменьшено с 16px */
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    max-width: 100%;
    height: auto;
    resize: vertical;
    line-height: 1.6; /* Уменьшено с 2 */
    min-height: 50px; /* Уменьшено с 60px */
}

/******* Стили попапа в одиночной генерации*******/
h2#generating_content_text {
    font-size: 18px; /* Уменьшено с 18px */
    line-height: 20px; /* Уменьшено с 22px */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Уменьшено размытие */
    transition: all 0.3s ease;
    color: #fffa58;
}

#post_generation_buttons .button {
    padding: 8px 16px; /* Уменьшено с 10px 20px */
    font-size: 14px; /* Уменьшено с 16px */
    border: none;
    border-radius: 4px; /* Уменьшено с 5px */
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#view_post {
    background: linear-gradient(to right, #ffa726, #ff9800);
}

#view_post:hover {
    background: linear-gradient(to right, #ffb74d, #ff9800);
}

#generate_another_post {
    background: linear-gradient(to right, #fbc02d, #f57c00);
}

#generate_another_post:hover {
    background: linear-gradient(to right, #ffcc80, #f57c00);
}

/* Стили для иконок Dashicons */
#view_post:before {
    font-family: "Dashicons";
    content: "\f105";
    margin-right: 6px; /* Уменьшено с 8px */
    font-size: 16px; /* Добавлено для уменьшения размера */
}

#generate_another_post:before {
    font-family: "Dashicons";
    content: "\f463";
    margin-right: 6px; /* Уменьшено с 8px */
    font-size: 16px; /* Добавлено для уменьшения размера */
}

div#post_generation_buttons {
    padding-bottom: 16px; /* Уменьшено с 20px */
}

/* Общие стили для страницы генерации поста */
.ai-content-wizard-page-container {
    background: linear-gradient(135deg, #6ddb90 0%, #35a79c 100%);
    padding: 16px; /* Уменьшено с 20px */
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px; /* Уменьшено с 20px */
    margin-top: 16px; /* Уменьшено с 20px */
    margin-right: 16px; /* Уменьшено с 20px */
}

/* Стилизация контейнеров формы и настроек */
.ai-content-wizard-form-container,
.ai-content-wizard-settings-container {
    background-color: rgba(255, 255, 255, 0.25);
    padding: 16px; /* Уменьшено с 20px */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Стилизация формы */
.ai-content-wizard-form-container form#ai_content_wizard_form {
    display: flex;
    flex-direction: column;
}

/* Стилизация меток и полей ввода */
.ai-content-wizard-form-container label,
.ai-content-wizard-settings-container label {
    font-size: 16px; /* Уменьшено с 18px */
    line-height: 18px; /* Уменьшено с 20px */
    color: #000000;
    margin-bottom: 8px; /* Уменьшено с 10px */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Уменьшено размытие */
    font-weight: 400;
}

.ai-content-wizard-form-container input[type="text"],
.ai-content-wizard-form-container select,
.ai-content-wizard-settings-container .settings-display {
    width: 100%;
    padding: 6px; /* Уменьшено с 10px */
    margin-bottom: 12px; /* Уменьшено с 15px */
    font-size: 14px; /* Уменьшено с 16px */
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    max-width: 100%;
}

/* Стили для кнопок */
.ai-content-wizard-form-container input[type="submit"],
.ai-content-wizard-settings-container .button {
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px; /* Уменьшено с 10px 20px */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px; /* Уменьшено с 16px */
    font-weight: 700; /* Добавлено для более четкого отображения текста */
}

.ai-content-wizard-form-container input[type="submit"]:hover,
.ai-content-wizard-settings-container .button:hover {
    background-color: #45a049;
}

/* Стилизация для мобильных устройств */
@media (max-width: 768px) {
    .ai-content-wizard-page-container {
        grid-template-columns: 1fr;
    }

    .ai-content-wizard-form-container,
    .ai-content-wizard-settings-container {
        width: 100%;
        max-width: 100%;
    }
}

.ai-content-wizard-settings-container h2 {
    color: #fff;
    font-size: 20px; /* Уменьшено с 24px */
    line-height: 22px; /* Уменьшено с 26px */
    margin-bottom: 16px; /* Уменьшено с 20px */
    text-align: left;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Уменьшено размытие */
}

/* Дополнительные стили для отображения настроек */
.settings-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    flex-direction: column;
    width: 97% !important; /* Уменьшено с 96% */
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px; /* Уменьшено с 15px */
    background-color: #f7f7f7;
    padding: 4px 8px; /* Уменьшено с 5px 10px */
    border-radius: 4px;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.setting-item .setting-name {
    flex-grow: 1;
    font-weight: bold;
    font-size: 16px; /* Уменьшено с 18px */
}

.edit-setting-link {
    padding-left: 8px; /* Уменьшено с 10px */
    font-size: 12px; /* Уменьшено с 14px */
    color: #147a18;
    text-decoration: none;
    white-space: nowrap;
}

.edit-setting-link:hover {
    text-decoration: underline;
}











/*****************************************************************/
/* --- Основной фон в режиме Longread --- */
.ai-content-wizard-page-container.longread-mode {
    /* Новый огненный градиент */
    background: linear-gradient(135deg, #FF4500, #FFA500);
    animation: flameFlicker 3s infinite;
    transition: background 0.5s ease;
}

/* Новая анимация «flameFlicker» с эффектом мерцания пламени */
@keyframes flameFlicker {
    0% { filter: brightness(1); }
    25% { filter: brightness(1.25); }
    50% { filter: brightness(1.1); }
    75% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

/* --- Стили для переключателя --- */
.mode-toggle {
    grid-column: 1 / -1; /* Занимает всю ширину грид-строки */
    text-align: center;
    margin-bottom: 20px;
}

.mode-toggle .toggle-wrapper {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3); /* Более контрастный фон для читаемости текста */
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mode-toggle .toggle-label {
    font-size: 16px;
    /* Изменён цвет шрифта для лучшей читаемости */
    color: #fff;
    margin: 0 10px;
    position: relative;
    cursor: help;
}

/* Подсказка (tooltip) для меток */
.mode-toggle .toggle-label::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.mode-toggle .toggle-label:hover::after {
    opacity: 1;
}

/* --- Стили переключателя (switch) --- */
.mode-toggle .switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.mode-toggle .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Новый градиент для стандартного состояния */
    background: linear-gradient(135deg, #1E90FF, #00BFFF);
    transition: background 0.4s, box-shadow 0.4s;
    border-radius: 30px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.mode-toggle .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: transform 0.4s, background-color 0.4s;
    border-radius: 50%;
}

.mode-toggle .switch input:checked + .slider {
    /* Новый градиент при включённом состоянии */
    background: linear-gradient(135deg, #FF6347, #FF8C00);
    box-shadow: 0 0 12px rgba(255, 99, 71, 0.7);
}

.mode-toggle .switch input:checked + .slider:before {
    transform: translateX(30px);
}

/* --- Стили для внутренних блоков (форма и настройки) --- */
/* Оставляем прозрачную белую подложку, как в стандартном режиме */
.ai-content-wizard-form-container,
.ai-content-wizard-settings-container {
    background-color: rgba(255, 255, 255, 0.25);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.unsupported-message {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 69, 0, 0.8); /* полупрозрачный оранжево-красный фон */
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.unsupported-message .dashicons {
    margin-right: 4px;
    font-size: 16px; /* подгоним размер иконки */
    vertical-align: middle;
}






/* Стили для popup, объясняющего отсутствие Longread Mode */
#longread-mode-popup {
    position: fixed;
    z-index: 99999;
    top: 50%;
    left: 50%;
    width: 420px; /* Можно подогнать под себя */
    max-width: 90%;
    background: #ffffff;
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 16px;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    text-align: left;
    color: #333;
}

#longread-mode-popup h2 {
    margin-top: 0;
    font-size: 18px;
    color: #ff4500; /* оранжево-красный заголовок, подчёркивающий предупреждение */
}

#longread-mode-popup p {
    line-height: 1.4;
}

.longread-info-icon {
    margin-left: 6px;
    vertical-align: middle;
}



/* Styles for Longread Custom Settings */
#longread_custom_settings {
    background-color: rgba(255, 255, 255, 0.25);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#longread_custom_settings h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #000;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
#longread_custom_settings label {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
    color: #000;
}
#longread_custom_settings input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
}
#longread_custom_settings span {
    font-size: 14px;
    color: #333;
    margin-left: 4px;
}

/* Longread Preloader Custom Styles */
#preload-longread h2 {
    font-size: 20px;
    color: #FFFFFF;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
#preload-longread .ai-loader .ai-dot {
    /* Можно задать иной цвет или анимацию для longread режима */
    background-color: #FFF;
}






/* Контейнер текущего этапа и индикатора прогресса */
#progress_stage_container {
    margin-bottom: 20px;
    text-align: center;
}

#progress_stage_container h3 {
    margin-bottom: 12px;
    color: #191919;
    font-size: 16px;
    font-weight: 500;
	text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Индикатор этапов */
#progress_bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    margin-top: 5px;
    background: #ffffff42;
    padding: 5px;
    border-radius: 12px;
}

/* Стиль для отдельного этапа */
#progress_bar .stage {
    position: relative;
    width: 40px; /* Размер блока */
    height: 40px;
    line-height: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease; /* Плавный переход для всех изменений */
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff; /* Белый цвет для иконок по умолчанию */
}

/* Иконка между подсказкой и шагом */
#progress_bar .tooltip-icon {
    position: absolute;
    top: -15px; /* Располагаем иконку над блоком */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: none; /* Скрыта по умолчанию, показываем при наведении */
}

/* Показываем иконку при наведении на шаг */
#progress_bar .stage:hover .tooltip-icon {
    display: block;
}

/* Разделитель между этапами – всегда видим */
#progress_bar .stage:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -15px; /* Размещаем в зоне gap */
    width: 15px;
    height: 2px;
    background-color: #e0e0e0;
    transform: translateY(-50%);
    transition: background-color 0.3s ease;
    z-index: 1;
}

/* Для завершённых этапов меняем цвет разделителя */
#progress_bar .stage.completed:not(:last-child)::after {
    background-color: #34c759;
}

/* Для текущего этапа разделитель – синим */
#progress_bar .stage.current:not(:last-child)::after {
    background-color: #007aff;
}

/* Оформление этапов, которые ещё не обработаны (pending) */
#progress_bar .stage.pending {
    background: linear-gradient(135deg, #d0d0d0, #e8e8e8); /* Мягкий серый градиент */
    color: #666; /* Темно-серый для иконок */
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 1px 3px rgba(0, 0, 0, 0.1); /* Легкий глянец */
}

/* Оформление текущего этапа (current) */
#progress_bar .stage.current {
    background: linear-gradient(135deg, #007aff, #00b4ff); /* Яркий синий градиент */
    color: #fff; /* Белый для иконок */
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 122, 255, 0.3); /* Глянец и тень */
}

/* Оформление завершённых этапов (completed) */
#progress_bar .stage.completed {
    background: linear-gradient(135deg, #34c759, #5ad77b); /* Зеленый градиент */
    color: #fff; /* Белый для иконок */
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 2px 4px rgba(52, 199, 89, 0.3); /* Глянец и тень */
}

/* Эффект при наведении на любой этап */
#progress_bar .stage:hover {
    transform: scale(1.05); /* Легкое увеличение */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.5); /* Усиленная тень и глянец */
}

/* Специфичный hover для каждого статуса */
#progress_bar .stage.pending:hover {
    background: linear-gradient(135deg, #c0c0c0, #dcdcdc); /* Чуть ярче серый */
}

#progress_bar .stage.current:hover {
    background: linear-gradient(135deg, #0066cc, #0099ff); /* Чуть темнее и насыщеннее */
}

#progress_bar .stage.completed:hover {
    background: linear-gradient(135deg, #2db34a, #4cc768); /* Чуть темнее зеленый */
}

/* Подсказка при наведении без стрелочки */
#progress_bar .stage:hover::before {
    content: attr(data-tooltip); /* Убрана стрелочка */
    position: absolute;
    top: -45px; /* Увеличиваем высоту расположения подсказки */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px; /* Увеличиваем padding для большей высоты подсказки */
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
}



/* Style the container to center the buttons and add spacing */
#post_generation_buttons_longread {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Common styles for both buttons */
#view_post_longread, #generate_another_post_longread {
    color: white;
    border: 1px solid;
    border-radius: 5px;
    padding: 2px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Specific styles for the "View Post" button (anchor tag) */
#view_post_longread {
    background: linear-gradient(135deg, #FF4500, #FFA500);
    text-decoration: none;
}

/* Specific styles for the "Generate Another" button */
#generate_another_post_longread {
    background: linear-gradient(135deg, #FFA500, #FF4500);
}

/* Hover effects for both buttons */
#view_post_longread:hover, #generate_another_post_longread:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: scale(1.05);
}


div#tips_longread {
    color: #ffe200;
    font-style: italic;
    margin-bottom: 2px;
    font-size: 16px;
    padding-bottom: 5px;
    padding-top: 5px;
    line-height: 1.1;
}



/* Стили для блока описания настроек */
.settings-description {
    background-color: rgba(255, 255, 255, 0.25);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 16px;
    line-height: 1.4;
}

/* Стили для текста обычного режима */
.settings-description p#normal_description {
    margin: 0 0 10px;
}

/* Стили для текста longread режима */
.settings-description p#longread_description {
    margin: 0;
}

/* Стили для ссылок, если они будут внутри описания */
.settings-description a {
    color: #007aff;
    text-decoration: none;
}

.settings-description a:hover {
    text-decoration: underline;
}

div#generation_timer {
    margin-bottom: 10px;
}




/****************************/
/* Custom styles for sliders (input[type="range"]) in Longread Settings */
#longread_options input[type="range"] {
    -webkit-appearance: none; /* Remove default browser styling */
    width: 100%;
    height: 8px; /* Thin track */
    margin-bottom: 10px;
    background: #ff8c00; /* Orange track color */
    border-radius: 4px; /* Rounded corners */
    outline: none; /* Remove outline */
}

#longread_options input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; /* Larger thumb for better interaction */
    height: 20px;
    background: #fff; /* White thumb */
    border-radius: 50%; /* Circular thumb */
    border: 2px solid #ff8c00; /* Orange border for thumb */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

#longread_options input[type="range"]::-webkit-slider-thumb:hover {
    background: #ffe0b2; /* Lighter orange on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

#longread_options input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid #ff8c00;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#longread_options input[type="range"]::-moz-range-thumb:hover {
    background: #ffe0b2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#longread_options input[type="range"]::-moz-range-track {
    background: #ff8c00;
    border-radius: 4px;
    height: 8px;
}

#longread_options label[for="include_youtube_video"] {
    position: relative;
    padding-left: 30px; /* Space for custom checkbox */
    cursor: pointer;
    font-size: 16px;
    color: #000;
    line-height: 20px;
}

#longread_options label[for="include_youtube_video"]:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px; /* Size of the custom checkbox */
    height: 20px;
    background: #fff; /* White background */
    border: 2px solid #ff8c00; /* Orange border */
    border-radius: 4px; /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

#longread_options input[type="checkbox"]:checked + label[for="include_youtube_video"]:before {
    background: #ff8c00; /* Orange when checked */
    border-color: #ff8c00;
}

#longread_options label[for="include_youtube_video"]:after {
    content: "\2713"; /* Checkmark unicode */
    position: absolute;
    left: 5px;
    top: -2px;
    font-size: 16px;
    color: #fff; /* White checkmark */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

#longread_options input[type="checkbox"]:checked + label[for="include_youtube_video"]:after {
    opacity: 1; /* Show checkmark when checked */
}

#longread_options label[for="include_youtube_video"]:hover:before {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

/* Ensure output spans (for slider values) match the design */
#longread_options span#text_length_output,
#longread_options span#images_count_output,
#longread_options span#videos_count_output {
    font-size: 14px;
    color: #333;
    margin-left: 10px;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}