/* chat-style.css */

.my-chat-container {
    max-width: 600px;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    overflow: hidden; /* Ensures rounded corners are respected */
}

.my-chat-messages {
    height: 400px; /* Fixed height for chat area */
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f8f8;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between messages */
}

.my-chat-message {
    display: flex;
    align-items: flex-start;
    position: relative;
}

.my-chat-message-content {
    max-width: 80%; /* Limit message bubble width */
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap; /* Preserve whitespace and breaks */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.my-chat-message-other .my-chat-message-content {
    background-color: #e2e2e2;
    color: #333;
    border-top-left-radius: 5px; /* Slightly different corner for other messages */
}

.my-chat-message-self {
    justify-content: flex-end;
}

.my-chat-message-self .my-chat-message-content {
    background-color: #007bff;
    color: #fff;
    border-top-right-radius: 5px; /* Slightly different corner for self messages */
}

.my-chat-username {
    display: block;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 3px;
    opacity: 0.7;
}

.my-chat-message-self .my-chat-username {
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

.my-chat-message-other .my-chat-username {
    color: #555;
    text-align: left;
}


.my-chat-timestamp {
    display: block;
    font-size: 0.7em;
    color: rgba(0, 0, 0, 0.4);
    margin-top: 5px;
    text-align: right;
}

.my-chat-message-self .my-chat-timestamp {
    color: rgba(255, 255, 255, 0.6);
}

.my-chat-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
    align-items: center;
}

.my-chat-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    margin-right: 10px;
    font-size: 1em;
    resize: none; /* Disable manual textarea resize */
    overflow: hidden; /* Hide scrollbar in textarea */
    min-height: 40px; /* Ensure input area has a minimum height */
    max-height: 100px; /* Limit input area expansion */
    transition: all 0.3s ease;
}

.my-chat-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.my-chat-send-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.my-chat-send-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.my-chat-send-button:active {
    background-color: #004085;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 123, 255, 0.4);
}

.my-chat-send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.my-chat-loading,
.my-chat-no-messages,
.my-chat-error,
.my-chat-login-prompt {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}
