﻿/* 1. MAIN WRAPPER */
#rm-chatbot-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999999; /* Extra high to stay above everything */
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

/* 2. FLOATING ACTION BUTTON */
#chatbotBtn {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #1ebe5d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: 0.3s;
}

.status-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #00ff00;
    border: 2px solid white;
    border-radius: 50%;
}

/* 3. CHAT BOX - FIXED POSITIONING */
#chatbotBox {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 320px;
    max-width: 85vw; /* Never wider than 85% of phone screen */
    max-height: 75vh; /* Never taller than 75% of phone screen */
    background: white;
    border-radius: 15px;
    overflow: hidden; /* Clips the internal scrolling */
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: none; /* Controlled by JS */
    flex-direction: column; /* Stacks Header and Body */
}

/* 4. THE HEADER - LOCKED TO TOP */
.chatbot-header {
    background: #001B31;
    color: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0; /* FORCES Header to stay visible, never squishes */
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 34px;
    height: 34px;
    background: #c4161c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    border: 2px solid #fff;
    flex-shrink: 0; /* Keeps it circular */
}

.header-info strong {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds ... if name is too long */
}

#chatbotClose {
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    padding: 0 5px;
    flex-shrink: 0;
    line-height: 1;
}

/* 5. CHAT BODY - THE SCROLLING AREA */
.chatbot-body {
    padding: 15px;
    background: #f9f9f9;
    flex: 1; /* Fills remaining space in the box */
    overflow-y: auto; /* Internal scroll bar appears here */
    display: flex;
    flex-direction: column;
}

.welcome-msg {
    font-size: 13px;
    color: #444;
    margin-bottom: 10px;
}

.service-scroll {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-label {
    font-size: 10px;
    font-weight: 800;
    color: #999;
    margin: 10px 0 4px 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 6. BUTTON STYLES */
.chatbot-body button {
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #eee;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
    font-weight: 500;
}

    .chatbot-body button:hover {
        background: #f0f7ff;
        border-color: #0078d4;
        transform: translateX(4px);
    }

.btn-gold {
    background: #fffdf2 !important;
    border: 1px solid #ffd700 !important;
    color: #b8860b !important;
    font-weight: bold !important;
    border-left: 5px solid #ffd700 !important;
}

.btn-call {
    background: #0078d4 !important;
    color: white !important;
    font-weight: bold !important;
    text-align: center !important;
    animation: callPulse 2s infinite;
    margin-top: 15px;
    border: none !important;
}

/* 7. NOTIFICATION BUBBLE */
.chat-notice {
    position: absolute;
    right: 75px;
    bottom: 10px;
    background: white;
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    animation: bounce-left 2s infinite;
    /* CHANGE THIS LINE */
    pointer-events: auto !important;
    cursor: pointer;
}

    .chat-notice::after {
        content: '';
        position: absolute;
        right: -8px;
        top: 50%;
        transform: translateY(-50%);
        border-width: 8px 0 8px 8px;
        border-style: solid;
        border-color: transparent transparent transparent #fff;
    }
.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

#onlineStatusText {
    font-size: 10px;
    color: #00ff00;
    font-weight: bold;
}

.reply-time {
    font-size: 10px;
    color: #a5d6a7;
    font-style: italic;
}
/* 8. ANIMATIONS */
@keyframes bounce-left {
    0%, 100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-8px);
    }
}

@keyframes star-sparkle {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }
}

@keyframes callPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 120, 212, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 120, 212, 0);
    }
}

/* 9. TINY SCREEN TWEAKS */
@media screen and (max-width: 360px) {
    #chatbotBox {
        width: 280px;
        bottom: 70px;
    }

    .avatar {
        width: 30px;
        height: 30px;
    }

    .header-info strong {
        font-size: 12px;
    }
}