body {
    background: linear-gradient(135deg, #1e1e2f, #252542);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: "Poppins", sans-serif;
}

.chat-container {
    width: 400px;
    background: #1f1f3a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #ff00ff;
    position: relative;
}

/* Ensure the chat container and footer are aligned */
.chat-container {
    margin-bottom: 0;
}

footer {
    margin-bottom: -700px;
    margin-left: -400px;
    padding-top: 20px; /* Adjust as needed */
    border-top: 1px solid #444; /* Optional, for a visual separator */
}

.chat-header {
    background: #ff00ff;
    color: white;
    padding: 15px;
    text-align: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    font-weight: bold;

}

.chat-messages {
    height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #2a2a4a;
}

.message {
    border-radius: 10px;
    max-width: 75%;
    padding: 12px;
    border-radius: 15px;
    margin: 5px 10px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.message.sent {
    align-self: flex-end;
    background: #ff00ff;
    color: white;
    border-top-right-radius: 0;
}

.message.received {
    align-self: flex-start;
    background: #e4e6eb;
    color: black;
    border-top-left-radius: 0;
}

.message.received strong {
    color: #ff00ff;
}

.message-timestamp {
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0.7;
}

.typing-indicator {
    display: none;
    background-color: #f1dede;
    text-align: left;
    font-size: 12px;
    padding: 5px 15px;
}

.chat-input {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: #1f1f3a;
    border-bottom-left-radius: 20px;
}

.chat-input input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ff00ff;
}

.chat-input button {
    margin-left: 5px;
    background: #ff00ff;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}


.dark-mode {
    background-color: #181818;
    color: white;
}

.dark-mode .chat-container {
    background: #242424;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.dark-mode .chat-header {
    background: #333;
}

.dark-mode .message.sent {
    background: #333;
}

.dark-mode .message.received {
    background: #444;
}

.dark-mode .chat-input {
    background: #242424;
}

.dark-mode .message-timestamp {
    color: #ccc;
}

.message-container {
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 50%;
}

.message.sent .avatar {
    margin-left: 10px;
    order: 2;
}

.message.received .avatar {
    order: 0;
}
.username-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.modal-content input {
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.modal-content button {
    width: 50%;
    padding: 10px;
    background: #ff00ff;
    color: white;
    border: none;
    cursor: pointer;
}

.modal-content button:hover {
    background: #e766e7;
}

/* Ensure clear button is clickable in laptop view */
.clear-chat {
    z-index: 1;
}
