/* General container for the chat interface */
.chat-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* Chat log container */
.chat-log {
    height: 85vh;
    overflow-y: auto; /* Enable scrolling if needed */
    display: flex;
    flex-direction: column-reverse; /* Keep reversed layout */
    width: 100%;
    border: 1px solid #ddd; /* Light border */
    border-radius: 8px; /* Rounded corners */
    background-color: #f9f9f9; /* Light gray background */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    padding: 10px; /* Padding inside the log */
}

/* Keyframes for the message animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Individual chat messages */
.chat-message {
    margin: 10px 0; /* Space between messages */
    padding: 8px 12px; /* Padding inside the message box */
    border-radius: 6px; /* Rounded corners */
    background-color: #e7f0fd; /* Light blue for messages */
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for each message */
    font-size: 1rem; /* Standard font size */
    color: #333; /* Dark gray text for readability */
    word-wrap: break-word; /* Handle long messages gracefully */
    animation: fadeInUp 0.3s ease-out; /* Apply the animation */
}

    /* Styling for timestamps */
    .chat-message .timestamp {
        font-size: 0.8rem; /* Smaller font size for timestamps */
        color: #999; /* Light gray for timestamps */
        margin-right: 10px;
    }

    /* Styling for usernames */
    .chat-message .username {
        font-weight: bold; /* Bold usernames */
        color: #4e73df; /* Blue text to match the theme */
        margin-right: 5px;
    }

/* Message input area */
.message-input {
    width: 100%;
    max-width: 600px;
    display: flex; /* Arrange inputs side by side */
    gap: 10px; /* Space between inputs */
    align-items: flex-start;
    margin-top: 20px; /* Add spacing above the input area */
}

/* Username container for input and popup */
.username-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px; /* Space between input and popup */
}

/* Username input field */
.username-field {
    flex: 1;
    max-width: 120px; /* Limit width of username input */
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    outline: none; /* Remove default browser outline */
    transition: border 0.2s ease, box-shadow 0.2s ease; /* Smooth focus effect */
}

    /* Username field invalid styles */
    .username-field.invalid {
        border-color: red;
        box-shadow: 0px 0px 8px rgba(255, 0, 0, 0.5);
    }

/* Popup for username status */
.status-popup {
    font-size: 0.85rem;
    color: red;
    margin-top: 4px;
    display: none; /* Hidden by default */
}

/* Message input field container */
.message-box {
    flex: 4; /* Take remaining space */
    display: flex;
    align-items: center;
    border: 1px solid #ddd; /* Light border */
    border-radius: 6px; /* Rounded corners */
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Prevent text overflow */
    width: 100%; /* Full width */
}

    /* Input field inside the message box */
    .message-box input {
        flex: 1; /* Stretch input field */
        padding: 12px;
        border: none; /* Remove borders */
        outline: none; /* Remove browser default outline */
        font-size: 1rem;
    }

/* Send button */
.send-button {
    flex-shrink: 0; /* Prevent shrinking */
    background-color: #4e73df;
    color: #fff;
    border: none;
    padding: 8px 16px; /* Padding for better size */
    font-size: 1.2rem; /* Slightly larger font for emphasis */
    cursor: pointer;
    transition: background-color 0.3s ease; /* Smooth hover effect */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .send-button:hover {
        background-color: #3757c0; /* Darker blue on hover */
    }

/* Focused inputs */
.message-box input:focus,
.username-field:focus {
    border: 1px solid #4e73df; /* Blue border on focus */
    box-shadow: 0px 0px 8px rgba(78, 115, 223, 0.5); /* Subtle blue glow */
}
