.chat-demo {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: left;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-messages {
    padding: 30px;
    min-height: 400px;
}

.message {
    margin-bottom: 20px;
    opacity: 0;
    animation: slideInMessage 0.8s ease forwards;
}

.message:nth-child(1) {
    animation-delay: 0.5s;
}

.message:nth-child(2) {
    animation-delay: 1.5s;
}

.message:nth-child(3) {
    animation-delay: 4.5s;
}

.message:nth-child(4) {
    animation-delay: 7s;
}

.message:nth-child(5) {
    animation-delay: 4.5s;
}

.message-bubble-list-item {
    margin-left: 20px;
}

@keyframes slideInMessage {
    from { 
        opacity: 0; 
        transform: translateY(60px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.message.user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    padding: 15px 20px;
    border-radius: 12px;
    max-width: 80%;
    animation: bubblePop 0.4s ease forwards;
    transform-origin: bottom;
}

.message.user .message-bubble {
    background: #667eea;
    color: white;
    animation-delay: 0.1s;
}

.message.agent .message-bubble {
    background: #f3f4f6;
    color: #1a1a1a;
    animation-delay: 0.1s;
}

@keyframes bubblePop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message-label {
    font-size: 12px;
    margin-bottom: 5px;
    color: #6b7280;
    font-weight: 600;
    opacity: 0;
    animation: fadeInLabel 0.4s ease forwards;
}

.message:nth-child(1) .message-label {
    animation-delay: 0.6s;
}

.message:nth-child(2) .message-label {
    animation-delay: 1.6s;
}

.message:nth-child(3) .message-label {
    animation-delay: 4.6s;
}

.message:nth-child(4) .message-label {
    animation-delay: 7.1s;
}


@keyframes fadeInLabel {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Typing indicator animation (optional - can be added to HTML) */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

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

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

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

/* Thinking message styles */
.message.thinking .message-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
}

.message.thinking {
    opacity: 0;
    animation: slideInMessage 0.8s 3s ease forwards, fadeOutThinking 0.5s ease forwards 6.5s;
    overflow: hidden;
}

.thinking-text {
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

.message.analysing .message-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
}

.message.analysing {
    opacity: 0;
    animation: slideInMessage 0.8s 1s ease forwards, fadeOutThinking 0.5s ease forwards 2.5s;
    overflow: hidden;
}

.analysing-text {
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

@keyframes fadeOutThinking {
    0% {
        opacity: 1;
        max-height: 100px;
        margin-bottom: 20px;
    }
    100% {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        transform: translateY(-10px);
        overflow: hidden;
    }
}

/* Prompt response styling */
.prompt-response {
    line-height: 1.6;
    font-size: 14px;
}

.prompt-response-intro {
    margin-bottom: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.prompt-response-section {
    margin-bottom: 20px;
}

.prompt-response-section:last-child {
    margin-bottom: 0;
}

.prompt-response-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prompt-response-list {
    margin: 8px 0 0 16px;
    padding-left: 20px;
    list-style-type: disc;
    color: #374151;
}

.prompt-response-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.prompt-response-list li:last-child {
    margin-bottom: 0;
}

.prompt-response-highlights {
    margin: 8px 0 0 16px;
    padding-left: 0;
    list-style: none;
}

.prompt-response-highlight-item {
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
    color: #374151;
}

.prompt-response-highlight-item:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
}

.prompt-response-highlight-item:last-child {
    margin-bottom: 0;
}

.prompt-response-domain {
    font-weight: 600;
    color: #1a1a1a;
}

.prompt-response-meta {
    color: #6b7280;
    font-size: 13px;
}

.prompt-response-text {
    margin-top: 8px;
    color: #374151;
    line-height: 1.5;
}

/* Reorder sections on mobile: Old Way before New Way */
@media (max-width: 991px) {
    .old-way-section {
        order: 1;
    }
    
    .new-way-section {
        order: 2;
    }

    .medium-centred-header {
        font-size: 30px !important;
        text-align: center !important;
        margin-left: 0px !important;
        padding-bottom: 0px !important;
        margin-top: 0px !important;
        padding-top: 0px !important;
    }
}

