/* Chat Drawer Styles - Shared component for multi-scope chat interface */

/* Drawer backdrop (overlay) */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer container (slides in from right) */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: white;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.drawer.open {
    transform: translateX(0);
}

/* Messages area (scrollable) */
.drawer-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}
.drawer-messages::-webkit-scrollbar {
    width: 6px;
}
.drawer-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

@media (max-width: 640px) {
    .drawer {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: 100lvh;
        border-radius: 0;
        transform: translateY(100%);
    }

    .drawer.open {
        transform: translateY(0);
    }

    #drawerChatForm {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    #drawerInput {
        font-size: 16px;
    }
}

/* Typing indicator animation */
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
.typing-dot {
    animation: pulse 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Markdown in chat messages */
.chat-markdown p { margin-bottom: 0.5em; }
.chat-markdown ul, .chat-markdown ol { margin-left: 1.5em; margin-bottom: 0.5em; }
.chat-markdown ul { list-style-type: disc; }
.chat-markdown ol { list-style-type: decimal; }
.chat-markdown li { margin-bottom: 0.25em; }
.chat-markdown code {
    background: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}
