/* --- Общие стили --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.main-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 20px 30px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-sizing: border-box;
}

h1, h2 {
    color: #1c1e21;
}

p {
    line-height: 1.6;
    text-align: left;
    white-space: pre-wrap; /* Сохраняет переносы строк в описаниях */
}

/* --- Стили кнопок --- */
button {
    background-color: #1877f2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 20px;
    margin: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: #166fe5;
}

button:active {
    transform: scale(0.98);
}

.back-button, button.secondary {
    background-color: #e4e6eb;
    color: #050505;
}

.back-button:hover, button.secondary:hover {
    background-color: #d8dadf;
}

#language-buttons button {
    min-width: 120px;
}

/* --- Стили для ввода и QR --- */
input[type="text"] {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dddfe2;
    font-size: 16px;
    margin-bottom: 10px;
    width: calc(100% - 24px); /* Учитываем padding */
    max-width: 300px;
}

#qr-reader {
    border: 1px solid #ccc;
    border-radius: 8px;
    margin: 20px auto;
    overflow: hidden; /* Скрывает углы камеры, выходящие за рамки */
}

#manual-tour-input {
    margin-top: 20px;
}

/* --- Стили экрана тура --- */
.tour-cover-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

#tour-controls {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Стили для "Индивидуального тура" --- */
.video-container {
    width: 100%;
    margin-bottom: 15px;
}

.video-container.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: white;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-left: -30px; /* Компенсируем padding родителя */
    margin-right: -30px; /* Компенсируем padding родителя */
    width: calc(100% + 60px); /* Растягиваем на всю ширину */
}

.video-player {
    width: 100%;
    border-radius: 0; /* Убираем скругление у "липкого" видео */
    background-color: black;
}

#audio-player-container {
    margin-top: 20px;
}

#audio-player-container audio {
    width: 100%;
}
/* --- Стили для админ-панели --- */
.admin-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}
#codes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
#codes-table th, #codes-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
#codes-table th {
    background-color: #f2f2f2;
}
.status-used {
    color: red;
    font-weight: bold;
}
.status-active {
    color: green;
    font-weight: bold;
}
#codes-table button {
    font-size: 12px;
    padding: 5px 10px;
    margin: 2px;
}
button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
/* =========================================
   СТИЛИ ДЛЯ Q&A (ВОПРОС-ОТВЕТ) - Усиленная версия
   ========================================= */

/* =========================================
   СТИЛИ ДЛЯ Q&A (ВСТРОЕННЫЙ UI)
   ========================================= */

#qa-status-indicator {
    position: fixed; /* Фиксируем относительно окна браузера */
    bottom: 70px; /* Отступ снизу, чтобы было над кнопками управления */
    left: 50%; /* Центрируем по горизонтали */
    transform: translateX(-50%); /* Точная центровка */
    background-color: rgba(0, 0, 0, 0.8); /* Полупрозрачный темный фон */
    color: white; /* Белый текст */
    padding: 10px 20px; /* Внутренние отступы */
    border-radius: 20px; /* Скругленные углы */
    font-size: 1em; /* Размер шрифта */
    z-index: 10; /* Поверх основного контента, но ниже модальных окон (если будут) */
    opacity: 0; /* Изначально невидим */
    transition: opacity 0.3s ease-in-out; /* Плавное появление/исчезание */
    pointer-events: none; /* Не мешает кликам по элементам под ним */
    white-space: nowrap; /* Чтобы текст не переносился */
}

/* Класс для отображения индикатора */
#qa-status-indicator.visible {
    opacity: 1; /* Делаем видимым */
    pointer-events: auto; /* Позволяем кликнуть на него (для отмены) */
}

/* Анимация пульсации для состояния "Слушаю..." */
@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Класс для добавления анимации */
#qa-status-indicator.listening {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Стиль для body, чтобы предотвратить прокрутку фона (убран) */
/* body.qa-active больше не нужен, так как индикатор не мешает */