:root {
    --color-7: #36024a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Arial', sans-serif;
}

.fa, .fas {
    font-size: 1.2rem;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

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

.chat-header {
    background-color: var(--color-7);
    color: white;
    padding: 15px;
    text-align: center;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #e9ebee;
    position: relative;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 75%;
    word-wrap: break-word;
    transition: background-color 0.2s ease;
}

.message.sent {
    background-color: var(--color-7);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.message.received {
    background-color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.message.highlight {
    opacity: 0.8;
}

.username {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
    align-self: flex-start;
}

.username.sent {
    align-self: flex-end;
    color: var(--color-7);
}

.chat-footer {
    display: flex;
    padding: 20px;
    background-color: #f8f9fa;
    width: 100%;
}

.chat-footer .input-group {
    display: flex;
    width: 100%;
}

.chat-footer input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 2rem 0 0 2rem;
    margin-right: 10px;
    font-size: large;
}

.chat-footer button {
    padding: 10px 20px;
    background-color: var(--color-7);
    color: white;
    border: none;
    border-radius: 0 2rem 2rem 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-footer button:hover {
    background-color: #0056b3;
}

.chat-footer button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    visibility: hidden;
}

.modal.show {
    visibility: visible;
}

.modal-content {
    background-color: rgb(240, 240, 240);
    border-radius: 10px;
    width: 100%;
    max-width: 350px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content h5 {
    margin-bottom: 20px;
    font-size: 1em;
}

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

.modal-content .btn {
    padding: 10px 20px;
    background-color: var(--color-7);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

#username-error {
    display: block;
    margin: 10px 0;
    text-align: center;
}

.message {
    max-width: 80%; 
    word-wrap: break-word; 
}

.timestamp {
    display: block;
    font-size: 0.8em;
    color: #c2c2c2;
    text-align: right;
    margin-top: 5px;
}

.new-messages-alert {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 100;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        transform: translateX(-50%) scale(1);
    }
}