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

body {
    font-family: Arial, sans-serif;
    background-color: #030303;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.messenger-container {
    width: 100%;
    max-width: 600px;
    height: 90vh;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messenger-header {
    padding: 15px;
    background-color: #0084ff;
    color: white;
    text-align: center;
}

.messages-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    padding: 10px;
}

#messages-container {
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 70%;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-sent {
    align-self: flex-end;
    background-color: #0084ff;
    color: white;
    margin-left: auto;
}

.message-received {
    align-self: flex-start;
    background-color: #e4e6eb;
    color: black;
    margin-right: auto;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.messenger-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e4e6eb;
    background-color: white;
}

#message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
}

#send-button {
    background-color: #0084ff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 15px;
    cursor: pointer;
}

#loading-indicator {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 132, 255, 0.3);
    border-radius: 50%;
    border-top-color: #0084ff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Media queries for mobile responsiveness */
@media (max-width: 480px) {
    .messenger-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .message {
        max-width: 80%;
    }
}
