* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.assistant-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Видеоплеер */
.video-container {
    position: relative;
    width: 100%;
    height: 70vh; /* Гибкая высота - 70% высоты экрана */
    max-height: 900px;
    background: #000;
    overflow: hidden;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Вместится весь видео, не обрезаясь */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.video-player.active {
    opacity: 1;
}

.video-player.answering-transition {
    animation: answering-fade 0.2s ease-in-out;
}

@keyframes answering-fade {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Панель управления */
.control-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    flex-wrap: wrap;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.language-currency-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selector-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.selector-group select {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: #333;
    transition: all 0.3s;
}

.selector-group select:hover {
    border-color: #764ba2;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.selector-group select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-mic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-text {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-load {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    margin-top: 15px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #673a8e 100%);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 10px;
    color: #333;
}

.modal-content p {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.input-field,
.textarea-field {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-field:focus,
.textarea-field:focus {
    outline: none;
    border-color: #667eea;
}

.textarea-field {
    resize: vertical;
    min-height: 100px;
}

/* Информационная панель */
.info-panel {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.status {
    padding: 10px 15px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    color: #0066cc;
    margin-bottom: 15px;
    font-weight: 500;
}

.status.loading {
    background: #fff4e6;
    border-left-color: #ff9800;
    color: #ff6f00;
}

.status.error {
    background: #ffebee;
    border-left-color: #f44336;
    color: #d32f2f;
}

.status.success {
    background: #e8f5e9;
    border-left-color: #4caf50;
    color: #2e7d32;
}

.product-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.product-info p {
    margin: 5px 0;
}

.transcript {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid #764ba2;
}

.transcript strong {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #333;
}

.transcript strong:first-child {
    margin-top: 0;
}

.transcript p {
    margin: 0;
    padding-left: 15px;
    color: #666;
    font-style: italic;
}

/* Индикатор состояния */
.state-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

.state-label {
    font-weight: 600;
    color: #764ba2;
}

/* Спиннер загрузки */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность - оставляем пустыми, используем ниже определенные медиа-запросы */


/* Состояния для видео переходов */
.video-player.fade-out {
    animation: fadeOut 0.15s ease-in-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

.video-player.fade-in {
    animation: fadeIn 0.15s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Состояния индивидуальных элементов */
.mic-recording {
    border: 3px solid #f44336;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

.responding {
    border: 3px solid #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.assistant-wrapper.answering {
    border: 2px solid #667eea;
}
/* ==================== Адаптивный дизайн ====================*/

/* Мобильные устройства (портретная ориентация) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
    }

    .assistant-wrapper {
        border-radius: 10px;
    }

    .video-container {
        height: 60vh; /* Меньше высоты для мобильных */
        max-height: 600px;
    }

    .control-panel {
        padding: 15px 10px;
        gap: 10px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .info-panel {
        padding: 15px;
        font-size: 13px;
    }
}

/* Киоски с вертикальным экраном (портретная ориентация) */
@media (max-aspect-ratio: 1/1) and (min-height: 1000px) {
    .video-container {
        height: 75vh; /* Большая высота для вертикальных киосков */
        max-height: none;
    }

    .assistant-wrapper {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }

    body {
        padding: 0;
    }

    .container {
        max-width: 100%;
        height: 100vh;
    }

    .control-panel {
        padding: 20px 15px;
        gap: 15px;
    }

    .info-panel {
        flex-grow: 1;
        overflow-y: auto;
        padding: 20px;
    }
}

/* Малые мобильные (< 480px) */
@media (max-width: 480px) {
    .video-container {
        height: 50vh;
        max-height: 400px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .video-container {
        height: 40vh;
    }

    .control-panel {
        padding: 10px;
        gap: 8px;
    }

    .info-panel {
        display: none; /* Скрыть информационную панель в ландшафте */
    }
}

/* Высокие экраны (> 1200px по высоте) */
@media (min-height: 1200px) {
    .video-container {
        height: 80vh;
    }
}

/* Полноэкранный режим */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    z-index: 9999;
}

.fullscreen-mode .video-container {
    height: 100vh !important;
}

.fullscreen-mode .control-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.fullscreen-mode:hover .control-panel,
.fullscreen-mode .video-container:hover {
    opacity: 1 !important;
    pointer-events: auto;
}

/* Тайная кнопка выхода из полноэкранного режима */
.fullscreen-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.fullscreen-mode .fullscreen-exit-btn {
    opacity: 0.6;
    pointer-events: auto;
}

.fullscreen-exit-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
    opacity: 1 !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

/* Подсказка при наведении */
.fullscreen-exit-btn::after {
    content: 'ESC или клик';
    position: absolute;
    bottom: -30px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.fullscreen-exit-btn:hover::after {
    opacity: 1;
}
