/* General page styles */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #333;
    overflow: hidden;
    height: 100vh; /* Prevent vertical scroll */
    width: 100vw; /* Prevent horizontal scroll */
}

/* Main content container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    
}

/* Header styling */
h1 {
    font-size: 18px;
    text-align: left;
    margin-bottom: 10px;
}

h4 {
    font-size: 10px;
    text-align: left;
    margin-bottom: 10px;
}


/* Chat interface styling */
.imessage-conversation {
    background-color: #ffffff;  /* Set background color */
    border-radius: 10px;  /* Round the corners */
    padding: 30px 20px 50px 20px;  /* Increased right padding for better spacing */
    margin-top: 30px;
    margin-bottom: 10px;
    max-height: 75vh;  /* Limit height */
    overflow-y: auto;  /* Enable scrolling */

    /* Smooth scrolling for Safari */
    -webkit-overflow-scrolling: touch;

    /* Firefox-specific scrollbar settings */
    scrollbar-width: thin;  /* Reduce scrollbar width */
    scrollbar-color: #999 transparent;  /* Set scrollbar color */

    /* Hide scrollbar by default */
    overflow-y: scroll;
}

/* WebKit Browsers (Chrome, Safari, Edge) - Custom Scrollbar */
.imessage-conversation::-webkit-scrollbar {
    width: 6px;  /* Set a thinner scrollbar width */
    height: 6px;  /* Ensure a smaller horizontal scrollbar */
}

/* Scrollbar thumb (draggable part) */
.imessage-conversation::-webkit-scrollbar-thumb {
    background: #999;  /* Grey color for visibility */
    border-radius: 10px;  /* Rounded scrollbar */
}

/* Scrollbar track (background area) */
.imessage-conversation::-webkit-scrollbar-track {
    background: transparent;  /* Keep track invisible */
}

/* Hide scrollbar when not scrolling */
.imessage-conversation::-webkit-scrollbar {
    display: none;
}

/* Show scrollbar only when hovering */
.imessage-conversation:hover::-webkit-scrollbar {
    display: block;
}

/* Hide scrollbar in Safari unless scrolling */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) { 
        .imessage-conversation {
            scrollbar-width: none; /* Hide default scrollbar */
        }
    }
}


.conversation-title {
    font-size: 18px;
    margin: 10px 0;
    padding: 5px;
    background-color: #dcdcdc;
    color: #333;
    text-align: center;
    border-radius: 5px;
}

/* Message wrapper for alignment */
.message-wrapper {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
    
}

.message-wrapper.mine {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* This aligns the child elements (message and details) to the right */
}

/* Adjust alignment for details in 'other' and 'bot' messages */
.message-wrapper.other {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* This aligns the child elements (message and details) to the left */
}

.message-wrapper.bot {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* This aligns the child elements (message and details) to the left */
}

.message-wrapper.delayed {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}


/* Add a container for details below the message bubble ------------------------------------------------ */
.message-details {
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    color: #757575;
    margin-top: 4px; /* Space between the message and details */
}

/* Align nickname and timestamp for user messages */
.message-wrapper.mine .message-details {
    align-items: flex-end;
    text-align: right;
}

/* Align nickname and timestamp for bot/other messages */
.message-wrapper.other .message-details,
.message-wrapper.bot .message-details {
    align-items: flex-start;
    text-align: left;
}
.message-wrapper:after {
    content: "";
    display: table;
    clear: both;
}




/* Message bubble styling ------------------------------------------------------------------------------------------------*/
.message {
    padding: 8px 13px; /* Consistent padding around the text */
    border-radius: 18px; /* Rounded corners for the bubble */
    max-width: 70%; /* Maximum width for the bubble */
    word-wrap: break-word; /* Ensure long words do not overflow */
    position: relative; /* For positioning the pseudo-elements */
}

/* Style for 'mine' messages */
.mine .message {
    background-color: #1D8BFF;
    color: #fff;
    border-bottom-right-radius: 2px; /* Adjusted corner for the callout effect */
}

#start-chat {
    width: auto;
    height: 40px;
}

/* Style for 'other' and 'bot' messages */
.other .message {
    background-color: #b6b2b2;
    color: #333232;
    border-bottom-left-radius: 2px; /* Adjusted corner for the callout effect */
}

/* Style specifically for 'bot' messages */
.bot .message {
    background-color: #F5F7F9;
    color: #333333;
    border-bottom-left-radius: 2px; /* Adjusted corner for the callout effect */
}


/* Avatar styling ------------------------------------------------------------------------------------------------*/
.imessage-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e1e1e1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
}

.imessage-avatar img {
    max-width: 100%;
    border-radius: 50%;
}

/* Navigation and header styling ------------------------------------------------------------------------------------------------*/
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 20px 5px 20px;
}

.header-logo {
    width: auto;
    height: 60px;
}

.header-chat-logo {
    width: auto;
    height: 60px;
}


.header {
    background-color: #FFF0F6;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}


.header-title {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.header-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
}

.header-close:hover {
    color: #F0F2F5;
}


.footer {
    background-color: #FFF0F6;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}


#chat-form {
    flex-grow: 1; /* Takes up as much space as possible */
    display: flex;
    flex-direction: row;
    align-items: center; /* Aligns input and button vertically in the center */
}
.input-group, #nickname-prompt {
    display: flex;
    flex-grow: 1;
    padding: 5px;
    background-color: #ffffff;
    border-radius: 18px;
    align-items: center;
    
}

.input-group:focus-within {
    border-color: #007AFF; /* This changes the border color on focus */
    /* No need to adjust padding since border-width remains the same */
}

#message-input {
    flex-grow: 1;
    font-family: 'Roboto', sans-serif;
    border: none; /* Ensure border is none to remove any default styles */
    padding: 5px; /* Maintain padding consistency */
    font-size: 16px;
    max-height: 200px;
    overflow-y: auto;
    resize: none;
    background-color: transparent;
    outline: none; /* Remove the default focus outline */
}



#initiator-nickname {
    flex-grow: 1;
    font-family: 'Roboto', sans-serif;
    border: none; /* Ensure border is none to remove any default styles */
    padding: 5px; /* Maintain padding consistency */
    font-size: 16px;
    background-color: transparent;
    outline: none; /* Remove the default focus outline */
    /* No need for width: calc(100% - 30px); as flex-grow will take care of the available space */
}

.message-info.nickname {
    font-size: 0.7rem; /* Slightly larger than timestamp */
    font-weight: bold;
}

.message-info.timestamp {
    font-size: 0.5rem; /* Smaller than nickname */
    color: #757575; /* Grey for subtle look */
}


.send-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
    justify-content: space-between; /* Adjust spacing between children */

}


#send-button {
    background-image: url('/images/send_blue.svg'); /* Path to your image */
    background-color: transparent; /* Transparent background */
    height: 30px; /* Height of the button */
    width: 30px; /* Width of the button */
    border: none; /* Remove border */
    cursor: pointer; /* Change cursor to pointer on hover */
    background-size: cover; /* Cover the entire area of the button */
    background-repeat: no-repeat; /* Do not repeat the image */
    outline: none; 
}

p {
    display: block;
    margin-block-start: 5px;
    margin-block-end: 5px;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    unicode-bidi: isolate;
}


.settings-container {
    display: flex;
    font-size: 0.7rem;
    justify-content: flex-end;
    padding: 0px 10px 20px 10px;
}

.new-message-indicator {
    display: none; /* Hidden by default */
    position: absolute; /* Position it absolutely */
    bottom: calc(100% + 20px); /* Distance from the bottom */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Center horizontally */
    background-color: rgba(0, 123, 255, 0.9); /* Semi-transparent blue background */
    color: #ffffff; /* White text */
    padding: 10px 20px; /* Some padding for aesthetics */
    border-radius: 5px; /* Rounded corners */
    cursor: pointer; /* Change cursor to pointer to indicate it's clickable */
    z-index: 1000; /* Ensure it sits above other content */
}


/* You might want to add some hover effect for better UX */
.new-message-indicator:hover {
    background-color: #0056b3; /* A slightly darker blue */
}

.hidden {
    display: none;
}


  /* Modal base styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */


}

/* Modal Content */
.modal-content {
    background-color: #fefefe;
    max-width: 500px;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 2px solid #888;
    border-radius: 10px;
    width: 80%; /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.icon-button {
    background-image: url('/images/logo.png'); /* Default icon */
    border: none;
    cursor: pointer;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain; /* Adjust the background size */
}

#settingsBtn {
    background-image: url('/images/settings.png');
    width: 30px; /* Adjust as needed */
    height: 30px; /* Adjust as needed */
    margin: 0 0 0 10px; /* Adjust the margin as needed */
}

#ShareBtn {
    background-image: url('/images/share.png');
    width: 20px; /* Adjust as needed */
    height: 20px; /* Adjust as needed */
}

.header-logo-link {
    text-decoration: none; /* This removes the underline */
}

.header-logo-link h1 {
    color: rgb(67, 67, 67); /* This ensures the header color matches the surrounding text or specified color */
}


.nickname-prompt-container {
    position: relative;
    display: flex;
    align-items: center;
}
.arrow-container {
    position: absolute;
    right: 100%;
    margin-right: 10px;
}
.pulsating-arrow {
    color: #1D8BFF;
    font-size: 24px;
    animation: pulse 1.5s infinite;
    transform: rotate(0deg);
}
@keyframes pulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(0deg) scale(2); }
    100% { transform: rotate(0deg) scale(1); }
}
