/* chatbot.css */
.cb-trigger,
.cb-window {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

/* STAGE 1: Floating Trigger Button */
.cb-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.cb-trigger-bubble {
    background: #fff;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    position: relative;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    display: block;
}

.cb-trigger-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #fff transparent transparent;
    transform: translateX(-50%);
}

.cb-trigger-btn {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s;
    border: 4px solid #fff;
}

.cb-trigger-btn:hover {
    transform: scale(1.05);
}

/* STAGE 2 & 3: Main Chat Container */
.cb-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 380px;
    height: 580px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: cbSlideUp 0.3s ease-out;
}

@keyframes cbSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.cb-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cb-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cb-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 22px;
}

.cb-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.cb-title p {
    margin: 0;
    font-size: 11px;
    opacity: 0.8;
}

.cb-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    margin-top: 2px;
}

.cb-status i {
    color: #22c55e;
    font-size: 10px;
}

.cb-header-actions i {
    cursor: pointer;
    margin-left: 10px;
    font-size: 18px;
    opacity: 0.8;
    transition: 0.2s;
}

.cb-header-actions i:hover {
    opacity: 1;
}

/* Chat Body */
.cb-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#cb-stage2 {
    display: block;
}

#cb-stage3 {
    display: none;
    flex-direction: column;
    height: 100%;
}

/* STAGE 2 Menu */
.cb-greeting {
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
}

.cb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.cb-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: 0.2s;
}

.cb-item:hover {
    background: #f8fafc;
    border-color: #2563eb;
    color: #2563eb;
}

.cb-item i {
    font-size: 20px;
}

.cb-pop-header {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
    margin-bottom: 10px;
    position: relative;
}

.cb-pop-header span {
    background: white;
    padding: 0 10px;
    position: relative;
    top: -10px;
}

.cb-pop-item {
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
}

.cb-pop-item:hover {
    border-color: #2563eb;
    background: white;
}

.cb-pop-item i {
    color: #9ca3af;
}

/* STAGE 3 Chat */
.cb-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 10px;
}

.cb-msg {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.cb-msg.bot {
    background: #f1f5f9;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border-top-left-radius: 12px;
}

.cb-msg.user {
    background: #2563eb;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    border-top-right-radius: 12px;
}

.cb-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
    display: block;
}

.cb-msg.user .cb-time {
    color: #bfdbfe;
}

.cb-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.cb-chip {
    border: 1px solid #2563eb;
    color: #2563eb;
    background: white;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.cb-chip:hover {
    background: #2563eb;
    color: white;
}

/* Footer & Input */
.cb-input-area {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 0 0 20px 20px;
    gap: 10px;
}

.cb-input-area input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
    background: transparent;
}

.cb-input-area i {
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
}

.cb-input-area i.send-icon {
    color: #2563eb;
    background: #eff6ff;
    padding: 8px;
    border-radius: 50%;
    margin-left: 5px;
    transition: 0.2s;
}

.cb-input-area i.send-icon:hover {
    background: #2563eb;
    color: white;
}

.cb-footer {
    text-align: center;
    font-size: 10px;
    color: #9ca3af;
    padding: 10px 0;
    background: white;
    border-radius: 0 0 20px 20px;
    border-top: 1px solid #f3f4f6;
}

@media (max-width: 480px) {
    .cb-window {
        width: 320px;
        bottom: 100px;
        right: 10px;
    }

    .cb-trigger {
        right: 10px;
    }
}