/* Chat Interface Styles */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 600px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Dark mode scrollbar */
.dark .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.5);
}

.dark .chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.7);
}

/* Message animations */
.chat-messages>div {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator animation */
.typing-indicator {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Input area */
.chat-input-area {
    border-top: 1px solid rgba(229, 231, 235, 1);
    padding: 1rem;
    background: white;
}

.dark .chat-input-area {
    border-top-color: rgba(55, 65, 81, 1);
    background: rgba(31, 41, 55, 1);
}

.chat-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(229, 231, 235, 1);
    border-radius: 0.5rem;
    resize: none;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dark .chat-input {
    background: rgba(55, 65, 81, 1);
    border-color: rgba(75, 85, 99, 1);
    color: white;
}

.dark .chat-input:focus {
    border-color: rgba(129, 140, 248, 1);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Send button */
.chat-send-button {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: rgba(99, 102, 241, 1);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send-button:hover:not(:disabled) {
    background: rgba(79, 70, 229, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.chat-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .chat-container {
        max-height: calc(100vh - 200px);
    }

    .chat-messages>div {
        max-width: 90% !important;
    }

    .chat-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* Code blocks in messages */
.chat-messages code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
}

/* Links in messages */
.chat-messages a {
    color: rgba(59, 130, 246, 1);
    text-decoration: underline;
}

.dark .chat-messages a {
    color: rgba(96, 165, 250, 1);
}