/* CSS reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* This ensures padding and border are included in the element's total width and height */
}


/* Shared styles */

body {
    font-family: Arial, sans-serif;
    background-color: #444;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 15px;
    margin: 3px auto;
    border-radius: 5px;
    box-shadow: 0px 0px 15px rgba(0,0,0,0.6);
    background-color: #242424;
    color: #BBB;
}

.vert-flex {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


/* Login page styles */

.login-page {
    height: 100vh;
    width: 100%;
}

.login-page input {
    margin: 5px;
}


/* Chat page styles */

.chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.chat-header {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.chat-header-buttons {
    margin-left: auto;
}

.chat-list {
    overflow-y: auto;
}

.chat-message {
    display: inline-block;
    max-width: 85%;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 10px;
    color: #222;
    overflow-wrap: break-word;
}

.my-message {
    background-color: #50A033; /* Dark green for your messages */
    align-self: flex-end;
}

.other-message {
    background-color: #BCBCBC; /* Light grey for other messages */
    align-self: flex-start;
}

.new-message-container {
    display: flex; /* Enable Flexbox */
    flex-direction: row;
    gap: 10px; /* Optional: adds space between elements */
}

.new-message-container textarea {
    flex-grow: 1; /* Allow textarea to take up all available space */
    font-size: 16px; /* Increase font size */
    resize: none; /* Disable manual resizing */
    overflow-y: auto; /* Add scroll functionality */
    max-height: 600px; /* Maximum height before scrolling */
    min-height: 20px; /* Minimum height */
}

.new-message-container button {
    white-space: nowrap; /* Ensure button text doesn't wrap */
}

.button {
    display: inline-block; /* Allows setting padding and dimensions */
    padding: 10px 15px; /* Size of the button */
    background-color: #007bff; /* Background color */
    color: white; /* Text color */
    text-align: center; /* Center the text */
    text-decoration: none; /* Remove underline from the link */
    border-radius: 5px; /* Rounded corners */
    border: none; /* Remove border */
    cursor: pointer; /* Change mouse cursor to pointer */
    transition: background-color 0.3s; /* Smooth transition for hover effect */
}

.button:hover {
    background-color: #0056b3; /* Darker shade for hover effect */
}


.timestamp {
    font-size: 0.8em;
    color: #333;
    margin-left: 10px;
}

#who-is-typing {
    color: #AAA;           /* Make the text color gray */
    margin-top: 10px;      /* Move the div down from the text entry box */
    font-style: italic;    /* Optional: make the text italic */
    font-size: 0.9em;      /* Optional: adjust the size of the text */
    text-align: left;      /* Optional: center the text horizontally */
}

/* Scrollbar styling */
/* Style the scrollbar track (background) */
::-webkit-scrollbar-track {
    background-color: #2e2e2e; /* Dark background for the track */
}

/* Style the scrollbar thumb (scrollable handle) */
::-webkit-scrollbar-thumb {
    background-color: #555; /* Darker color for the thumb */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 3px solid #2e2e2e; /* Match the track's color to create padding effect */
}

/* Style the scrollbar itself (width, height) */
::-webkit-scrollbar {
    width: 8px; /* Width of the vertical scrollbar */
    height: 8px; /* Height of the horizontal scrollbar */
}

/* For other non-WebKit browsers (optional, limited support) */
* {
    scrollbar-width: thin; /* 'auto' or 'thin' */
    scrollbar-color: #555 #2e2e2e; /* thumb and track color */
}
