/* GPT Import - Minimal Custom Styles */
/* Only styles for functionality not covered by Basecoat */

/* ============================================
   THEME TOGGLE (Required for theme switching)
   ============================================ */
.theme-icon-dark {
    display: none;
}

.dark .theme-icon-light {
    display: none;
}

.dark .theme-icon-dark {
    display: block;
}

/* ============================================
   SEARCH RESULTS DROPDOWN (Dynamic JS content)
   ============================================ */
#searchResults.show {
    display: block;
}

.search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: hsl(var(--accent));
}

.search-result-item .title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.search-result-item .snippet {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item .highlight {
    background-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
    padding: 0 0.125rem;
    border-radius: 0.125rem;
    font-weight: 500;
}

/* ============================================
   UPLOAD AREA (Drag & Drop functionality)
   ============================================ */
.upload-area.dragover {
    border-color: hsl(var(--primary));
    background: hsl(var(--accent));
}

/* ============================================
   MESSAGE STYLING (Chat view specific)
   ============================================ */
.message.user {
    background: hsl(var(--accent));
}

.message.assistant {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
}

.message-header .role-icon.user {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.message-header .role-icon.assistant {
    background: hsl(142 76% 36%);
    color: white;
}

/* ============================================
   MARKDOWN CONTENT (Rendered markdown)
   ============================================ */
.markdown-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.markdown-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.markdown-content blockquote {
    border-left: 4px solid hsl(var(--border));
    padding-left: 1rem;
    margin: 1rem 0;
    color: hsl(var(--muted-foreground));
}

.markdown-content pre {
    background: hsl(var(--muted));
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

/* ============================================
   FILE TREE (Exports page specific)
   ============================================ */
.file-tree-item.folder svg {
    color: hsl(48 96% 53%);
}

.file-tree-item.file svg {
    color: hsl(var(--primary));
}

/* ============================================
   CHAT LAYOUT (View conversation page)
   ============================================ */
.chat-container {
    padding: 1rem 0;
}

.chat-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-content .message-content {
    line-height: 1.7;
    font-size: 0.9375rem;
}

.chat-content .message-content p {
    margin-bottom: 0.75rem;
}

.chat-content .message-content p:last-child {
    margin-bottom: 0;
}

.chat-content .message-content pre {
    margin: 0.75rem 0;
    padding: 0.875rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.8125rem;
}

.chat-content .message-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
}

.chat-content .message-content ul,
.chat-content .message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.chat-content .message-content li {
    margin-bottom: 0.375rem;
}

.chat-content .message-content blockquote {
    border-left: 3px solid currentColor;
    padding-left: 0.875rem;
    margin: 0.75rem 0;
    opacity: 0.85;
}

/* User message specific styling */
.chat-row.flex-row-reverse .chat-content pre {
    background: rgba(255, 255, 255, 0.15);
}

.chat-row.flex-row-reverse .chat-content code:not(pre code) {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Assistant message specific styling */
.chat-row:not(.flex-row-reverse) .chat-content pre {
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
}

.chat-row:not(.flex-row-reverse) .chat-content code:not(pre code) {
    background: hsl(var(--background));
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* ============================================
   IMPORT PROGRESS (Multi-stage progress)
   ============================================ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.stage-dot {
    transition: all 0.3s ease;
}

/* Progress bar animation */
#progressBar {
    background: linear-gradient(
        90deg,
        hsl(var(--primary)) 0%,
        hsl(var(--primary) / 0.8) 50%,
        hsl(var(--primary)) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Upload area drag state */
#uploadArea.dragover {
    border-color: hsl(var(--primary));
    background: hsl(var(--accent));
    transform: scale(1.01);
}
