@import 'https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css';

/* Custom styles */
.chat-container {
    height: calc(100vh - 128px);
    display: flex;
    flex-direction: column;
    margin-top: 64px;
    margin-bottom: 64px;
}

.message {
    max-width: 70%;
}

.user-message {
    background-color: #e2e8f0;
}

.bot-message {
    background-color: #4a5568;
    color: white;
}

/* Theme styles */
body.light {
    background-color: #f3f4f6;
    color: #1f2937;
}

body.dark {
    background-color: #1a202c;
    color: #e2e8f0;
}

body.dark .bg-white,
body.dark .bg-gray-100 {
    background-color: #2d3748;
}

body.dark .text-gray-300 {
    color: #e2e8f0;
}

body.dark .user-message {
    background-color: #4a5568;
    color: #e2e8f0;
}

body.dark .bot-message {
    background-color: #14181f;
    color: #e2e8f0;
}

/* Message density styles */
.density-compact .message {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.density-comfortable .message {
    padding: 1rem;
    margin-bottom: 1rem;
}

.density-spacious .message {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Formatted message styles */
.message p {
    margin-bottom: 0.5em;
}

.message ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 0.5em;
}

.message pre {
    background-color: #2d3748;
    padding: 1em;
    border-radius: 0.25em;
    overflow-x: auto;
    margin-bottom: 0.5em;
}

.message code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
}

.message pre code {
    background-color: transparent;
    padding: 0;
}

body.dark .message pre {
    background-color: #1a202c;
}

body.dark .message code {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Model dropdown styles */
#model-select {
    color: #1f2937;
    background-color: #ffffff;
    border-color: #e2e8f0;
}

body.dark #model-select {
    color: #e2e8f0;
    background-color: #2d3748;
    border-color: #4a5568;
}

#model-select option {
    color: #1f2937;
    background-color: #ffffff;
}

body.dark #model-select option {
    color: #e2e8f0;
    background-color: #2d3748;
}

/* Fixed header and footer styles */
header, footer {
    position: sticky;
    left: 0;
    right: 0;
    z-index: 10;
}

header {
    top: 0;
}

footer {
    bottom: 0;
}

/* Ensure chat messages area is scrollable */
#chat-messages {
    overflow-y: auto;
    max-height: calc(100vh - 204px);
}

/* Hide scrollbar for WebKit browsers */
#chat-messages::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Firefox */
#chat-messages {
    scrollbar-width: none;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .chat-container {
        height: calc(100vh - 112px);
        margin-top: 56px;
        margin-bottom: 56px;
    }

    #sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: 100%;
        z-index: 40;
        transform: translateX(-100%);
    }

    #sidebar.active {
        transform: translateX(0);
    }

    #chat-messages {
        max-height: calc(100vh - 180px);
        padding: 0.5rem;
    }

    .message {
        max-width: 85%;
        font-size: 1rem;
        line-height: 1.5;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    #chat-form {
        padding: 0.5rem;
    }

    #model-select, #chat-input, #chat-form button {
        font-size: 1rem;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    #chat-form button {
        width: 100%;
    }
}
