/* ===== EMOTION VISUALIZATION STYLES ===== */

.emotion-sidebar {
    flex: 0 0 250px;
    background: linear-gradient(135deg, rgba(139, 127, 158, 0.05) 0%, rgba(180, 167, 214, 0.05) 100%);
    border-left: 1px solid rgba(139, 127, 158, 0.2);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.emotion-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.emotion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.emotion-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emotion-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.emotion-bar {
    height: 6px;
    background: rgba(139, 127, 158, 0.1);
    border-radius: 3px;
    overflow: hidden;
    flex: 1;
}

.emotion-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(139, 127, 158, 0.3);
}

/* Emotion Colors */
.emotion-fill[style*="background-color: #FFD700"] {
    /* Joy - Gold */
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.emotion-fill[style*="background-color: #4169E1"] {
    /* Sadness - Blue */
    box-shadow: 0 0 8px rgba(65, 105, 225, 0.4);
}

.emotion-fill[style*="background-color: #DC143C"] {
    /* Anger - Red */
    box-shadow: 0 0 8px rgba(220, 20, 60, 0.4);
}

.emotion-fill[style*="background-color: #9932CC"] {
    /* Fear - Purple */
    box-shadow: 0 0 8px rgba(153, 50, 204, 0.4);
}

.emotion-fill[style*="background-color: #FF69B4"] {
    /* Surprise - Pink */
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.4);
}

.emotion-fill[style*="background-color: #32CD32"] {
    /* Disgust - Green */
    box-shadow: 0 0 8px rgba(50, 205, 50, 0.4);
}

.emotion-fill[style*="background-color: #FF8C00"] {
    /* Confusion - Orange */
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.4);
}

.emotion-fill[style*="background-color: #A9A9A9"] {
    /* Neutral - Gray */
    box-shadow: 0 0 8px rgba(169, 169, 169, 0.4);
}

.emotion-value {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    opacity: 0.7;
}

/* Enhanced Grid Layout for Emotions */
.emotion-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .emotion-sidebar {
        flex: 0 0 200px;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .emotion-sidebar {
        display: none;
    }

    /* Show emotions below messages on mobile */
    .chat-content-wrapper {
        flex-direction: column;
    }

    .emotion-container-mobile {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 15px;
        background: rgba(139, 127, 158, 0.05);
        border-top: 1px solid rgba(139, 127, 158, 0.2);
    }

    .emotion-item-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .emotion-bar-mobile {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(139, 127, 158, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }

    .emotion-fill-mobile {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .emotion-fill-mobile.active {
        opacity: 1;
    }

    .emotion-value-mobile {
        font-size: 10px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .emotion-label-mobile {
        font-size: 9px;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .emotion-sidebar {
    background: linear-gradient(135deg, rgba(139, 127, 158, 0.08) 0%, rgba(180, 167, 214, 0.08) 100%);
    border-left-color: rgba(139, 127, 158, 0.3);
}

[data-theme="dark"] .emotion-bar {
    background: rgba(139, 127, 158, 0.15);
}

/* Streaming Animation for Emotions */
@keyframes emotionUpdate {
    0% {
        opacity: 0.7;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.emotion-item {
    animation: emotionUpdate 0.5s ease;
}

/* Enhanced Emotion Display with Icons */
.emotion-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emotion-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Emotion tooltips */
.emotion-tooltip {
    position: relative;
}

.emotion-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 4px;
}

.emotion-tooltip:hover::after {
    opacity: 1;
}

/* Real-time Emotion Update Indicator */
.emotion-updating {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Emotion Timeline (for history view) */
.emotion-timeline {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(139, 127, 158, 0.05);
    border-radius: 8px;
    overflow-x: auto;
}

.emotion-timeline-item {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(139, 127, 158, 0.1);
    border: 1px solid rgba(139, 127, 158, 0.2);
}

.emotion-timeline-item[data-dominant] {
    border: 2px solid var(--text-primary);
    background: rgba(139, 127, 158, 0.15);
}

/* Print-friendly */
@media print {
    .emotion-sidebar {
        display: none;
    }
}