* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Chat Popup Container */
.chat-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.chat-popup.active {
    display: flex;
}

/* Toggle Button */
.chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none !important;
    border-radius: 50%;
    padding: 15px;
    cursor: pointer;
    z-index: 1000;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    animation: bounce 1.5s infinite ease-in-out;

}

/* =================================================================*/
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Modified Chat Container */




.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}




#send-button{
    padding: 10px 20px;
    background: rgb(244, 245, 247);
    border: 5 solid #090979 ;
    border-radius: 5px;
    cursor: pointer;
}


.chat-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
}


.chat-container {
    width: 100%;
    height: 100%;
    
    border-radius: 10px; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #e9dddd;
}

.chat-header {
    background: rgb(1, 41, 161);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    height: 80px;
    
}

.chat-messages {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Default alignment for server messages */
    /* flex: 1; */
    overflow: auto;
    padding: 15px;
    background: rgb(255, 255, 255);
    margin: 5px;
    position: absolute;
    left: 5px;
    right: 5px;
    width: auto;
    top: 63px;
    z-index: 1000;
    height: 381px;
    border-radius: 10px;
    

}


.chat-input {
    background: #ffffff; /* Light gray background */
    display: flex;
    position: absolute;
    bottom: 0;
    width: 100%;
    /* padding: 10px; */
    border-top: 1px solid #ddd; /* Subtle separator */
    height: 45px;
     box-shadow: 0px -2px 8px rgba(0, 0, 0, 0.2);
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background-color: transparent;
    outline: none;
    font-size: 14px;
}

#send-button {
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button i {
    color: #0078FF; /* Blue send icon */
    font-size: 18px;
}


/* User Message - Aligned to Right */
.user-message {
    align-self: flex-end; /* Moves the user message to the right */
    background:  rgb(70, 113, 245);
    color: white;
    border-radius: 15px 15px 0 15px;
    display: inline-block; /* Keep width only as needed */
    max-width: 60%; /* Prevent stretching */
    padding: 10px 15px;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin-left: auto; /* Ensures it stays on the right */
}

/* Server Message - Aligned to Left */
.server-message {
    align-self: flex-start;
    background: rgba(1, 27, 108, 1);
    color: rgb(252, 248, 248);
    border-radius: 15px 15px 15px 0; 
    word-wrap: break-word;
}

/* General Message Container */
.message {
    margin-bottom: 15px;
    padding: 10px;
    /* border-radius: 5px; */
    max-width: 80%;
    font-size: 12px;
    font-family: Arial, sans-serif;
}



/* Mobile Responsiveness */
@media (max-width: 600px) {
    .chat-popup {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-toggle-btn {
        bottom: 10px;
        right: 10px;
    }

    .chat-container {
        border-radius: 0;
    }

    .chat-messages {
        height: calc(100vh - 120px) !important;
    }
}

@media (max-width: 390px) {
    #message-input {
        width: 75% !important;
    }
    
} 


.user-message {
    /* align-self: flex-end;  */
    background:  rgb(70, 113, 245);
    color: white;
    border-radius: 15px 15px 0 15px;
    display: inline-block; /* Keep width only as needed */
    max-width: 250px; /* Prevent stretching */
    padding: 10px 15px;
    word-wrap: break-word;
    /* white-space: pre-wrap; */
    margin-left: auto; /* Ensures it stays on the right */
}

/* Server Message - Aligned to Left */
.server-message {
    /* align-self: flex-start; */
    background: rgba(1, 27, 108, 1);
    color: rgb(252, 248, 248);
    border-radius: 15px 15px 15px 0; 
    word-wrap: break-word;
}
.server-message-outer {
    display: flex; /* Make it a flex container */
    flex-direction: row; /* Keep items in a row */
    align-items:flex-start; /* Align vertically */
    gap: 8px;
}
.user-message-outer {
    display: flex; /* Make it a flex container */
    flex-direction: row; /* Keep items in a row */
    align-items:flex-start;
    flex-direction: row-reverse; /* Align vertically */
    gap: 8px;
    align-self: flex-end;
}
.server-message-outer img {
    width: 40px; /* Fixed width */
    height: 40px; /* Fixed height */
    object-fit: contain; /* Maintain aspect ratio */
    flex-shrink: 0; /* Prevent shrinking in flex container */
}


.user-message-outer img {
    width: 30px;  /* Adjust size */
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
}