body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #2b2b2b;
    color: #e0e0e0;
    height: 100%;
    overflow: hidden;
}

.chat-live-data-table, .chat-box {
    width: 100%;
    max-width: 800px;
}

.chat-title {
    text-align: center;
    color: #ff9800;
    margin-bottom: 10px;
}

#messages {
    height: 400px;
    overflow-y: auto;
    padding-bottom: 10px;
    box-sizing: border-box;
    background-color: #1a1a1a;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Adjusted message container to ensure stacking */
.message {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align content to start */
    margin-bottom: 10px; /* Space between message groups */
}

/* Added margin-left to message-group */
.message-group {
    margin-left: 25px; /* Margin for message group to align with profile image */
}

/* Profile image circle */
.profile-image {
    width: 18px; /* 50% smaller than original size */
    height: 18px;
    border-radius: 50%;
    background-color: #ff9800; /* Default color, will adjust dynamically */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px; /* Adjusted font size to fit the smaller profile image */
    margin-left: 5px;
    flex-shrink: 0; /* Prevent it from shrinking */
}

/* Example of dynamic colors for profile images based on username */
.self .profile-image {
    background-color: #03a9f4; /* Blue for self messages */
}

.other .profile-image {
    background-color: #FFB74D; /* Orange for other users */
}

/* Adjusted message content to ensure stacking */
.message-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Updated message bubble colors with gradients */
.self .message-bubble {
    background: linear-gradient(135deg, #03a9f4, #0288d1); /* Gradient for self messages */
    color: #fff;
}

.other .message-bubble {
    background: linear-gradient(135deg, #FFB74D, #FFA726); /* Gradient for other messages */
    color: #fff;
}

/* Adjusted message bubble to ensure proper alignment */
.message-bubble {
    font-size: 14px;
    margin-bottom: 3px;
    padding: 6px;
    border-radius: 6px;
    word-wrap: break-word;
    max-width: fit-content; /* Ensure the bubble is only as wide as the content */
}

.message-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 12px; /* Adjusted to differentiate from bet bubbles */
}

.message-user {
    white-space: nowrap; /* Prevent wrapping */
    color: #fff; /* White text for the username */
}

.message-timestamp {
    white-space: nowrap; /* Prevent wrapping */
    color: #777; /* Grey text for the timestamp */
    font-weight: normal; /* Not bold */
    font-style: italic; /* Italics for the timestamp */
}

.bet-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bet-container .bet-bubble {
    white-space: nowrap; /* Prevent bet text from wrapping within the div */
}

/* Subdued colors for bet bubbles with gradients */
.bet-bubble {
    padding: 1px 2px;
    border-radius: 4px;
    font-size: 10px; /* Smaller font size than username/time */
    display: inline-block;
    margin-left: 5px;
    border: 2px solid;
    color: #fff;
    font-weight: bold;
}

/* Define border color, no fill, and matching text color for different bet types */
.bet-moneyline {
    border-color: #66bb6a;
    color: #66bb6a; /* Matching text color */
    background: none; /* No background fill */
}

.bet-spread {
    border-color: #8e24aa;
    color: #8e24aa; /* Matching text color */
    background: none; /* No background fill */
}

.bet-over_under {
    border-color: #ffa726;
    color: #ffa726; /* Matching text color */
    background: none; /* No background fill */
}

/* Adjusted chat input background and button colors */
#message-input {
    flex: 1;
    padding: 10px;
    background-color: #424242;
    color: #fff;
    border: 1px solid #777;
    border-radius: 4px 0 0 4px;
    box-sizing: border-box;
    font-size: 16px;
}

#chat-form {
    display: flex;
    background-color: #2b2b2b;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

#chat-form button {
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, #ff9800, #e68900);
    color: #fff;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    font-size: 16px;
}

#chat-form button:hover {
    background: linear-gradient(135deg, #e68900, #d77d00);
}

/* Disabled input styling for logged-out users */
#chat-form.login-prompt #message-input {
    background-color: #4a4a4a;
    color: #777;
    cursor: not-allowed;
}

#chat-form.login-prompt button {
    background-color: #03a9f4;
}

#chat-form.login-prompt button:hover {
    background-color: #0288d1;
}

@media (max-width: 768px) {
    .chat-live-data-table, .chat-box {
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
    }

    #messages {
        height: calc(100vh - 200px);
    }

    #message-input {
        padding: 12px;
        font-size: 18px;
    }

    #chat-form button {
        padding: 12px;
        font-size: 18px;
    }
}
