/* ====== МУЛЬТИМОДАЛЬНІ СТИЛІ ====== */

/* Навігація */
.multimodal-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.multimodal-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.multimodal-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
}

.multimodal-tab i {
    font-size: 18px;
}

.multimodal-tab:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.multimodal-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.3);
}

.new-badge {
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Панель інструментів чату */
.multimodal-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    transform: scale(1.1);
}

.tool-btn .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.tool-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 120%;
}

.tool-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 8px;
}

/* Індикатор запису */
.voice-recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 30px;
    margin: 10px;
}

.recording-pulse {
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.stop-recording-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====== ВІДЕО ПАНЕЛЬ ====== */
.video-panel {
    background: var(--card-bg);
    border-radius: 16px;
    margin: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    color: white;
}

.video-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.video-header h4 i {
    font-size: 20px;
}

.close-video-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-video-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.video-container {
    position: relative;
    background: #1a1a1a;
    min-height: 400px;
    max-height: 1000px;
    overflow: hidden;
}

#localVideo {
    width: 99%;
    height: 99%;
    max-height: 2700px;
    object-fit: cover;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: rgba(0,0,0,0.05);
    border-top: 1px solid var(--border-color);
}

.video-control-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
}

.video-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(43, 108, 176, 0.4);
}

.video-control-btn:active {
    transform: scale(0.95);
}

#toggleCameraBtn {
    background: #3498db;
}

#capturePhotoBtn {
    background: #2ecc71;
}

#toggleVideoBtn {
    background: #e74c3c;
}

/* ====== ЕМОЦІЙНА СТАТИСТИКА ====== */
.emotion-stats {
    padding: 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.emotion-stats h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emotion-stats h4 i {
    color: var(--primary-color);
}

.emotion-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 5px 0;
}

.emotion-bar span {
    width: 100px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.emotion-bar span i {
    font-size: 18px;
    width: 24px;
}

.progress {
    flex: 1;
    height: 12px;
    background: var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #5dade2);
    border-radius: 20px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(43, 108, 176, 0.3);
    width: 0%;
}

/* Кольори для різних емоцій */
.emotion-bar:nth-child(1) .progress-fill { background: linear-gradient(90deg, #f1c40f, #f39c12); } /* Радість */
.emotion-bar:nth-child(2) .progress-fill { background: linear-gradient(90deg, #3498db, #2980b9); } /* Сум */
.emotion-bar:nth-child(3) .progress-fill { background: linear-gradient(90deg, #e74c3c, #c0392b); } /* Гнів */
.emotion-bar:nth-child(4) .progress-fill { background: linear-gradient(90deg, #9b59b6, #8e44ad); } /* Страх */

.emotion-value {
    min-width: 45px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* Анімація пульсації для активної камери */
@keyframes cameraPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.video-container.active::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border-radius: 50%;
    animation: cameraPulse 2s infinite;
    z-index: 10;
    border: 2px solid white;
}

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .video-container {
        min-height: 300px;
        max-height: 400px;
    }
    
    .video-controls {
        gap: 15px;
        padding: 15px;
    }
    
    .video-control-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .emotion-bar span {
        width: 80px;
        font-size: 13px;
    }
}

.emotion-stats {
    padding: 20px;
}

.emotion-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.emotion-bar span {
    width: 80px;
    font-size: 14px;
}

.progress {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #5dade2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Картки функцій на головній */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

.feature-card.popular {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.feature-card.premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.popular-badge, .premium-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.premium-badge {
    background: #f1c40f;
    color: #2c3e50;
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
}

.feature-icon.text-mode {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.feature-icon.voice-mode {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.feature-icon.video-mode {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.feature-icon.multimodal-mode {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.feature-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-list i {
    color: #2ecc71;
}

.feature-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feature-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}


.feature-btn.primary {
    background: var(--primary-color);
    color: white;
}

.feature-btn.premium {
    background: white;
    color: #764ba2;
    border-color: white;
}

.feature-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.3);
}

/* Демо секція */
.multimodal-demo {
    margin-top: 60px;
    text-align: center;
}

.demo-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.demo-step {
    position: relative;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.demo-step i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Адаптивність */
@media (max-width: 768px) {
    .multimodal-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .feature-card.popular {
        transform: scale(1);
    }
    
    .tool-btn .tooltip {
        display: none;
    }
}


/* Стилі для мультимодальних повідомлень в чаті */
.voice-message .voice-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2ecc71;
    font-size: 14px;
    margin-bottom: 8px;
}

.voice-message .voice-indicator i {
    font-size: 16px;
}

.voice-message .voice-transcription {
    background: rgba(46, 204, 113, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-style: italic;
    border-left: 3px solid #2ecc71;
}

.voice-message .voice-transcription i {
    color: #2ecc71;
    margin-right: 5px;
    font-size: 12px;
}

.voice-message .voice-emotions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.voice-message .emotion-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* Стилі для фото в чаті */
.photo-message {
    margin-bottom: 20px;
}

.photo-message .photo-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9b59b6;
    font-size: 14px;
    margin-bottom: 10px;
    padding: 5px 10px;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 20px;
    display: inline-flex;
}

.photo-message .chat-photo {
    max-width: 300px;
    max-height: 300px;
    border-radius: 12px;
    margin: 10px 0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid var(--card-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.photo-message .chat-photo:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.photo-message .photo-emotion {
    font-size: 13px;
    color: var(--text-color);
    margin: 5px 0;
    padding: 5px 12px;
    background: var(--hover-bg);
    border-radius: 20px;
    display: inline-block;
}

.photo-message .photo-emotion span {
    font-weight: 600;
    margin-left: 5px;
}

/* Модальне вікно для перегляду фото */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.photo-modal.active {
    opacity: 1;
    visibility: visible;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Анімація для кнопки запису */
#voiceInputBtn.recording {
    background: #e74c3c;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


.video-panel {
    display: none;
    width: 90%;
    resize: both;             
    overflow: auto;
    max-width: 1200px;
    margin: 20px auto;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2);
    border: 2px solid var(--primary-color);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    color: white;
}

.video-header h4 {
    margin: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-header h4 i {
    font-size: 22px;
}

.close-video-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-video-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Двоколонковий макет */
.video-main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 0;
    background: var(--card-bg);
}

/* Ліва колонка - відео */
.video-column {
    background: #1a1a1a;
    border-right: 2px solid var(--border-color);
}

.video-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    max-height: 600px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#localVideo {
    width: 90%;
    height: 90%;
    object-fit: cover;
    display: block;
    background: #000;
    transform: scaleX(-1); /* Дзеркальне відображення */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.camera-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    background: rgba(0,0,0,0.8);
    padding: 25px 35px;
    border-radius: 15px;
    z-index: 30;
    font-size: 18px;
    border: 2px solid var(--primary-color);
}

.camera-status i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 25px;
    background: #2c3e50;
}

.video-control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.video-control-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

#capturePhotoBtn {
    background: #2ecc71;
}

#toggleCameraBtn {
    background: #3498db;
}

#toggleVideoBtn {
    background: #e74c3c;
}

/* Права колонка - аналітика */
.analytics-column {
    padding: 25px;
    background: var(--card-bg);
    overflow-y: auto;
    max-height: 700px;
}

.emotion-stats {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--hover-bg);
    border-radius: 15px;
}

.emotion-stats h4 {
    margin: 0 0 20px 0;
    color: var(--text-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.emotion-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 8px 0;
}

.emotion-bar span {
    width: 120px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.emotion-bar span i {
    font-size: 20px;
    width: 28px;
}

.progress {
    flex: 1;
    height: 16px;
    background: var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
    width: 0%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Кольори для емоцій */
.emotion-bar:nth-child(1) .progress-fill { background: linear-gradient(90deg, #f1c40f, #f39c12); }
.emotion-bar:nth-child(2) .progress-fill { background: linear-gradient(90deg, #3498db, #2980b9); }
.emotion-bar:nth-child(3) .progress-fill { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.emotion-bar:nth-child(4) .progress-fill { background: linear-gradient(90deg, #9b59b6, #8e44ad); }
.emotion-bar:nth-child(5) .progress-fill { background: linear-gradient(90deg, #e67e22, #d35400); }

.emotion-value {
    min-width: 60px;
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.emotion-summary {
    padding: 20px;
    background: var(--hover-bg);
    border-radius: 15px;
    margin-bottom: 20px;
}

.emotion-summary h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
}

.summary-content p {
    margin: 10px 0;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.crisis-indicator {
    padding: 15px 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.crisis-indicator i {
    font-size: 24px;
}

/* Анімація для активної камери */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

.video-container.active::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 15px;
    height: 15px;
    background: #2ecc71;
    border-radius: 50%;
    animation: cameraPulse 2s infinite;
    border: 3px solid white;
    z-index: 20;
}

@keyframes cameraPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* Адаптивність */
@media (max-width: 900px) {
    .video-main-content {
        grid-template-columns: 1fr;
    }
    
    .video-column {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    
    .video-container {
        min-height: 400px;
    }
    
    .analytics-column {
        max-height: none;
    }
}

/* ====== ВІДЕО НА ВЕСЬ ЕКРАН ====== */
.video-panel.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    display: flex !important;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

/* Затемнення та розмиття фону */
.video-panel.fullscreen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
    animation: blurIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes blurIn {
    from { backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
    to { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

/* Адаптація для повноекранного режиму */
.video-panel.fullscreen .video-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(43, 108, 176, 0.95), rgba(44, 62, 80, 0.95));
    backdrop-filter: blur(5px);
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.video-panel.fullscreen .video-header h4 {
    font-size: 26px;
}

.video-panel.fullscreen .close-video-btn {
    width: 50px;
    height: 50px;
    font-size: 30px;
    background: rgba(255,255,255,0.15);
}

.video-panel.fullscreen .close-video-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

.video-panel.fullscreen .video-main-content {
    flex: 1;
    grid-template-columns: 1fr 450px;
    gap: 0;
    height: calc(100vh - 80px);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.video-panel.fullscreen .video-column {
    background: rgba(0, 0, 0, 0.5);
}

.video-panel.fullscreen .video-container {
    min-height: calc(100vh - 180px);
    max-height: none;
}

.video-panel.fullscreen #localVideo {
    object-fit: contain; /* 'contain' щоб бачити все відео */
    background: rgba(0, 0, 0, 0.8);
}

.video-panel.fullscreen .analytics-column {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-left: 2px solid rgba(255,255,255,0.1);
    padding: 30px;
    overflow-y: auto;
}

.video-panel.fullscreen .emotion-stats,
.video-panel.fullscreen .emotion-summary {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.video-panel.fullscreen .emotion-stats h4,
.video-panel.fullscreen .emotion-summary h4 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.2);
}

.video-panel.fullscreen .emotion-bar span {
    color: white;
}

.video-panel.fullscreen .emotion-value {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.video-panel.fullscreen .progress {
    background: rgba(255,255,255,0.2);
}

.video-panel.fullscreen .summary-content p {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border-left-color: var(--primary-color);
}

/* notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #2ecc71;
}

.notification.success i {
    color: #2ecc71;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.error i {
    color: #e74c3c;
}

.notification.info {
    border-left-color: #3498db;
}

.notification.info i {
    color: #3498db;
}

.notification i {
    font-size: 24px;
}

.notification span {
    font-size: 14px;
    color: #2c3e50;
}

/* ====== ПАНЕЛЬ АНАЛІЗУ ЕМОЦІЙ ====== */
.emotion-analysis-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    resize: both;   
    overflow: auto; 
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #f5f5f5;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

.emotion-analysis-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    color: white;
}

.analysis-header h3 {
    margin: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-analysis-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.close-analysis-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
}

.analysis-content {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: var(--hover-bg);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-value.critical {
    color: #e74c3c;
}

.chart-container {
    background: var(--hover-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.chart-container h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

#emotionChart {
    width: 100%;
    height: 200px;
}

.categories-section,
.recommendations-section,
.hourly-section {
    background: var(--hover-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.categories-section h4,
.recommendations-section h4,
.hourly-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-name {
    width: 100px;
    font-size: 14px;
    color: var(--text-color);
}

.category-bar-container {
    flex: 1;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.category-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #5dade2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.category-count {
    min-width: 30px;
    text-align: right;
    font-weight: 600;
    color: var(--text-color);
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid #2ecc71;
}

.recommendation-item i {
    font-size: 18px;
}

.recommendation-item span {
    font-size: 14px;
    color: var(--text-color);
}

.hourly-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 5px;
    height: 100px;
    margin-top: 20px;
}

.hour-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.bar-fill {
    width: 100%;
    background: #3498db;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    min-height: 4px;
}

.hour-label {
    font-size: 10px;
    color: var(--text-color);
    transform: rotate(-45deg);
    white-space: nowrap;
}

.no-data {
    color: var(--text-color);
    opacity: 0.6;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Адаптивність */
@media (max-width: 768px) {
    .emotion-analysis-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .analysis-stats {
        grid-template-columns: 1fr;
    }
    
    .category-name {
        width: 80px;
        font-size: 12px;
    }
    
    .hour-label {
        font-size: 8px;
    }
}

/* Кнопка повноекранного режиму */
.fullscreen-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.fullscreen-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.fullscreen-btn i {
    font-size: 20px;
}

.video-header .header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Анімація для повноекранного режиму */
@keyframes fullscreenOpen {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.video-panel.fullscreen {
    animation: fullscreenOpen 0.3s ease;
}

/* Стилі для елементів у повноекранному режимі */
.video-panel.fullscreen .crisis-indicator {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.9));
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 18px;
    padding: 20px;
}

.video-panel.fullscreen .camera-status {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--primary-color);
    font-size: 20px;
    padding: 30px 40px;
}

/* Адаптація для мобільних */
@media (max-width: 768px) {
    .video-panel.fullscreen .video-main-content {
        grid-template-columns: 1fr;
    }
    
    .video-panel.fullscreen .analytics-column {
        max-height: 40vh;
    }
    
    .fullscreen-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Плавні переходи */
.video-panel {
    transition: all 0.3s ease;
}

.video-panel.fullscreen .video-main-content,
.video-panel.fullscreen .video-column,
.video-panel.fullscreen .analytics-column {
    transition: all 0.3s ease;
}

/* Стилі для кнопки fullscreen */
.fullscreen-btn {
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.3);
}


/* Стилі для статусу камери */
.camera-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 30px 40px;
    border-radius: 20px;
    z-index: 30;
    font-size: 18px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    min-width: 300px;
    backdrop-filter: blur(5px);
}

.camera-status i {
    font-size: 60px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.camera-status i.fa-ban {
    color: #e74c3c;
}

.camera-status i.fa-hourglass-end {
    color: #f39c12;
}

.camera-status i.fa-video-slash {
    color: #95a5a6;
}

.camera-status button {
    margin-top: 20px;
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.camera-status button:hover {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.camera-status button i {
    font-size: 14px;
    margin-right: 8px;
    color: inherit;
}

/* Додайте в кінець multimodal.css */

/* Стилі для голосових повідомлень */
.voice-message audio {
    width: 100%;
    height: 40px;
    margin-top: 10px;
    border-radius: 20px;
}

.voice-message .voice-emotions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.crisis-tag {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Стилі для фото в чаті */
.photo-message .photo-analysis {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chat-photo {
    max-width: 300px;
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid var(--primary-color);
}

.chat-photo:hover {
    transform: scale(1.02);
}

/* Emergency banner */
.emergency-banner {
    background: #e74c3c;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    display: none;
    animation: pulse 2s infinite;
    border-radius: 8px;
    margin: 10px;
}

.emergency-banner i {
    margin-right: 10px;
    font-size: 20px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Message time */
.message-time {
    font-size: 11px;
    color: #95a5a6;
    margin-left: 10px;
}

/* System messages */
.message.system {
    opacity: 0.8;
    font-style: italic;
}

.message.system .avatar {
    background: #95a5a6;
}

/* Стилі для аналізу відео в чаті */
.video-analysis {
    margin-bottom: 20px;
}

.video-analysis .avatar {
    background: #9b59b6;
}

.video-analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9b59b6;
    font-size: 14px;
    margin-bottom: 10px;
    padding: 5px 10px;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 20px;
    display: inline-flex;
}

.video-analysis-content {
    background: rgba(155, 89, 182, 0.05);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #9b59b6;
}

.dominant-emotion {
    margin-bottom: 15px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 8px;
}

.emotion-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
}

.mini-emotion-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.mini-emotion-bar span:first-child {
    width: 70px;
    color: var(--text-color);
}

.mini-emotion-bar .progress {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.mini-emotion-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.mini-emotion-bar span:last-child {
    min-width: 40px;
    text-align: right;
    color: var(--text-color);
    font-weight: 600;
}

.crisis-warning {
    margin-top: 10px;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    color: #e74c3c;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

/* ===== ВІДЕО ПОВІДОМЛЕННЯ В ЧАТІ ===== */

.message.video-message {
    max-width: 400px;
}

.video-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
}

.video-duration {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.video-preview-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.chat-video {
    width: 100%;
    max-height: 300px;
    display: block;
    border-radius: 12px;
}

.video-overlay-play {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s;
}

.video-overlay-play:hover {
    background: rgba(0,0,0,0.5);
}

.video-overlay-play i {
    font-size: 64px;
    color: white;
    opacity: 0.9;
}

.chat-video[poster] + .video-overlay-play {
    opacity: 0;
}

.chat-video[poster]:hover + .video-overlay-play,
.video-overlay-play:hover {
    opacity: 1;
}

.video-analysis-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.show-details-btn {
    background: #edf2f7;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s;
}

.show-details-btn:hover {
    background: #e2e8f0;
}

.video-details {
    margin-top: 10px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.emotion-bars-detailed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detailed-emotion-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.detailed-emotion-bar .emotion-label {
    width: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detailed-emotion-bar .progress-bar-container {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.detailed-emotion-bar .progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.detailed-emotion-bar .emotion-percent {
    width: 40px;
    text-align: right;
    color: #666;
}

/* Індикатор запису відео */
.video-recording-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.recording-time {
    font-family: monospace;
    font-size: 14px;
}

/* Кнопка запису відео */
#toggleVideoBtn.recording {
    background: #e74c3c !important;
    color: white !important;
    animation: pulse 2s infinite;
}

/* Загальний стан емоцій */
.emotion-summary {
    margin-top: 20px;
}

.overall-mood {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mood-description {
    margin-top: 5px;
}

.stress-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* Фікс для стрес/тривоги бару */
.emotion-bar:nth-child(5) .progress-fill {
    background: #e67e22 !important;
}

/* Темна тема */
[data-theme="dark"] .video-details {
    background: #2d3748;
}

[data-theme="dark"] .show-details-btn {
    background: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .detailed-emotion-bar .progress-bar-container {
    background: #4a5568;
}