/* =============================================
   AI Chat Animation - Scoped Styles
   Only for chat animation component
   Does NOT affect global page styles
   ============================================== */

/* =============================================
   AI Chat Animation Demo - Professional Flow
   ============================================== */

.ai-chat-demo {
    position: relative;
    min-height: 550px; 
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px;
    background: rgba(10, 20, 30, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(14, 90, 79, 0.2);
    backdrop-filter: blur(10px);
}

/* Watermark Logo */
.ai-chat-demo::before {
    content: '\f27a';
    font-family: 'FontAwesome';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 120px;
    color: rgba(14, 90, 79, 0.05);
    z-index: 0;
    pointer-events: none;
}

.ai-messages-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 2;
}

/* Chat Bubbles Common */
.chat-bubble {
    max-width: 85%;
    padding: 18px 25px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}

/* User Bubble */
.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(14, 90, 79, 0.8) 0%, rgba(14, 90, 72, 0.9) 100%);
    border: 1px solid rgba(135, 213, 195, 0.3);
    border-bottom-right-radius: 4px;
    color: #fff;
}

.chat-bubble.user .content {
    color: #fff;
}

.chat-bubble.user .avatar {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 30px;
    height: 30px;
    background: #0E5A4F;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    border: 2px solid #0E140B;
}

/* AI Bubble */
.chat-bubble.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.chat-bubble.ai .avatar {
    position: absolute;
    left: -10px;
    bottom: -10px;
    width: 30px;
    height: 30px;
    background: #0E140B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(14, 90, 79, 0.4);
    color: #5EE0B6;
    font-size: 14px;
}

/* Thinking Indicator */
.thinking-indicator {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 25px;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    display: none;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.thinking-indicator.visible {
    display: flex;
    animation: aichat-fadeIn 0.3s ease forwards;
}

.thinking-indicator .dot {
    width: 8px;
    height: 8px;
    background: rgba(135, 213, 195, 0.6);
    border-radius: 50%;
    animation: aichat-bounce 1.4s infinite ease-in-out both;
}

.thinking-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-indicator .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes aichat-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes aichat-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Text Formatting inside AI bubble */
.ai-content p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}
.ai-content p:last-child {
    margin-bottom: 0;
}
.ai-content ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}
.ai-content li {
    padding-left: 15px;
    position: relative;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.9);
}
.ai-content li::before {
    content: '•';
    color: #5EE0B6;
    position: absolute;
    left: 0;
}
.ai-content strong {
    color: #5EE0B6;
    font-weight: 600;
}

/* Chat Table Style */
.chat-table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.chat-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-table tr:last-child {
    border-bottom: none;
}

.chat-table td {
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.8);
}

.chat-table td:last-child {
    text-align: right;
    font-weight: 500;
    color: #fff;
}

/* Cursor animation */
.cursor::after {
    content: '|';
    animation: aichat-blink 1s step-end infinite;
    color: #5EE0B6;
    margin-left: 2px;
}

@keyframes aichat-blink { 50% { opacity: 0; } }

/* Responsive */
@media (max-width: 767px) {
    .ai-chat-demo {
        padding: 20px;
        min-height: 450px;
    }
    
    .chat-bubble {
        max-width: 95%;
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .chat-table {
        font-size: 12px;
    }
    
    .chat-table td {
        padding: 6px 8px;
    }
}

