/* Expult AI Chat Widget Styles */

/* Floating Chat Button */
.expult-ai-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(253, 86, 49, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
}

/* Floating Action Buttons Container */
.ai-action-buttons {
    position: fixed;
    bottom: 20px; /* Match button bottom position */
    right: 90px; /* Position to the left of the main button */
    z-index: 999;
    display: none; /* Hidden by default */
    align-items: center;
    gap: 0;
    opacity: 0;
    transform: translateX(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 60px; /* Match button height for vertical centering */
}

.ai-action-buttons.show {
    display: flex;
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Individual Action Button */
.ai-action-btn {
    /* Glassy background design */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 8px rgba(253, 86, 49, 0.2);

    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
}

.ai-action-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 3px 10px rgba(253, 86, 49, 0.3);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-action-btn:active {
    transform: translateY(0) scale(1.02);
}

.ai-action-btn i {
    font-size: 11px;
}

/* Vertical Divider */
.ai-action-divider {
    width: 1px;
    height: 15px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 80%,
        transparent 100%
    );
    margin: 0 4px;
    flex-shrink: 0;
}

/* Promotional Bubbles Container */
.ai-promo-bubbles {
    position: fixed;
    bottom: 20px; /* Match button bottom position */
    right: 90px; /* Position to the left of the button */
    z-index: 999;
    pointer-events: none; /* Allow clicks to pass through container */
    /* Remove transform to align with button baseline, then use flex to center */
    display: flex;
    align-items: center;
    height: 60px; /* Match button height for vertical centering */
}

/* Individual Promotional Bubble */
.promo-bubble {
    /* Glassy background design inspired by the provided image */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 15px rgba(253, 86, 49, 0.2);

    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto; /* Enable clicks on the bubble itself */
    opacity: 0;
    transform: translateX(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    min-height: 40px;

    /* Additional glassy effects */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* Bubble arrow pointing to the button */
.promo-bubble::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Show animation */
.promo-bubble.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Fade out animation */
.promo-bubble.fade-out {
    opacity: 0;
    transform: translateX(-20px) scale(0.8);
    transition: all 0.3s ease;
}

/* Hover effect for bubbles */
.promo-bubble:hover {
    transform: translateX(-5px) scale(1.05);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 6px 20px rgba(253, 86, 49, 0.3);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Highlighted state when button is hovered */
.promo-bubble.highlighted {
    transform: translateX(-8px) scale(1.08);
    box-shadow:
        0 12px 45px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 8px 25px rgba(253, 86, 49, 0.4);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    animation: glassy-pulse 1.5s ease-in-out infinite;
}

/* Glassy pulse animation for highlighted bubbles */
@keyframes glassy-pulse {
    0%, 100% {
        box-shadow:
            0 12px 45px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            0 8px 25px rgba(253, 86, 49, 0.4);
        background: rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 15px 50px rgba(0, 0, 0, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.5),
            0 10px 30px rgba(253, 86, 49, 0.5);
        background: rgba(255, 255, 255, 0.25);
    }
}

.expult-ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(253, 86, 49, 0.6);
    background: linear-gradient(135deg, #ff3a40 0%, #fd5631 100%);
}

.expult-ai-button:active {
    transform: translateY(0);
}

/* Notification Badge */
.expult-ai-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Chat Widget Container */
.expult-ai-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 575px; /* Increased from 500px (15% increase) */
    background: #1f1b2c;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.expult-ai-widget.show {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* Widget Header */
.expult-ai-header {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.expult-ai-header .header-info {
    display: flex;
    align-items: center;
}

.expult-ai-header .ai-avatar {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 18px;
}

.expult-ai-header .ai-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.expult-ai-header .ai-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

/* AI Service Indicator - Hidden per user request */
.expult-ai-header .ai-service-indicator {
    display: none; /* Hide from user interface */
}

.expult-ai-header .service-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: help;
}

.expult-ai-header .service-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.expult-ai-header .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expult-ai-header .close-btn,
.expult-ai-header .chat-history-btn,
.expult-ai-header .maximize-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.expult-ai-header .close-btn:hover,
.expult-ai-header .chat-history-btn:hover,
.expult-ai-header .maximize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages Area */
.expult-ai-messages {
    flex: 1;
    padding: 2px 4px 20px 4px; /* Reduced top padding from 20px to 2px (90% reduction), kept bottom padding */
    overflow-y: auto;
    background: #1f1b2c;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.expult-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.expult-ai-messages::-webkit-scrollbar-track {
    background: #2a2438;
}

.expult-ai-messages::-webkit-scrollbar-thumb {
    background: #fd5631;
    border-radius: 3px;
}

/* Message Bubbles */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.ai {
    align-self: flex-start;
    flex-direction: column; /* Stack avatar above content */
    align-items: flex-start; /* Align to left */
    max-width: 95%; /* Give more space for content */
    gap: 8px; /* Space between avatar and content */
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
    border-radius: 8px; /* Rectangle with small border radius */
    width: auto; /* Auto width to fit content */
    height: auto; /* Auto height to fit content */
    padding: 6px 12px; /* Padding for the label */
    font-size: 12px; /* Smaller font for label */
    font-weight: 600; /* Bold text */
    gap: 6px; /* Space between icon and text */
}

.message.user .message-avatar {
    background: #2a2438;
    color: #d4c8e8;
}

.message-content {
    background: #2a2438;
    color: #d4c8e8;
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 12px; /* Reduced from 14px (15% reduction) */
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
}

.message.ai .message-content {
    background: #2a2438;
    color: #d4c8e8;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    flex-direction: column; /* Stack avatar above typing content */
    align-items: flex-start; /* Align to left */
    gap: 8px; /* Space between avatar and typing content */
    padding: 10px 0;
    max-width: 95%; /* Match AI message width */
}

.typing-indicator .message-avatar {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
    border-radius: 8px; /* Rectangle with small border radius */
    width: auto; /* Auto width to fit content */
    height: auto; /* Auto height to fit content */
    padding: 6px 12px; /* Padding for the label */
    font-size: 12px; /* Smaller font for label */
    font-weight: 600; /* Bold text */
    gap: 6px; /* Space between icon and text */
}

.typing-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 15px;
    background: #2a2438;
    border-radius: 18px;
}

.typing-text {
    font-size: 11px;
    color: rgba(212, 200, 232, 0.6);
    font-style: italic;
    padding-left: 15px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #fd5631;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: center; /* Center align the buttons */
}

.quick-action-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
}

/* Input Area */
.expult-ai-input {
    padding: 15px 20px;
    background: #18151f;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2438;
    border-radius: 25px;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s ease;
}

.input-container:focus-within {
    border-color: #fd5631;
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: #d4c8e8;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    overflow-y: auto;
}

.message-input::placeholder {
    color: rgba(212, 200, 232, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px 4px; /* Reduced left/right padding from 20px to 4px (80% reduction) */
    color: #d4c8e8;
}

.welcome-message h3 {
    color: #fd5631;
    margin-bottom: 10px;
    font-size: 18px;
}

.welcome-message p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 15px;
}

/* Message Meta Container (for user messages) */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    gap: 8px;
}

/* AI Message Meta Container (for AI messages - timestamp and actions in same row) */
.ai-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    gap: 8px;
}

/* Message Status Indicators */
.message-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 11px;
    color: rgba(212, 200, 232, 0.6);
    flex-shrink: 0; /* Prevent shrinking */
}

.message-time {
    font-size: 11px;
    color: rgba(212, 200, 232, 0.6);
    flex-shrink: 0; /* Prevent shrinking */
}

/* AI message timestamp within meta container */
.ai-message-meta .message-time {
    margin-top: 0; /* Remove margin when in meta container */
}

.message-status i {
    font-size: 10px;
}

.message-status.delivered {
    color: #4CAF50;
}

.message-status.seen {
    color: #2196F3;
}

/* Enhanced Message Bubbles */
.message-content.code {
    background: #1a1625;
    border: 1px solid rgba(253, 86, 49, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

.message-content.link {
    color: #fd5631;
    text-decoration: underline;
    cursor: pointer;
}

.message-content.link:hover {
    color: #ff3a40;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 27, 44, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(253, 86, 49, 0.3);
    border-top: 3px solid #fd5631;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Session Status (Auto-hiding status bar with smooth transitions) */
.session-status {
    padding: 8px 15px;
    background: rgba(253, 86, 49, 0.1);
    border-bottom: 1px solid rgba(253, 86, 49, 0.2);
    font-size: 12px;
    color: #fd5631;
    text-align: center;
    width: 100%;
    margin: 0;
    border-radius: 0;
    display: block;
    opacity: 0;
    transform: translateY(-100%); /* Start above viewport */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth material design transition */
    overflow: hidden;
    max-height: 0;
}

.session-status.show {
    opacity: 1;
    transform: translateY(0); /* Slide down to normal position */
    max-height: 50px; /* Allow content to show */
}

.session-status.hide {
    opacity: 0;
    transform: translateY(-20px); /* Slide up slightly as it fades */
    max-height: 0;
}

.session-status.connected {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.session-status.disconnected {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* Enhanced Input Area */
.input-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.input-action-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
}

.input-action-btn.active {
    background: #fd5631;
    color: white;
}

/* Attachment Preview */
.attachment-preview {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.attachment-item {
    background: #2a2438;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #d4c8e8;
}

.attachment-item .remove-btn {
    background: none;
    border: none;
    color: #fd5631;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0; /* Prevent shrinking in flex container */
}

.message:hover .message-actions {
    opacity: 1;
}

/* Message actions within AI meta container */
.ai-message-meta .message-actions {
    margin-top: 0; /* Remove top margin when in meta container */
}

.message-action-btn {
    background: none;
    border: none;
    color: rgba(212, 200, 232, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    color: #fd5631;
}

/* Suggestions Container with Scroll Buttons */
.suggestions-container {
    padding: 4px 6px;
    background: rgba(253, 86, 49, 0.05);
    border-top: 1px solid rgba(253, 86, 49, 0.1);
    max-height: 35px;
    overflow: hidden;
    position: relative;
}

.suggestions-container:hover .scroll-button {
    opacity: 1;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: rgba(212, 200, 232, 0.75);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.scroll-button:hover {
    color: rgba(212, 200, 232, 1);
    transform: translateY(-50%) scale(1.1);
}

.scroll-button.left {
    left: 2px;
}

.scroll-button.right {
    right: 2px;
}

.suggestions-container::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(90deg, transparent 0%, rgba(253, 86, 49, 0.05) 100%);
    pointer-events: none;
    border-radius: 50%;
}

.suggestion-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

.suggestions-title {
    font-size: 11px;
    color: #fd5631;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    margin-right: 4px;
}

.suggestion-chips::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.suggestion-chip {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

.suggestion-chip:active {
    transform: translateY(0);
}

/* Chat History */
.chat-history-btn {
    background: none;
    border: none;
    color: rgba(212, 200, 232, 0.8);
    font-size: 12px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chat-history-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    color: #fd5631;
}

/* Error States */
.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 12px;
    text-align: center;
}

.retry-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-top: 5px;
}

.retry-btn:hover {
    background: #d32f2f;
}

/* Fixed Size Responsive Design - No size changes across devices */
@media (max-width: 768px) {
    .expult-ai-widget {
        /* Keep consistent size - same as desktop */
        width: 350px;
        height: 575px;
        bottom: 156px; /* Reduced gap by 70% (90px + 60px button + 6px margin) */
        right: 20px;
        /* Remove left positioning to prevent full-width stretching */
        left: auto;
        /* Ensure it doesn't go off screen on very small devices */
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 206px); /* Adjusted for new bottom position */
    }

    .expult-ai-button {
        /* Keep consistent size and position - same as desktop */
        bottom: 90px;
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    /* Promotional bubbles responsive positioning */
    .ai-promo-bubbles {
        bottom: 90px; /* Match button bottom position on mobile */
        right: 90px; /* Adjust for mobile */
        height: 60px; /* Match button height for vertical centering */
        display: flex;
        align-items: center;
    }

    .promo-bubble {
        font-size: 13px;
        padding: 8px 15px;
        max-width: calc(100vw - 140px); /* Prevent overflow on small screens */
        min-height: 36px;
    }

    /* Action buttons responsive positioning */
    .ai-action-buttons {
        bottom: 90px; /* Match button bottom position on mobile */
        right: 90px; /* Adjust for mobile */
        height: 60px; /* Match button height for vertical centering */
    }

    .ai-action-btn {
        font-size: 11px;
        padding: 5px 8px;
        min-height: 22px;
        border-radius: 10px;
    }

    .ai-action-btn i {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .expult-ai-widget {
        /* Keep consistent size - same as desktop */
        width: 350px;
        height: 575px;
        bottom: 156px; /* Reduced gap by 70% (90px + 60px button + 6px margin) */
        right: 20px;
        /* Remove left positioning to prevent full-width stretching */
        left: auto;
        /* Ensure it doesn't go off screen on very small devices */
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 206px); /* Adjusted for new bottom position */
    }

    .expult-ai-button {
        /* Keep consistent size and position - same as desktop */
        bottom: 90px;
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    /* Promotional bubbles for very small screens */
    .ai-promo-bubbles {
        bottom: 90px; /* Match button bottom position on mobile */
        right: 90px; /* Adjust for mobile */
        height: 60px; /* Match button height for vertical centering */
        display: flex;
        align-items: center;
    }

    .promo-bubble {
        font-size: 12px;
        padding: 6px 12px;
        max-width: calc(100vw - 120px); /* Prevent overflow on very small screens */
        border-radius: 16px;
    }

    .promo-bubble::after {
        border-left-width: 6px;
        border-top-width: 5px;
        border-bottom-width: 5px;
        right: -6px;
    }

    /* Action buttons for very small screens */
    .ai-action-buttons {
        bottom: 90px; /* Match button bottom position on mobile */
        right: 90px; /* Adjust for mobile */
        height: 60px; /* Match button height for vertical centering */
    }

    .ai-action-btn {
        font-size: 10px;
        padding: 4px 7px;
        min-height: 20px;
        border-radius: 8px;
        gap: 3px;
    }

    .ai-action-btn i {
        font-size: 9px;
    }

    .ai-action-divider {
        height: 12px;
        margin: 0 3px;
    }

    /* Keep internal component styling consistent */
    .suggestions-container {
        padding: 4px 6px; /* Same as desktop */
    }

    .suggestion-chips {
        gap: 8px; /* Same as desktop */
    }

    .suggestions-title {
        font-size: 11px; /* Same as desktop */
        margin-right: 8px; /* Same as desktop */
    }

    .suggestion-chip {
        font-size: 11px; /* Same as desktop */
        padding: 4px 10px; /* Same as desktop */
    }
}

/* STAGE 1 ENHANCEMENT: Car Suggestion Cards */

/* Car Suggestions Container */
.ai-car-suggestions {
    margin-top: 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    max-width: 100%;
}

.ai-car-suggestions-header {
    font-size: 11px;
    color: #fd5631;
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 2px;
    opacity: 0.9;
}

/* Individual Car Card */
.ai-car-card {
    display: flex;
    align-items: center;
    background: rgba(42, 36, 56, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ai-car-card:hover {
    background: rgba(42, 36, 56, 0.8);
    border-color: rgba(253, 86, 49, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(253, 86, 49, 0.15);
}

.ai-car-card:last-child {
    margin-bottom: 0;
}

/* Car Thumbnail */
.ai-car-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.2);
    flex-shrink: 0;
    margin-right: 10px;
}

.ai-car-thumbnail.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(253, 86, 49, 0.6);
    font-size: 20px;
    background: rgba(253, 86, 49, 0.08);
}

/* Car Info Section */
.ai-car-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* Allow text truncation */
}

.ai-car-title {
    font-size: 12px;
    font-weight: 600;
    color: #d4c8e8;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-car-price {
    font-size: 11px;
    color: #fd5631;
    font-weight: 600;
    margin: 0;
    line-height: 1;
}

.ai-car-location {
    font-size: 10px;
    color: rgba(212, 200, 232, 0.7);
    margin: 0;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* See More Button */
.ai-car-see-more {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-car-see-more:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: scale(1.05);
}

.ai-car-see-more:active {
    transform: scale(0.98);
}

/* Loading State for Car Cards */
.ai-car-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.ai-car-card.loading .ai-car-thumbnail {
    background: linear-gradient(90deg, rgba(253, 86, 49, 0.1) 0%, rgba(253, 86, 49, 0.2) 50%, rgba(253, 86, 49, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive Design for Car Cards */
@media (max-width: 768px) {
    .ai-car-card {
        padding: 6px;
    }

    .ai-car-thumbnail {
        width: 70px;
        height: 52px;
        margin-right: 8px;
    }

    .ai-car-title {
        font-size: 11px;
    }

    .ai-car-price {
        font-size: 10px;
    }

    .ai-car-location {
        font-size: 9px;
    }

    .ai-car-see-more {
        padding: 3px 6px;
        font-size: 9px;
        margin-left: 6px;
    }
}

@media (max-width: 480px) {
    .ai-car-thumbnail {
        width: 60px;
        height: 45px;
    }

    .ai-car-info {
        gap: 2px;
    }
}

/* Step 3.4: Enhanced Error Handling & Recovery UI Styles */

/* Enhanced Retry Indicator */
.retry-indicator {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 15px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    animation: slideInUp 0.4s ease-out;
    box-shadow: 0 2px 8px rgba(255, 234, 167, 0.3);
}

.retry-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.retry-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #fd5631;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

.retry-text {
    flex: 1;
}

.retry-operation {
    font-weight: 600;
    color: #856404;
    margin-bottom: 4px;
    font-size: 13px;
}

.retry-status {
    font-size: 12px;
    color: #856404;
    opacity: 0.8;
}

/* Enhanced Retry Option Buttons */
.retry-option {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    margin: 12px 0;
    text-align: center;
    animation: slideInUp 0.4s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.retry-option-content {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.retry-btn, .cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
}

.retry-btn {
    background: linear-gradient(135deg, #fd5631 0%, #e04e2a 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(253, 86, 49, 0.3);
}

.retry-btn:hover {
    background: linear-gradient(135deg, #e04e2a 0%, #c8441f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 86, 49, 0.4);
}

.cancel-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Enhanced Rate Limit Countdown */
.rate-limit-countdown {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 15px;
    margin: 12px 0;
    text-align: center;
    animation: slideInUp 0.4s ease-out;
    box-shadow: 0 2px 8px rgba(255, 234, 167, 0.3);
}

.countdown-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.countdown-icon {
    font-size: 28px;
    animation: pulse 2s infinite;
}

.countdown-text {
    text-align: left;
}

.countdown-timer {
    font-size: 12px;
    color: #856404;
    margin-top: 6px;
    font-weight: 500;
}

#countdown-seconds {
    font-weight: bold;
    color: #fd5631;
    font-size: 14px;
}

/* Enhanced Session Status Indicators (for header status) */
.expult-ai-header .session-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 10px;
    transition: all 0.3s ease;
    display: inline-block;
}

.expult-ai-header .session-status.authenticated {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.expult-ai-header .session-status.unauthenticated {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.expult-ai-header .session-status.degraded {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Enhanced Error Message Styling */
.message.ai .message-content.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
    color: #721c24;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.message.ai .message-content.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
    color: #856404;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.message.ai .message-content.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #17a2b8;
    color: #0c5460;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

/* Enhanced Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Connection Status Indicator */
.connection-status {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 3s infinite;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.connection-status.offline {
    background: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.connection-status.degraded {
    background: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

/* Mobile Responsive Error Handling */
@media (max-width: 768px) {
    .retry-option-content {
        flex-direction: column;
        gap: 10px;
    }

    .retry-btn, .cancel-btn {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }

    .countdown-content {
        flex-direction: column;
        gap: 10px;
    }

    .countdown-icon {
        font-size: 24px;
    }

    .retry-indicator, .retry-option, .rate-limit-countdown {
        padding: 12px;
        margin: 10px 0;
    }

    .retry-spinner {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
}

/* Phase 4.2: Enhanced Message Content Styling */

/* Optimized Response Styling */
.optimized-response-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.optimization-info {
    margin-bottom: 8px;
}

.optimization-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 11px;
    color: #fd5631;
    cursor: help;
}

.optimization-badge i {
    font-size: 10px;
}

.optimization-details {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Structured Content Styling */
.content-section {
    margin-bottom: 8px;
}

.content-section.heading {
    color: #fd5631;
    font-weight: 600;
    margin-bottom: 6px;
}

.content-section.text {
    line-height: 1.5;
    color: #d4c8e8;  /* Ensure normal text color */
    font-weight: normal;  /* Ensure normal font weight */
}

.structured-list {
    margin: 6px 0;
    padding-left: 16px;
    list-style: none;
}

.structured-list li {
    position: relative;
    margin-bottom: 4px;
    padding-left: 12px;
    line-height: 1.4;
}

.structured-list li::before {
    content: '•';
    color: #fd5631;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Response Controls - FORCED Single Row Layout */
.message .response-controls {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: nowrap !important;
    min-height: 24px;
    width: 100% !important;
    box-sizing: border-box !important;
}

.message .response-controls .word-count-badge {
    font-size: 10px;
    color: rgba(212, 200, 232, 0.6);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 8px;
    flex: 0 0 auto !important; /* Don't grow, don't shrink, auto width */
    white-space: nowrap !important;
    display: inline-block !important;
    order: 1 !important; /* Force to left */
}

.message .response-controls .response-actions {
    display: flex !important;
    gap: 6px;
    flex: 0 0 auto !important; /* Don't grow, don't shrink, auto width */
    align-items: center;
    order: 2 !important; /* Force to right */
    margin-left: auto !important;
}



.response-action-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.response-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
}

.response-action-btn i {
    font-size: 9px;
}

/* Progressive Disclosure Overlays */
.summary-overlay,
.original-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 27, 44, 0.95);
    border-radius: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.summary-content,
.original-content {
    background: #2a2438;
    border: 1px solid rgba(253, 86, 49, 0.3);
    border-radius: 12px;
    padding: 12px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
}

/* Custom scrollbar for overlay content - matches widget design */
.summary-content::-webkit-scrollbar,
.original-content::-webkit-scrollbar {
    width: 6px;
}

.summary-content::-webkit-scrollbar-track,
.original-content::-webkit-scrollbar-track {
    background: #2a2438;
    border-radius: 3px;
}

.summary-content::-webkit-scrollbar-thumb,
.original-content::-webkit-scrollbar-thumb {
    background: #fd5631;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.summary-content::-webkit-scrollbar-thumb:hover,
.original-content::-webkit-scrollbar-thumb:hover {
    background: #ff6b47;
}

/* Firefox scrollbar styling for overlay content */
.summary-content,
.original-content {
    scrollbar-width: thin;
    scrollbar-color: #fd5631 #2a2438;
}

.summary-header,
.original-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-header span,
.original-header span {
    font-weight: 600;
    color: #fd5631;
    font-size: 12px;
}

.close-summary-btn,
.close-original-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(212, 200, 232, 0.8);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.close-summary-btn:hover,
.close-original-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: rgba(253, 86, 49, 0.5);
    color: #fd5631;
    transform: translateY(-1px);
}

.summary-text,
.original-text {
    font-size: 12px;
    line-height: 1.4;
    color: #d4c8e8;
    margin-bottom: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* Custom scrollbar for text content areas - matches widget design */
.summary-text::-webkit-scrollbar,
.original-text::-webkit-scrollbar {
    width: 6px;
}

.summary-text::-webkit-scrollbar-track,
.original-text::-webkit-scrollbar-track {
    background: #2a2438;
    border-radius: 3px;
}

.summary-text::-webkit-scrollbar-thumb,
.original-text::-webkit-scrollbar-thumb {
    background: #fd5631;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.summary-text::-webkit-scrollbar-thumb:hover,
.original-text::-webkit-scrollbar-thumb:hover {
    background: #ff6b47;
}

/* Firefox scrollbar styling for text content */
.summary-text,
.original-text {
    scrollbar-width: thin;
    scrollbar-color: #fd5631 #2a2438;
}

.summary-actions,
.original-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Overlay action buttons - match widget button design */
.summary-actions button,
.original-actions button {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.summary-actions button:hover,
.original-actions button:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

.summary-actions button:active,
.original-actions button:active {
    transform: translateY(0);
}

/* Specific overlay button styles - covers all button types */
.expand-summary-btn,
.use-original-btn,
.keep-optimized-btn,
.use-detailed-btn,
.keep-summary-btn,
.use-summary-btn,
.keep-detailed-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expand-summary-btn:hover,
.use-original-btn:hover,
.keep-optimized-btn:hover,
.use-detailed-btn:hover,
.keep-summary-btn:hover,
.use-summary-btn:hover,
.keep-detailed-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

/* Enhanced Message Actions */
.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(212, 200, 232, 0.6);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    color: #fd5631;
}

/* Collapsible Sections */
.collapsible-section {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 6px 0;
    overflow: hidden;
}

.collapsible-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #fd5631;
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: rgba(253, 86, 49, 0.1);
}

.collapsible-content {
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
    display: none;
}

.collapsible-section.expanded .collapsible-content {
    display: block;
}

.collapsible-icon {
    transition: transform 0.2s ease;
}

.collapsible-section.expanded .collapsible-icon {
    transform: rotate(180deg);
}

/* Phase 4.2: Enhanced Responsive Design for New Features - Keep consistent layout */
@media (max-width: 768px) {
    /* Keep response controls in single row - same as desktop */
    .response-controls {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .response-actions {
        justify-content: flex-end !important;
        margin-left: auto !important;
    }

    .word-count-badge {
        align-self: center !important;
    }
    .summary-content,
    .original-content {
        max-width: 95%;
        max-height: 85%;
        padding: 10px;
    }

    .optimization-badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    .response-action-btn {
        font-size: 9px;
        padding: 3px 6px;
    }

    .structured-list {
        padding-left: 12px;
    }

    .collapsible-header {
        padding: 6px 10px;
        font-size: 11px;
    }

    .collapsible-content {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Phase 4.3: Enhanced Feedback System Styling */

/* Quality Indicators */
.quality-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    margin-left: 6px;
}

.quality-indicator.high {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.quality-indicator.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.quality-indicator.low {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.quality-indicator i {
    font-size: 8px;
}

/* Feedback Container */
.feedback-container {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-prompt {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-question {
    font-size: 11px;
    color: #fd5631;
    font-weight: 600;
}

.feedback-buttons {
    display: flex;
    gap: 6px;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d4c8e8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    color: #fd5631;
}

.feedback-btn.positive:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #4CAF50;
}

.feedback-btn.negative:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: #F44336;
    color: #F44336;
}

.feedback-btn i {
    font-size: 9px;
}

/* Detailed Feedback */
.detailed-feedback {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feedback-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #d4c8e8;
    cursor: pointer;
}

.feedback-option input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #fd5631;
}

.feedback-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
    color: #d4c8e8;
    font-size: 10px;
    resize: vertical;
    min-height: 40px;
    max-height: 80px;
}

.feedback-text::placeholder {
    color: rgba(212, 200, 232, 0.5);
}

.feedback-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.feedback-submit-btn,
.feedback-cancel-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-submit-btn {
    background: rgba(253, 86, 49, 0.2);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
}

.feedback-submit-btn:hover {
    background: rgba(253, 86, 49, 0.3);
    border-color: #fd5631;
}

.feedback-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d4c8e8;
}

.feedback-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Feedback Thank You */
.feedback-thank-you {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4CAF50;
    font-size: 10px;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.feedback-thank-you i {
    font-size: 9px;
}

/* Phase 4.1: Follow-up Question Styling */
.content-section.followup-question {
    margin-top: 8px;
}

.followup-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.followup-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

.followup-btn:before {
    content: '💬';
    font-size: 10px;
}
