/* Chat specific styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.message.user-message {
    justify-content: flex-end;
}

.message.ai-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 1rem;
    border-radius: 12px;
    line-height: 1.5;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
    white-space: pre-wrap;
}

.message-content p:not(:last-child) {
    margin-bottom: 0.5rem;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    max-width: 70%;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat input */
.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
}

#messageInput::placeholder {
    color: #999;
}

#sendButton {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

#sendButton:hover:not(:disabled) {
    background: #005fa3;
    transform: translateY(-1px);
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#sendButton svg {
    transform: rotate(90deg);
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 150px);
        margin: 0 1rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-messages {
        padding: 0.5rem;
    }
    
    .chat-input-container {
        padding: 0.5rem;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error message */
.error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Success message */
.success-message {
    background: #efe;
    color: #363;
    border: 1px solid #cfc;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
} 