/* Oryxen Chat Interface v2 - Fixed Scrolling */

:root {
    --oryxen-teal: #14b8a6;
    --oryxen-teal-dark: #0d9488;
    --oryxen-teal-light: #5eead4;
    --oryxen-yellow: #fbbf24;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-sidebar: #f9fafb;
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-accent: #14b8a6;
    
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    --sidebar-width: 280px;
    --header-height: 60px;
    --input-height: auto;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header .logo {
    height: 32px;
    display: block;
}

.e2ee-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--oryxen-teal) 0%, var(--oryxen-teal-dark) 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
}

.e2ee-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.e2ee-icon {
    font-size: 10px;
}

.e2ee-text {
    letter-spacing: 0.3px;
}

.logo {
    height: 32px;
    width: auto;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.section {
    margin-bottom: 1.5rem;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.model-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.model-select:focus {
    outline: none;
    border-color: var(--oryxen-teal);
}

/* Token Stats */
.token-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.stat-icon {
    font-size: 1rem;
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
}

.stat-row.total .stat-value {
    color: var(--oryxen-teal);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    font-size: 1rem;
    line-height: 1;
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 0.375rem 0.5rem;
}

.btn-text:hover {
    color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.credits {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.credit-icon {
    font-size: 1rem;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-primary);
}

/* Chat Header */
.chat-header {
    height: var(--header-height);
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--bg-primary);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

.new-chat-header-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.new-chat-header-btn:hover {
    color: var(--oryxen-teal);
}

.logout-header-btn {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.logout-header-btn:hover {
    color: #ef4444;
}

/* Messages Container - Fixed Scrolling */
.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: var(--bg-primary);
}

.messages {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: min-content;
}

/* Scrollbar Styling */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

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

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Messages with Avatar */
.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

.message-wrapper.user {
    align-self: flex-end;
    flex-direction: row;
}

.message-wrapper.assistant,
.message-wrapper.system {
    align-self: flex-start;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--oryxen-teal);
    border: 2px solid var(--oryxen-teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(20, 184, 166, 0.2);
}

.message-avatar img {
    width: 140%;
    height: 140%;
    object-fit: contain;
    object-position: center top;
    transform: translateY(5%);
}

.message-avatar.user-avatar {
    display: none;
}

/* Messages */
.message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    font-size: 0.9375rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    background: var(--oryxen-teal);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message.assistant {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-sm);
    position: relative;
}

/* Copy button for assistant messages */
.copy-message-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.copy-message-btn:hover {
    opacity: 1;
    background: var(--bg-secondary);
}

.copy-message-btn.copied {
    background: var(--oryxen-teal);
    color: white;
    opacity: 1;
}

.message.system {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

/* Message Content */
.message p {
    margin-bottom: 0.75rem;
}

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

.message pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.8125rem;
    margin: 0.75rem 0;
}

.message code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

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

/* Input Area */
.input-area {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
}

.input-wrapper:focus-within {
    border-color: var(--oryxen-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

textarea {
    flex: 1;
    min-height: 24px;
    max-height: 200px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: inherit;
}

textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--oryxen-teal);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--oryxen-teal-dark);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 1px;
}

/* Processing Status */
.processing-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--oryxen-teal);
    font-size: 0.8125rem;
}

.status-icon {
    font-size: 1rem;
}

.secure-processing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--oryxen-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-text {
    font-weight: 500;
    color: var(--text-secondary);
}

.processing-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Token Usage in Message */
.token-usage {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    opacity: 0.8;
}

.message.assistant .token-usage {
    border-top-color: var(--border);
    color: var(--text-muted);
    display: inline-block;
}

/* Copy button for assistant messages - positioned in lower right */
.copy-message-btn {
    float: right;
    margin-top: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.copy-message-btn:hover {
    opacity: 1;
    background: var(--bg-secondary);
}

.copy-message-btn.copied {
    background: var(--oryxen-teal);
    color: white;
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    .messages {
        padding: 1rem;
    }

    .message-wrapper,
    .message {
        max-width: 90%;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }
}

/* Loading State */
.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--oryxen-teal);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Login Page Tab Styles */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    flex: 1;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(20, 184, 166, 0.1);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--oryxen-teal);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* ========================================
   Image Editing Styles
   ======================================== */

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    justify-content: center;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--oryxen-teal);
    color: white;
    border-color: var(--oryxen-teal);
}

.tab-icon {
    font-size: 1rem;
}

/* Image Upload Zone */
.image-upload-zone {
    position: relative;
    max-width: 900px;
    margin: 0 auto 1rem;
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    transition: all 0.2s;
    cursor: pointer;
    text-align: center;
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
    border-color: var(--oryxen-teal);
    background: rgba(20, 184, 166, 0.05);
}

.image-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.upload-icon {
    font-size: 2rem;
}

.upload-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Image Preview */
.image-preview {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: white;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s;
    z-index: 1;
}

.remove-image-btn:hover {
    background: #ef4444;
}

/* Image Instructions */
.image-instructions-wrapper {
    margin-top: 0;
}

/* Image Result Modal */
.image-result-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.comparison-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.comparison-item img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.loading-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.loading-overlay span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.image-edit-error {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: var(--radius-md);
    color: #dc2626;
    font-size: 0.875rem;
}

.image-edit-text {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.image-edit-text strong {
    color: var(--oryxen-teal);
    font-weight: 600;
}

.image-edit-text hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.75rem 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.btn-primary {
    background: var(--oryxen-teal);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--oryxen-teal-dark);
}

/* Model indicators for image support */
.model-select option[data-image-supported="true"]::after {
    content: " 🎨";
}

/* Chat Attachments */
.chat-attachments {
    max-width: 900px;
    margin: 0 auto 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chat-attachment {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.chat-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-attachment .remove-attachment {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.chat-attachment .remove-attachment:hover {
    background: rgba(239, 68, 68, 0.9);
}

/* Attach Button */
.attach-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.attach-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.attach-btn svg {
    width: 20px;
    height: 20px;
}

.attach-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .image-comparison {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .mode-tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .tab-icon {
        font-size: 0.875rem;
    }

    .image-upload-zone {
        padding: 1.5rem 1rem;
    }

    .upload-icon {
        font-size: 1.5rem;
    }

    .upload-text {
        font-size: 0.875rem;
    }

    .upload-hint {
        font-size: 0.6875rem;
    }
}

/* RAG Document Management */

/* Modal styles */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none !important;
}

.modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal > .modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rag-upload-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.rag-upload-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.rag-help-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.upload-status.success {
    background: rgba(20, 184, 166, 0.1);
    color: var(--oryxen-teal);
    border: 1px solid var(--oryxen-teal);
}

.upload-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.rag-documents-section {
    margin-bottom: 1.5rem;
}

.rag-documents-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.documents-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.document-info {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.document-delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.document-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.loading-documents {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.no-documents {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.rag-settings {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
