/**
 * AVA_PRESENTATION_STYLES v2.0.4
 * Стили для AvaPresentationController
 * Поддержка: 12 языков, RTL (ar), адаптивность
 * v2.0.1: Добавлены стили кнопок Play/Pause/Stop
 * v2.0.2: Добавлены стили размеров видео (mobile/desktop)
 * v2.0.3: Повышен z-index контролов над intro overlay, добавлен pointer-events
 * v2.0.4: Intro overlay прозрачный, одна кнопка Play/Pause (иконка только)
 */

/* ═══════════════════════════════════════════════════════
   БАЗОВЫЕ ПЕРЕМЕННЫЕ
   ═══════════════════════════════════════════════════════ */
:root {
    --ava-pres-primary: #00D4FF;
    --ava-pres-secondary: #7B2D8E;
    --ava-pres-bg: rgba(0, 0, 0, 0.85);
    --ava-pres-bg-light: rgba(0, 0, 0, 0.6);
    --ava-pres-text: #FFFFFF;
    --ava-pres-text-muted: rgba(255, 255, 255, 0.7);
    --ava-pres-accent: #FFD700;
    --ava-pres-border-radius: 16px;
    --ava-pres-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════
   КОНТЕЙНЕР КОНТРОЛЛЕРА
   ═══════════════════════════════════════════════════════ */
.ava-presentation-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200; /* Above intro overlay (110) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ava-presentation-controls > * {
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════
   INTRO OVERLAY
   ═══════════════════════════════════════════════════════ */
.ava-intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 110;
    pointer-events: none;
}

.ava-intro-content {
    display: none;
}

/* ═══════════════════════════════════════════════════════
   PAUSE OVERLAY
   ═══════════════════════════════════════════════════════ */
.ava-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ava-pres-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 105;
    backdrop-filter: blur(8px);
    animation: avaFadeIn 0.3s ease-out;
    cursor: pointer;
}

.ava-pause-icon {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1rem;
    animation: avaPausePulse 1.5s ease-in-out infinite;
}

.ava-pause-text {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--ava-pres-text);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.ava-pause-hint {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--ava-pres-text-muted);
    margin-top: 0.5rem;
}

@keyframes avaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes avaPausePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════
   QUESTION PANEL
   ═══════════════════════════════════════════════════════ */
.ava-question-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 120;
    backdrop-filter: blur(12px);
    animation: avaSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ava-question-content {
    text-align: center;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
}

.ava-question-icon {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 1rem;
    animation: avaIconBounce 1s ease-in-out infinite;
}

.ava-question-title {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 700;
    color: var(--ava-pres-text);
    margin-bottom: 0.5rem;
}

.ava-question-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: var(--ava-pres-text-muted);
    margin-bottom: 1.5rem;
}

.ava-question-listening {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ava-listening-wave {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 30px;
}

.ava-listening-wave span {
    display: inline-block;
    width: 4px;
    background: var(--ava-pres-primary);
    border-radius: 2px;
    animation: avaWave 1s ease-in-out infinite;
}

.ava-listening-wave span:nth-child(1) { animation-delay: 0s; height: 10px; }
.ava-listening-wave span:nth-child(2) { animation-delay: 0.1s; height: 18px; }
.ava-listening-wave span:nth-child(3) { animation-delay: 0.2s; height: 25px; }
.ava-listening-wave span:nth-child(4) { animation-delay: 0.3s; height: 18px; }
.ava-listening-wave span:nth-child(5) { animation-delay: 0.4s; height: 10px; }

.ava-listening-text {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: var(--ava-pres-primary);
    font-weight: 500;
}

.ava-resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--ava-pres-primary), var(--ava-pres-secondary));
    border: none;
    border-radius: 50px;
    color: var(--ava-pres-text);
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    transition: var(--ava-pres-transition);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    animation: avaFadeIn 0.3s ease-out;
}

.ava-resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

.ava-resume-btn:active {
    transform: translateY(0);
}

.ava-resume-icon {
    font-size: 1.2rem;
}

@keyframes avaSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes avaIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes avaWave {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   OUTRO OVERLAY
   ═══════════════════════════════════════════════════════ */
.ava-outro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(123, 45, 142, 0.3) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 115;
    backdrop-filter: blur(6px);
    animation: avaFadeIn 1s ease-out;
}

.ava-outro-content {
    text-align: center;
    padding: 2rem;
}

.ava-outro-icon {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    animation: avaOutroIconSpin 3s ease-in-out infinite;
}

.ava-outro-text {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 600;
    color: var(--ava-pres-text);
}

@keyframes avaOutroIconSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

/* ═══════════════════════════════════════════════════════
   RTL ПОДДЕРЖКА (для арабского)
   ═══════════════════════════════════════════════════════ */
[dir="rtl"] .ava-question-content,
[dir="rtl"] .ava-intro-content,
[dir="rtl"] .ava-outro-content {
    direction: rtl;
}

[dir="rtl"] .ava-resume-btn {
    flex-direction: row-reverse;
}

/* ═══════════════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .ava-question-content,
    .ava-intro-content,
    .ava-outro-content {
        padding: 1.5rem 1rem;
    }

    .ava-listening-wave {
        height: 24px;
    }

    .ava-listening-wave span {
        width: 3px;
    }

    .ava-resume-btn {
        padding: 0.75rem 1.5rem;
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .ava-question-panel {
        align-items: flex-end;
        padding-bottom: 10vh;
    }

    .ava-question-content {
        background: rgba(0, 0, 0, 0.4);
        border-radius: var(--ava-pres-border-radius);
        backdrop-filter: blur(8px);
        padding: 2.5rem;
    }
}

/* ═══════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .ava-intro-overlay,
    .ava-pause-overlay,
    .ava-question-panel,
    .ava-outro-overlay {
        animation: none;
    }

    .ava-intro-logo,
    .ava-pause-icon,
    .ava-question-icon,
    .ava-outro-icon,
    .ava-listening-wave span {
        animation: none;
    }
}

/* ═══════════════════════════════════════════════════════
   TOUCH ОПТИМИЗАЦИИ
   ═══════════════════════════════════════════════════════ */
.ava-presentation-controls {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.ava-resume-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ═══════════════════════════════════════════════════════
   VIDEO SIZING — v2.0.1: Фикс размеров видео
   ═══════════════════════════════════════════════════════ */
.ava-presentation-screen {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

.ava-presentation-video-container {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

.ava-presentation-video-element,
.ava-dynamic-video-element {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #000;
}

/* 📱 MOBILE (9:16) — Видео на ВСЮ высоту экрана */
@media (max-width: 768px), (orientation: portrait) {
    .ava-presentation-screen.ava-presentation-active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .ava-presentation-screen.ava-presentation-active .ava-presentation-video-container {
        width: 100vw !important;
        height: 100vh !important;
    }

    .ava-presentation-screen.ava-presentation-active .ava-presentation-video-element,
    .ava-presentation-screen.ava-presentation-active .ava-dynamic-video-element {
        width: 100vw !important;
        height: 100vh !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }

    body.ava-presentation-mode > *:not(.ava-presentation-screen):not(script):not(style) {
        display: none !important;
    }
}

/* 💻 DESKTOP (16:9) — Видео по высоте экрана, по центру */
@media (min-width: 769px) and (orientation: landscape) {
    .ava-presentation-screen.ava-presentation-active {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: auto !important;
        height: 90vh !important;
        max-width: 95vw !important;
        z-index: 99999 !important;
        border-radius: 16px;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
        overflow: hidden;
    }

    .ava-presentation-screen.ava-presentation-active .ava-presentation-video-container {
        width: 100%;
        height: 100%;
    }

    .ava-presentation-screen.ava-presentation-active .ava-presentation-video-element,
    .ava-presentation-screen.ava-presentation-active .ava-dynamic-video-element {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        border-radius: 16px;
    }

    body.ava-presentation-mode::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(8px);
        z-index: 99998;
    }
}

/* ═══════════════════════════════════════════════════════
   PLAY/PAUSE BUTTON — v2.0.4 (icon only, bottom center)
   ═══════════════════════════════════════════════════════ */
.ava-play-pause-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 250;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9), rgba(123, 45, 142, 0.9));
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    backdrop-filter: blur(4px);
}

.ava-play-pause-btn:hover {
    transform: translateX(-50%) translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.ava-play-pause-btn:active {
    transform: translateX(-50%) translateY(0) scale(0.95);
}

.ava-play-pause-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.ava-play-pause-text,
.ava-stop-btn {
    display: none !important;
}
