﻿/* Floating chat icon */
.visitor-chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Chat box */
.visitor-chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    max-height: 500px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: none;
    flex-direction: column;
    justify-content: space-between; /* 👈 ensures header top, input bottom */
    z-index: 9999;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    overflow: hidden; /* 👈 prevents scrollbars outside messages */
}

    /* Chat header */
    .visitor-chat-box .chat-header {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border-bottom: 1px solid #ddd;
        font-weight: bold;
    }

    /* Messages container */
    .visitor-chat-box .messages-container {
        flex: 1; /* 👈 fill remaining height between header and input */
        overflow-y: auto;
        padding: 10px;
        display: flex;
        flex-direction: column;
    }

/* Chat bubbles */
.bubble {
    padding: 6px 10px;
    border-radius: 15px;
    margin-bottom: 5px;
    max-width: 80%;
    word-break: break-word;
    color: white;
}

/* Visitor messages on the right */
.msg-user {
    display: flex;
    justify-content: flex-end;
}

    .msg-user .bubble {
        background-color: #6c757d;
        border-radius: 15px 15px 0 15px;
    }

/* Staff/System messages on the left */
.msg-staff {
    display: flex;
    justify-content: flex-start;
}

    .msg-staff .bubble {
        background-color: #0d6efd;
        border-radius: 15px 15px 15px 0;
    }

/* Chat input container fixed at bottom */
.chat-input-container {
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 5px;
    border-top: 1px solid #ddd; /* 👈 add divider line */
    background-color: #f8f9fa; /* 👈 subtle background */
}

.chat-input-container button {
    background: linear-gradient(90deg, #007bff, #6610f2);
    border: none;
    color: white;
}

/* Visitor Info Form styling */
#visitorInfoForm {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
}

    #visitorInfoForm input.form-control,
    #visitorInfoForm button.btn {
        width: 100%;
        box-sizing: border-box;
    }

    #visitorInfoForm .mb-3 {
        margin-bottom: 10px;
    }

    #visitorInfoForm input.form-control {
        font-size: 14px;
        padding: 8px 10px;
    }
