/* Conversation Detail Modal Styles */
.conversation-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.conversation-detail-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.detail-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.detail-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.detail-section {
    padding: 24px;
    border-bottom: 1px solid #e9ecef;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    margin: 0 0 16px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: #495057;
    font-size: 1rem;
}

.session-id {
    font-family: "Courier New", monospace;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem !important;
}

.feedback {
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.9rem !important;
    font-weight: 500;
}

.feedback.positive {
    background-color: #d4edda;
    color: #155724;
}

.feedback.negative {
    background-color: #f8d7da;
    color: #721c24;
}

.feedback.none {
    background-color: #e2e3e5;
    color: #6c757d;
}

.message-bubble {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}

.question-bubble {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #007bff;
}

.answer-bubble {
    background: linear-gradient(135deg, #f3e5f5 0%, #e8f5e8 100%);
    border-left: 4px solid #28a745;
}

.message-bubble p {
    margin: 0;
    line-height: 1.6;
    color: #495057;
}

.context-content,
.metadata-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
}

.context-content pre,
.metadata-content pre {
    margin: 0;
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.detail-loading,
.detail-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.detail-error h3 {
    color: #dc3545;
    margin-bottom: 8px;
}

.detail-error p {
    color: #6c757d;
    margin-bottom: 16px;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* Feedback Section Styles */
.feedback-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #6c757d;
}

.feedback-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.feedback-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    color: white;
}

.feedback-badge.positive {
    background-color: #28a745;
}

.feedback-badge.negative {
    background-color: #dc3545;
}

.feedback-timestamp {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.feedback-comment {
    margin-top: 12px;
}

.feedback-comment label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.comment-bubble {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin: 0;
}

.comment-bubble p {
    margin: 0;
    line-height: 1.5;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .conversation-detail-modal {
        width: 95%;
        max-height: 95vh;
        margin: 0;
    }

    .detail-header {
        padding: 16px 20px;
    }

    .detail-header h2 {
        font-size: 1.3rem;
    }

    .detail-section {
        padding: 16px 20px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .detail-footer {
        padding: 12px 20px;
    }

    .message-bubble {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .conversation-detail-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .detail-header {
        padding: 12px 16px;
    }

    .detail-section {
        padding: 12px 16px;
    }

    .detail-footer {
        padding: 12px 16px;
    }
}
