/* ===== THERAPY MODE STYLES ===== */
/* Стили для режима Терапии */

/* ===== THERAPY PANEL ===== */
.therapy-panel {
    width: 280px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #fff;
    max-height: 70vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.therapy-panel.visible {
    display: flex;
    flex-direction: column;
}

.therapy-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.therapy-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.therapy-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.therapy-toggle-btn:hover {
    transform: scale(1.2);
}

.therapy-panel-content {
    flex: 1;
    overflow-y: auto;
}

.therapy-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 16px 0;
}

/* ===== INSIGHTS ===== */
.therapy-insights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.therapy-insight {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.therapy-insight:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
}

.therapy-insight-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.therapy-insight-text {
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    flex: 1;
}

.therapy-insight-delete-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.therapy-insight-delete-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.therapy-confidence-bar {
    width: 100%;
    height: 14px;
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.therapy-confidence-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    transition: width 0.3s ease;
}

.therapy-confidence-text {
    font-size: 8px;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== HYPOTHESES ===== */
.therapy-hypotheses-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.therapy-hypotheses-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.therapy-hypothesis {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.therapy-hypothesis:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
    transform: translateX(4px);
}

.therapy-hypothesis-content {
    margin-bottom: 8px;
}

.therapy-hypothesis-text {
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
    display: block;
}

.therapy-empty {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

/* ===== THERAPY MESSAGE COLORS (WCAG-friendly) ===== */
/* Исправленные цвета для лучшей читаемости */

.message.therapy-message {
    background: #1F2937;
    border-left: 3px solid #A5B4FC;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.message.therapy-message .message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4F46E5;
}

.message.therapy-message .agent-icon {
    font-size: 20px;
}

.message.therapy-message .agent-name {
    font-size: 14px;
    font-weight: 600;
}

.message.therapy-message .message-body {
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 400;
}

/* Dark mode для Therapy message */
@media (prefers-color-scheme: dark) {
    .message.therapy-message {
    background: #1F2937;
        border-left-color: #818CF8;
    }

    .message.therapy-message .message-header {
        color: #A5B4FC;
    }

    .message.therapy-message .message-body {
        color: #F3F4F6;
    }
}

/* Data attribute dark mode support */
[data-color-scheme="dark"] .message.therapy-message {
    background: #1F2937;
    background: #1F2937;
    border-left-color: #818CF8;
}

[data-color-scheme="dark"] .message.therapy-message .message-header {
    color: #A5B4FC;
}

[data-color-scheme="dark"] .message.therapy-message .message-body {
    color: #F3F4F6;
}

[data-color-scheme="light"] .message.therapy-message {
    background: #1F2937;
    border-left-color: #6366F1;
}

[data-color-scheme="light"] .message.therapy-message .message-header {
    color: #4F46E5;
}

[data-color-scheme="light"] .message.therapy-message .message-body {
    color: #111827;
}




/* ===== THERAPY BUBBLES ===== */
.therapy-bubbles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.therapy-bubble {
    padding: 10px 16px;
    border: 1px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.therapy-bubble:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.therapy-bubble:active {
    transform: translateY(0);
}


/* ===== ANIMATION ===== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.therapy-panel {
    animation: slideInRight 0.3s ease;
}


/* ===== THERAPY PANEL OVERLAY ===== */
.therapy-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 98;
    pointer-events: none;
}

.therapy-panel-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ===== MOBILE PANEL STYLES (до 768px) ===== */
@media (max-width: 768px) {
    .therapy-panel {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        max-height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 16px;
        border-radius: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        color: #fff;
        overflow-y: auto;
        z-index: 200;
        display: flex;
        flex-direction: column;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    }

    .therapy-panel.visible {
        right: 0;
    }

    .therapy-panel-overlay.visible {
        display: block !important;
    }

    .therapy-bubbles {
        flex-direction: column;
    }

    .therapy-bubble {
        width: 100%;
    }
}

/* ===== DESKTOP PANEL STYLES (1025px+) ===== */
@media (min-width: 1025px) {
    .therapy-panel {
        position: relative;
        width: 280px;
        height: auto;
        max-height: 70vh;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 16px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #fff;
        overflow-y: auto;
        z-index: 20;
        display: none;
        flex-direction: column;
        transition: all 0.3s ease;
    }

    .therapy-panel.visible {
        display: flex;
    }

    .therapy-panel-overlay {
        display: none !important;
    }
}

/* ===== TABLET PANEL STYLES (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .therapy-panel {
        position: fixed;
        top: 60px;
        right: -280px;
        width: 280px;
        height: calc(100vh - 60px);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 16px;
        border-radius: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        color: #fff;
        overflow-y: auto;
        z-index: 200;
        display: flex;
        flex-direction: column;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    }

    .therapy-panel.visible {
        right: 0;
    }

    .therapy-panel-overlay.visible {
        display: block !important;
    }
}

