﻿

/* Chart container inside bot bubble */
.chart-container {
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}

.swal-custom-popup {
    border-radius: 14px !important;
    font-family: 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
}

.swal-custom-title {
    font-size: 17px !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
}

.swal-custom-confirm, .swal-custom-cancel {
    border-radius: 8px !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
}

.chatbot-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(94vh - 58px);
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
}

.chatbot-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ── Header ── */
.chat-header {
    background: #075dac;
    /* background: linear-gradient(135deg, #00786c, #005a52); */
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.chat-header small {
    font-size: 11px;
    opacity: 0.8;
}

.online-dot {
    width: 9px;
    height: 9px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ── Chips ── */
.chip-section {
    background: #f8fffe;
    border-bottom: 1px solid #e8f5f3;
    padding: 10px 16px 8px;
    flex-shrink: 0;
}

.chip-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}

.chip {
    background: white;
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1px solid;
}

.chip-teal {
    border-color: #00786c;
    color: #00786c;
}

    .chip-teal:hover {
        background: #00786c;
        color: white;
    }

.chip-blue {
    border-color: #0066cc;
    color: #0066cc;
}

    .chip-blue:hover {
        background: #0066cc;
        color: white;
    }

.chip-purple {
    border-color: #7b2fbe;
    color: #7b2fbe;
}

    .chip-purple:hover {
        background: #7b2fbe;
        color: white;
    }

.chip-orange {
    border-color: #d97706;
    color: #d97706;
}

    .chip-orange:hover {
        background: #d97706;
        color: white;
    }

/* ── History badge ── */
.history-bar {
    background: #f0faf9;
    border-bottom: 1px solid #d0ece9;
    padding: 4px 16px;
    font-size: 11px;
    color: #666;
    display: none;
    flex-shrink: 0;
}

    .history-bar span {
        color: #00786c;
        font-weight: 600;
    }

/* ── Messages ── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: #f5f7f9;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 9px;
}

    .msg-row.user {
        flex-direction: row-reverse;
    }

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.msg-row.bot .msg-avatar {
    background: #00786c;
    color: white;
}

.msg-row.user .msg-avatar {
    background: #6c757d;
    color: white;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.65;
    word-break: break-word;
    white-space: normal;
}

.msg-row.bot .msg-bubble {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    color: #2d3748;
}

.msg-row.user .msg-bubble {
    background: #075dac;
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-time {
    font-size: 10px;
    color: #aaa;
    margin-top: 3px;
}

.msg-row.bot .msg-time {
    text-align: left;
}

.msg-row.user .msg-time {
    text-align: right;
}

/* ── Typing ── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

    .typing-indicator span {
        width: 7px;
        height: 7px;
        background: #00786c;
        border-radius: 50%;
        animation: bounce 1.2s infinite;
    }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* ── Input ── */
.chat-input-area {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 12px 14px;
    display: flex;
    gap: 9px;
    align-items: flex-end;
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13.5px;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 110px;
    overflow-y: auto;
    line-height: 1.5;
    font-family: 'Segoe UI', sans-serif;
}

    #chatInput:focus {
        border-color: #075dac;
        /* box-shadow: 0 0 0 3px rgba(0,120,108,0.12); */
    }

#sendBtn {
    background: #075dac;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    height: 42px;
}

    #sendBtn:hover {
        background: #075dac;
    }

    #sendBtn:disabled {
        background: #a0aec0;
        cursor: not-allowed;
    }

#clearBtn {
    background: #f7fafc;
    color: #718096;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13px;
    cursor: pointer;
    height: 42px;
    transition: background 0.2s;
}

    #clearBtn:hover {
        background: #edf2f7;
    }

.chatlog-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: white;
    color: #075dac;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

    .chatlog-btn:hover {
        background-color: white;
        color: #075dac;
    }


/* Add these styles after your existing CSS */

.msg-bubble-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.65;
    word-break: break-word;
    white-space: normal;
    position: relative;
}

/* Copy button styles */
.copy-btn {
    position: absolute;
    bottom: 4px;
    right: 8px;
    background: transparent;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
    z-index: 10;
}

.msg-row:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.msg-row.user .copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.copy-btn.copied {
    color: #48bb78;
}

.copy-btn i {
    font-size: 12px;
}

/* Adjust bubble padding to make room for copy button */
.msg-row.bot .msg-bubble {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    color: #2d3748;
    padding: 10px 30px 24px 14px; /* Added right and bottom padding */
}

.msg-row.user .msg-bubble {
    background: #075dac;
    color: white;
    border-bottom-right-radius: 4px;
    padding: 10px 30px 24px 14px; /* Added right and bottom padding */
}

.chip-small {
    font-size: 12px;
    padding: 4px 10px;
    line-height: 1.3;
    max-width: 100%;
    white-space: normal;
}


