.chat-container {
    width: 100%;
    max-width: 800px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    background: linear-gradient(90deg, #4b6cb7, #182848);
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f5f7fa;
}

.message {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #4b6cb7, #182848);
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-message {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e1e5eb;
    border-bottom-left-radius: 5px;
}

.typing-indicator {
    display: inline-block;
    background: white;
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    border: 1px solid #e1e5eb;
    align-self: flex-start;
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    height: 8px;
    width: 8px;
    background: #999;
    display: inline-block;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.5s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e1e5eb;
    gap: 10px;
}

.model-select {
    flex: 0 0 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    outline: none;
}

.message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

.message-input:focus {
    border-color: #4b6cb7;
}

.send-button {
    flex: 0 0 80px;
    padding: 12px;
    background: linear-gradient(135deg, #4b6cb7, #182848);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.send-button:active {
    transform: translateY(0);
}

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

.ai-message .message-time {
    text-align: left;
}

@media (max-width: 600px) {
    .input-container {
        flex-wrap: wrap;
    }

    .model-select {
        flex: 1 0 100%;
        margin-bottom: 10px;
    }

    .message {
        max-width: 90%;
    }
}