/* chat_room.css */

body {
    background: linear-gradient(135deg, #f0e6ff, #e0f6ff, #ffe0e6); /* Light, gentle gradient */
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.chat-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.chat-box {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px; /* Wider for chat */
    display: flex;
    flex-direction: column;
    height: 80vh; /* Make chat box taller */
    box-sizing: border-box;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.chat-header h2 {
    color: #3f51b5;
    margin: 0;
    font-size: 1.8em;
}

.action-button {
    padding: 8px 15px;
    background: linear-gradient(to right, #3f51b5, #5c6bc0);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px; /* For scrollbar */
}

.message-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.message-item .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
}

.message-item .username {
    font-weight: bold;
    color: #3f51b5;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.message-item .text {
    background-color: #e0f7fa; /* Light blue bubble */
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 600px;
    word-wrap: break-word;
    font-size: 1em;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.message-item .timestamp {
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

.message-input-area {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.message-input-area input[type="text"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1em;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease;
}

.message-input-area input[type="text"]:focus {
    border-color: #3f51b5;
    outline: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-box {
        height: 90vh;
        padding: 15px;
    }

    .chat-header h2 {
        font-size: 1.5em;
    }

    .action-button {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    .message-input-area {
        flex-direction: column;
        gap: 8px;
    }

    .message-input-area input[type="text"] {
        border-radius: 10px;
    }

    .message-input-area button {
        width: 100%;
    }
}
