/* OpenAI ChatGPT Chat Interface - Complete CSS */
:root {
    --primary: #10a37f; /* OpenAI Green */
    --primary-dark: #0d8c6d;
    --primary-light: #e6f7f2;
    --secondary: #74aa9c; /* OpenAI Secondary Green */
    --accent: #ff6b6b;
    --text-primary: #202123;
    --text-secondary: #6e6e80;
    --text-tertiary: #acacbe;
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #ececf1;
    --border: #e5e5e5;
    --border-dark: #d9d9e3;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;
    --sidebar-width: 260px;
    --transition: all 0.2s ease;
    --success: #10a37f;
    --danger: #ff6b6b;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --border: rgba(255, 255, 255, 0.1);
    --border-dark: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: rgba(0, 0, 0, 0.1);
    --border-dark: rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-blobs {
    position: relative;
    width: 100%;
    height: 100%;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation-timing-function: ease-in-out;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    top: -200px;
    right: -200px;
    animation: blobFloat1 20s infinite alternate;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    bottom: -150px;
    left: -150px;
    animation: blobFloat2 25s infinite alternate;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blobFloat3 30s infinite alternate;
}

@keyframes blobFloat1 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(-100px, 100px) rotate(360deg);
    }
}

@keyframes blobFloat2 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(100px, -100px) rotate(-360deg);
    }
}

@keyframes blobFloat3 {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
    }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(16, 163, 127, 0.2);
    animation: particleFloat 20s linear infinite;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .glass {
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Pulse Animation */
.pulse {
    position: relative;
    overflow: hidden;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: pulseGlow 2s infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes pulseGlow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    pointer-events: none;
}

/* Container Layout */
.container {
    display: flex;
    height: 100vh;
    position: relative;
    background: transparent;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.brand h1 {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-chat-section {
    display: flex;
    gap: 8px;
}

.new-chat-btn {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.new-chat-btn:active {
    transform: translateY(0);
}

/* Chat History Section */
.chat-history-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-all-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.clear-all-btn:hover {
    color: var(--accent);
    background: rgba(255, 107, 107, 0.1);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.chat-history::-webkit-scrollbar {
    width: 4px;
}

.chat-history::-webkit-scrollbar-track {
    background: transparent;
}

.chat-history::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 2px;
}

/* Chat History Items */
.chat-item {
    padding: 12px;
    margin-bottom: 4px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
}

.chat-item.active {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.chat-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.chat-time {
    font-size: 12px;
    color: var(--text-tertiary);
    opacity: 0;
    transition: var(--transition);
    min-width: 60px;
    text-align: right;
}

.chat-item:hover .chat-time {
    opacity: 1;
}

.chat-actions {
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.chat-item:hover .chat-actions {
    opacity: 1;
}

.delete-chat-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.delete-chat-btn:hover {
    color: var(--accent);
    background: rgba(255, 107, 107, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

.user-profile:hover {
    background: var(--bg-secondary);
}

.profile-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.online-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 163, 127, 0);
    }
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.sidebar-actions .action-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-actions .action-btn:hover {
    background: var(--border);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Chat Header */
.chat-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    display: none;
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.model-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.model-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.model-details h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.model-tags {
    display: flex;
    gap: 8px;
}

.tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.tag-online {
    background: linear-gradient(135deg, var(--success), #2E7D32);
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.token-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.header-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.header-btn:hover {
    transform: translateY(-1px);
}

.upgrade-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.upgrade-btn:hover {
    box-shadow: var(--shadow-md);
}

/* Enhanced Message Styles for ChatGPT-like display */
.message {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    background: var(--bg-primary);
    padding: 24px;
    margin: 8px 0;
    border-radius: 18px 18px 4px 18px;
    border: 1px solid rgba(84, 54, 218, 0.1);
    background: linear-gradient(135deg, rgba(84, 54, 218, 0.05), rgba(84, 54, 218, 0.02));
}

.message.assistant {
    background: var(--bg-secondary);
    padding: 24px;
    margin: 8px 0;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid rgba(16, 163, 127, 0.1);
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.05), rgba(16, 163, 127, 0.02));
}

@media (max-width: 768px) {
    .message {
        padding: 16px 0;
    }
    
    .message.user,
    .message.assistant {
        padding: 16px;
        margin: 0 -16px;
    }
}

/* For better code syntax highlighting */
.hljs {
    padding: 0 !important;
    background: transparent !important;
}

.hljs-comment,
.hljs-quote {
    color: #6272a4 !important;
    font-style: italic !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
    color: #ff79c6 !important;
}

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
    color: #f1fa8c !important;
}

.hljs-deletion,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-meta {
    color: #50fa7b !important;
}

.hljs-doctag {
    color: #8be9fd !important;
}

.hljs-attr {
    color: #ffb86c !important;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link {
    color: #bd93f9 !important;
}

.hljs-emphasis {
    font-style: italic !important;
}

.hljs-strong {
    font-weight: bold !important;
}

/* Fix syntax highlighting for C++ */
.language-cpp .hljs-keyword { color: #569cd6 !important; font-weight: 600; }
.language-cpp .hljs-built_in { color: #4ec9b0 !important; }
.language-cpp .hljs-type { color: #4ec9b0 !important; font-style: italic; }
.language-cpp .hljs-string { color: #ce9178 !important; }
.language-cpp .hljs-comment { color: #6a9955 !important; font-style: italic; }
.language-cpp .hljs-number { color: #b5cea8 !important; }
.language-cpp .hljs-preprocessor { color: #9b9b9b !important; }
.language-cpp .hljs-meta { color: #569cd6 !important; }

.hljs-keyword { color: #569cd6 !important; }
.hljs-built_in { color: #4ec9b0 !important; }
.hljs-type { color: #4ec9b0 !important; }
.hljs-literal { color: #569cd6 !important; }
.hljs-number { color: #b5cea8 !important; }
.hljs-string { color: #ce9178 !important; }
.hljs-comment { color: #6a9955 !important; }
.hljs-title { color: #dcdcaa !important; }
.hljs-params { color: #9cdcfe !important; }
.hljs-function { color: #dcdcaa !important; }
.hljs-variable { color: #9cdcfe !important; }
.hljs-class { color: #4ec9b0 !important; }

@media (max-width: 768px) {
    .code-block pre {
        padding: 12px !important;
        font-size: 13px !important;
        overflow-x: auto !important;
        max-width: 100vw !important;
    }
    
    .code-block {
        margin: 8px -16px !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--bg-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Message content improvements */
.message-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.message-content p {
    margin: 0 0 1em 0;
    line-height: 1.6;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content code:not(pre code) {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 85%;
    background-color: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: #e06c75;
    margin: 0 2px;
}

.message-content pre {
    margin: 1em 0;
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
}

/* Code block styling */
.code-block {
    margin: 1.5em 0;
    background: linear-gradient(145deg, #1e1e1e, #252525);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.code-block:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    border-color: #10a37f;
    transform: translateY(-1px);
}

.code-block.copy-success {
    animation: copySuccess 1s ease;
}

.code-block.copy-error {
    animation: copyError 1s ease;
}

@keyframes copySuccess {
    0%, 100% { border-color: #333; }
    50% { border-color: #10a37f; box-shadow: 0 0 20px rgba(16, 163, 127, 0.5); }
}

@keyframes copyError {
    0%, 100% { border-color: #333; }
    50% { border-color: #ff6b6b; box-shadow: 0 0 20px rgba(255, 107, 107, 0.5); }
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(90deg, #2d2d2d, #252525);
    border-bottom: 1px solid #3a3a3a;
}

.code-language {
    color: #fff;
    background: rgba(16, 163, 127, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    border: 1px solid rgba(16, 163, 127, 0.3);
}

.code-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.code-action-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.code-action-btn:hover {
    background: #3a3a3a;
    color: #fff;
    border-color: #666;
}

.code-language-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-language-container i {
    font-size: 14px;
}

/* Language-specific icon colors */
.code-language-container i.fa-js { color: #f7df1e; }
.code-language-container i.fa-python { color: #3776ab; }
.code-language-container i.fa-java { color: #007396; }
.code-language-container i.fa-cuttlefish { color: #00599c; }
.code-language-container i.fa-php { color: #777bb4; }
.code-language-container i.fa-html5 { color: #e34f26; }
.code-language-container i.fa-css3 { color: #1572b6; }
.code-language-container i.fa-rust { color: #000000; }
.code-language-container i.fa-swift { color: #fa7343; }
.code-language-container i.fa-gem { color: #cc342d; }
.code-language-container i.fa-code { color: #10a37f; }

.code-block pre {
    margin: 0 !important;
    padding: 16px 20px !important;
    background: transparent !important;
    overflow-x: auto;
    font-size: 14px !important;
    line-height: 1.6 !important;
    scrollbar-width: thin;
    scrollbar-color: #555 #2a2a2a;
}

.code-block pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.code-block pre::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.code-block pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.code-block pre::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.code-block pre code {
    display: block !important;
    background: transparent !important;
    color: #e6e6e6 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: 1.6 !important;
    white-space: pre !important;
    word-wrap: normal !important;
    tab-size: 4 !important;
    -moz-tab-size: 4 !important;
}

.code-block pre code .hljs {
    background: transparent !important;
}

/* Fix HLJS syntax highlighting */
.code-block pre code .hljs-keyword { color: #569cd6 !important; font-weight: 600; }
.code-block pre code .hljs-built_in { color: #4ec9b0 !important; }
.code-block pre code .hljs-type { color: #4ec9b0 !important; font-style: italic; }
.code-block pre code .hljs-literal { color: #569cd6 !important; }
.code-block pre code .hljs-number { color: #b5cea8 !important; }
.code-block pre code .hljs-string { color: #ce9178 !important; }
.code-block pre code .hljs-comment { color: #6a9955 !important; font-style: italic; }
.code-block pre code .hljs-title { color: #dcdcaa !important; }
.code-block pre code .hljs-params { color: #9cdcfe !important; }
.code-block pre code .hljs-function { color: #dcdcaa !important; }
.code-block pre code .hljs-variable { color: #9cdcfe !important; }
.code-block pre code .hljs-class { color: #4ec9b0 !important; }
.code-block pre code .hljs-meta { color: #808080 !important; }
.code-block pre code .hljs-attr { color: #ffd700 !important; }
.code-block pre code .hljs-symbol { color: #ff79c6 !important; }
.code-block pre code .hljs-tag { color: #569cd6 !important; }
.code-block pre code .hljs-name { color: #569cd6 !important; }

.code-block pre code::before {
    content: counter(line);
    counter-increment: line;
    display: inline-block;
    width: 2em;
    margin-right: 1em;
    text-align: right;
    color: #666;
    border-right: 1px solid #444;
    padding-right: 1em;
    margin-left: -1em;
}

.inline-code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 85%;
    background-color: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: #e06c75;
    margin: 0 2px;
}

/* Markdown tables */
.markdown-table {
    border-collapse: collapse;
    margin: 1.2em 0;
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.markdown-table th,
.markdown-table td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}

.markdown-table th {
    background: rgba(16, 163, 127, 0.1);
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Markdown lists */
.markdown-list {
    margin: 0 0 1em 1.5em;
    padding-left: 1.5em;
    line-height: 1.7;
}

.markdown-list li {
    margin: 0.5em 0;
    line-height: 1.6;
    position: relative;
}

.markdown-list li > p {
    margin: 0.5em 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .code-block {
        margin: 1em 0;
        border-radius: 8px;
    }
    
    .code-header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .code-language-container {
        font-size: 12px;
    }
    
    .code-block pre {
        padding: 14px !important;
        font-size: 13px !important;
    }
    
    .line-numbers {
        padding: 14px 8px 14px 12px;
        font-size: 12px;
        min-width: 40px;
    }
    
    .copy-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .code-language {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .code-block pre {
        padding: 12px !important;
        font-size: 12px !important;
    }
    
    .copy-btn .copy-text {
        display: none;
    }
    
    .copy-btn {
        min-width: 40px;
        width: 40px;
        justify-content: center;
        padding: 8px;
    }
    
    .copy-btn i {
        margin: 0;
    }
    
    .line-numbers {
        min-width: 35px;
        font-size: 11px;
        padding: 12px 6px 12px 10px;
    }
    
    .code-action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .code-block {
        margin: 1em 0;
        border-radius: 8px;
    }
    
    .code-header {
        padding: 10px 16px;
    }
    
    .code-block pre {
        padding: 16px !important;
        font-size: 13px !important;
    }
    
    .copy-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .code-language {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .code-block pre {
        padding: 12px !important;
        font-size: 12px !important;
    }
    
    .copy-btn .copy-text {
        display: none;
    }
    
    .copy-btn {
        min-width: 40px;
        width: 40px;
        justify-content: center;
    }
    
    .copy-btn i {
        margin: 0;
    }
}

.copy-btn {
    background: linear-gradient(135deg, #404040, #333);
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 80px;
    justify-content: center;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #3a3a3a, #2d2d2d);
    border-color: #666;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10a37f, #0d8c6d);
    border-color: #10a37f;
    color: white;
}

.copy-btn.copy-error {
    background: linear-gradient(135deg, #ff6b6b, #ef4444);
    border-color: #ff6b6b;
    color: white;
}

.copy-btn.copied:hover {
    background: linear-gradient(135deg, #0d8c6d, #10a37f);
}

.code-content {
    display: flex;
    overflow-x: auto;
    min-height: 60px;
    max-height: 500px;
    position: relative;
}

/* Ensure proper line breaks in code */
.code-block pre code br {
    display: block;
    content: "";
    margin: 0;
    line-height: 1.6;
}

/* Add line numbers */
.code-block .code-content {
    display: flex;
}

.line-numbers {
    padding: 16px 12px 16px 16px;
    text-align: right;
    color: #858585;
    font-size: 13px;
    line-height: 1.6;
    user-select: none;
    border-right: 1px solid #3a3a3a;
    background: #252525;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
    min-width: 50px;
    flex-shrink: 0;
    overflow-y: hidden;
}

.line-number {
    padding: 0 4px;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

.code-text {
    flex: 1;
    overflow-x: auto;
    min-width: 0;
    position: relative;
}

.code-block .line-numbers {
    padding: 20px 16px 20px 20px;
    text-align: right;
    color: #858585;
    font-size: 13px;
    line-height: 1.6;
    user-select: none;
    border-right: 1px solid #333;
    background: #252525;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.code-block .code-text {
    flex: 1;
    overflow-x: auto;
}

.message-content .code-block {
    max-width: 100%;
    overflow-x: auto;
}

/* Message avatar improvements */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #5436DA, #6C5CE7);
    color: white;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #10a37f, #2ecc71);
    color: white;
}

/* Message bubble */
.message-bubble {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Lists in messages */
.message-content ul,
.message-content ol {
    margin: 0.5em 0 1em 1.5em;
    padding-left: 1.5em;
    line-height: 1.7;
}

.message-content li {
    margin: 0.3em 0;
    line-height: 1.6;
    position: relative;
}

.message-content li > p {
    margin: 0.3em 0;
}

/* Blockquotes */
.message-content blockquote {
    margin: 1em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid var(--primary);
    background: rgba(16, 163, 127, 0.05);
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(16, 163, 127, 0.1);
}

.message-content blockquote p {
    margin: 0;
}

/* Headers */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 1.2em 0 0.6em 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.message-content h1 { 
    font-size: 1.8em;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.3em;
}

.message-content h2 { 
    font-size: 1.5em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

.message-content h3 { 
    font-size: 1.3em;
    margin-top: 1.5em;
}

.message-content h4 { font-size: 1.1em; }
.message-content h5 { font-size: 1em; }
.message-content h6 { font-size: 0.9em; color: var(--text-secondary); }

/* Horizontal rule */
.message-content hr {
    margin: 1.5em 0;
    border: none;
    border-top: 2px solid var(--border);
    height: 1px;
    opacity: 0.5;
}

/* Links */
.message-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.message-content a:hover {
    border-bottom: 1px solid var(--primary);
    text-decoration: none;
}

.message-timestamp {
    position: absolute;
    right: 0;
    bottom: -20px;
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: monospace;
    white-space: nowrap;
}

.message:hover .message-timestamp {
    opacity: 1;
}

/* Mobile Responsive Messages */
@media (max-width: 768px) {
    .message {
        padding: 20px 0;
        gap: 16px;
    }
    
    .message.user,
    .message.assistant {
        padding: 20px;
        border-radius: 16px;
        margin: 6px 0;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-top: 6px;
    }
    
    .message-content {
        font-size: 15px;
        line-height: 1.65;
    }
    
    .messages-container {
        padding: 16px;
        gap: 3px;
    }
    
    .code-block pre {
        padding: 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .message {
        padding: 16px 0;
        gap: 12px;
    }
    
    .message.user,
    .message.assistant {
        padding: 16px;
        border-radius: 14px;
        margin: 4px 0;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-top: 4px;
    }
    
    .message-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .messages-container {
        padding: 12px;
        gap: 2px;
    }
    
    .code-block pre {
        padding: 12px;
        font-size: 12px;
    }
}

/* Tables */
.message-content table {
    border-collapse: collapse;
    margin: 1.2em 0;
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-content th,
.message-content td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}

.message-content th {
    background: rgba(16, 163, 127, 0.1);
    font-weight: 600;
    color: var(--text-primary);
}

.message-content tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Welcome Screen */
.welcome-screen {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.welcome-content {
    width: 100%;
    max-width: 800px;
}

.welcome-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 24px;
    position: relative;
}

.avatar-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    filter: blur(15px);
    opacity: 0.3;
    z-index: -1;
}

.welcome-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 2em 0;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2em;
    color: var(--primary);
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Quick Actions */
.quick-actions {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--border);
}

.quick-actions h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 1em;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
}

.quick-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-btn i {
    font-size: 1.5em;
    margin-bottom: 8px;
    color: var(--primary);
}

/* Welcome Footer */
.welcome-footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--border);
    text-align: center;
}

.welcome-note {
    color: var(--text-tertiary);
    font-size: 0.9em;
    font-style: italic;
}

/* Input Section */
.input-section {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    position: relative;
}

.message-input-form {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.message-input-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    gap: 12px;
}

.input-controls {
    display: flex;
    gap: 4px;
    align-self: flex-end;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.control-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.textarea-container {
    flex: 1;
    position: relative;
    min-height: 24px;
    display: flex;
    align-items: center;
}

textarea {
    width: 100%;
    background: transparent;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 24px;
    max-height: 200px;
    padding: 8px 0;
    outline: none;
    overflow-y: auto;
}

textarea::placeholder {
    color: var(--text-tertiary);
}

.textarea-actions {
    position: absolute;
    right: 0;
    bottom: 8px;
    display: flex;
    gap: 4px;
    align-self: flex-end;
}

.textarea-actions .action-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: var(--transition);
}

.textarea-actions .action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    align-self: flex-end;
    margin-bottom: 4px;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left {
    flex: 1;
    min-width: 200px;
}

/* Typing indicator like ChatGPT */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: fit-content;
    margin: 8px 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

.footer-right {
    flex: 2;
    display: flex;
    justify-content: flex-end;
}

.input-options {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.option-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    transition: var(--transition);
    flex-shrink: 0;
}

.option-slider:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + .option-slider {
    background: var(--primary);
}

input[type="checkbox"]:checked + .option-slider:after {
    transform: translateX(16px);
}

.option-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.option-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 160px;
    font-weight: 500;
}

.option-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

/* Upload Area */
.upload-area {
    display: none;
    margin-bottom: 16px;
}

.upload-area.visible {
    display: block;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone.drag-active {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(16, 163, 127, 0.2);
}

.drop-zone.drag-active .drop-content i {
    animation: bounce 0.6s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-content i {
    font-size: 48px;
    color: var(--primary);
}

.drop-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-types {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.file-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    margin: 2px;
}

.file-type-tag i {
    font-size: 10px;
}

.drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Uploaded Files */
.uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 120px;
    overflow-y: auto;
}

.uploaded-files::-webkit-scrollbar {
    width: 4px;
}

.uploaded-files::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 2px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    animation: slideIn 0.2s ease-out;
    border: 1px solid var(--border);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.file-size {
    font-size: 12px;
    color: var(--text-tertiary);
}

.remove-file {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.remove-file:hover {
    color: var(--accent);
    background: rgba(255, 107, 107, 0.1);
}

/* Settings Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease-out;
    border: 1px solid var(--border);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

/* Confirmation Modal Styles */
.confirmation-content {
    text-align: center;
    padding: 20px;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--danger), #ef4444);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 32px;
}

.confirmation-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.confirmation-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.confirmation-actions button {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ef4444);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444, var(--danger));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tabs-header {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tabs-header::-webkit-scrollbar {
    height: 4px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.settings-group {
    margin-bottom: 32px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.setting-label label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.setting-value {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 16px;
    flex-shrink: 0;
}

.range-slider {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.slider-with-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 200px;
    flex-shrink: 0;
}

.slider-options {
    display: flex;
    justify-content: space-between;
}

.slider-options .option {
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.slider-options .option.active {
    background: var(--primary-light);
    color: var(--primary);
}

.slider-options .option:hover:not(.active) {
    color: var(--text-primary);
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.theme-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.theme-option:hover:not(.active) {
    border-color: var(--text-tertiary);
    transform: translateY(-2px);
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: var(--radius);
}

.dark-theme {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.light-theme {
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
}

.gradient-theme {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.glass-theme {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.animation-level {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.level-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    flex: 1;
    text-align: center;
    min-width: 80px;
}

.level-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.level-btn:hover:not(.active) {
    background: var(--border);
    color: var(--text-primary);
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    width: 100%;
    justify-content: space-between;
}

.switch-label span:not(.switch-slider) {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.switch-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--border);
    border-radius: 34px;
    transition: var(--transition);
    flex-shrink: 0;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input[type="checkbox"]:checked + .switch-slider {
    background-color: var(--primary);
}

input[type="checkbox"]:checked + .switch-slider:before {
    transform: translateX(24px);
}

.setting-info {
    flex: 1;
    min-width: 0;
}

.setting-info label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.setting-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.model-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
    transition: var(--transition);
    cursor: pointer;
    font-weight: 500;
}

.model-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.range-setting {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: space-between;
}

.range-setting input[type="range"] {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
}

.range-setting input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.input-with-action {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.input-with-action input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.input-with-action input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.action-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.action-icon:hover {
    background: var(--border);
    color: var(--text-primary);
}

.api-test {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.test-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.test-btn:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.test-result {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-result i {
    font-size: 16px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.btn-primary {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast {
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
    border: 1px solid var(--border);
    min-width: 300px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--info);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    animation: toastProgress 3s linear forwards;
    border-radius: 0 0 var(--radius) var(--radius);
}

.toast.success .toast-progress {
    background: var(--success);
}

.toast.error .toast-progress {
    background: var(--danger);
}

.toast.info .toast-progress {
    background: var(--info);
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--primary);
}

.spinner-ring:nth-child(2) {
    border-right-color: var(--secondary);
    animation-delay: 0.3s;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: var(--accent);
    animation-delay: 0.6s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
}

.loading-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Emoji Picker */
.emoji-picker {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 320px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}

.emoji-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.emoji-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.emoji-search::placeholder {
    color: var(--text-tertiary);
}

.emoji-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.emoji-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.emoji-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.emoji-grid::-webkit-scrollbar {
    width: 4px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 2px;
}

.emoji-grid span {
    font-size: 20px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    user-select: none;
}

.emoji-grid span:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

/* Enhanced Drag & Drop Styles */
.drop-zone.enhanced {
    border-width: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-zone.enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(16, 163, 127, 0.1) 50%, 
        transparent 70%);
    animation: shimmer 3s infinite linear;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.drop-zone.drag-active .drop-content i {
    animation: bounce 0.6s infinite alternate;
}

.file-type-tag i {
    font-size: 10px;
}

.upload-progress {
    margin-top: 12px;
    width: 100%;
    max-width: 400px;
    display: none;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.file-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.file-item.drag-over {
    border: 2px dashed var(--primary);
    background: var(--primary-light);
}

.drag-handle {
    cursor: move;
    color: var(--text-tertiary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.drag-handle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.file-preview.large {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.file-preview.image {
    position: relative;
}

.file-preview.image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
}

.file-status {
    font-size: 11px;
    margin-top: 2px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.status-indicator i {
    font-size: 10px;
}

.batch-upload-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 4000;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    display: none;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.batch-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.batch-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.batch-files {
    max-height: 200px;
    overflow-y: auto;
}

.batch-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    font-size: 13px;
}

.batch-file-icon {
    color: var(--primary);
    font-size: 14px;
}

.batch-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-file-size {
    font-size: 11px;
    color: var(--text-tertiary);
}

.batch-progress {
    margin-top: 8px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.thumbnail-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    color: white;
    font-size: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thumbnail-remove {
    background: rgba(255, 107, 107, 0.8);
    border: none;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    cursor: pointer;
}

.upload-limit-warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    display: none;
}

.upload-limit-warning i {
    font-size: 14px;
}

body.drag-over::after {
    content: 'Drop files anywhere to upload';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    padding: 20px 40px;
    border-radius: var(--radius-lg);
    border: 3px dashed var(--primary);
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    z-index: 3000;
    pointer-events: none;
    animation: pulse 2s infinite;
    box-shadow: var(--shadow-lg);
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Mobile Responsive Messages */
@media (max-width: 768px) {
    .message {
        padding: 16px 0;
        gap: 12px;
    }
    
    .message.user,
    .message.assistant {
        padding: 16px;
        margin: 0 -16px;
    }
    
    .message-avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-top: 2px;
    }
    
    .message-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .message-content h1 {
        font-size: 1.5em;
    }
    
    .message-content h2 {
        font-size: 1.3em;
    }
    
    .message-content h3 {
        font-size: 1.1em;
    }
    
    .message-bubble {
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .message {
        padding: 12px 0;
        gap: 8px;
    }
    
    .message.user,
    .message.assistant {
        padding: 12px;
        margin: 0 -12px;
    }
    
    .message-avatar {
        width: 20px;
        height: 20px;
        font-size: 10px;
        margin-top: 0;
    }
    
    .message-content {
        font-size: 13px;
        line-height: 1.5;
    }
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        width: 280px;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .mobile-header {
        display: flex;
        padding: 12px 16px;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border);
        background: var(--bg-primary);
    }
    
    .mobile-menu-btn {
        background: transparent;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 8px;
        border-radius: var(--radius);
        font-size: 20px;
    }
    
    .mobile-header h1 {
        font-size: 16px;
        font-weight: 600;
    }
    
    .mobile-actions {
        display: flex;
        gap: 8px;
    }
    
    .new-chat-mobile {
        width: 36px;
        height: 36px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .features-grid,
    .quick-buttons {
        grid-template-columns: 1fr;
    }
    
    .message {
        padding: 16px 0;
        gap: 12px;
    }
    
    .message.user,
    .message.assistant {
        padding: 16px;
        margin: 0 -16px;
    }
    
    .messages-container {
        padding: 0;
    }
    
    .input-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .footer-left,
    .footer-right {
        min-width: 100%;
    }
    
    .input-options {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .theme-selector {
        grid-template-columns: 1fr;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .model-details h2 {
        font-size: 14px;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .token-counter {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .upgrade-btn span {
        display: none;
    }
    
    .upgrade-btn {
        padding: 10px;
    }
    
    .welcome-title {
        font-size: 28px;
    }
    
    .welcome-avatar {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
    
    .feature-card {
        padding: 16px;
    }
    
    .message-content {
        font-size: 14px;
    }
    
    .option-select {
        min-width: 120px;
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .emoji-picker {
        width: 280px;
        right: 10px;
        bottom: 100px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .batch-upload-indicator {
        width: 90%;
        max-width: none;
        left: 5%;
        right: 5%;
        top: 10px;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .confirmation-actions {
        flex-direction: column;
    }
    
    .confirmation-actions button {
        width: 100%;
    }
    
    .confirmation-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .confirmation-content h3 {
        font-size: 20px;
    }
    
    .confirmation-content p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 24px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
    }
    
    .feature-card h3 {
        font-size: 14px;
    }
    
    .feature-card p {
        font-size: 12px;
    }
    
    .quick-btn {
        padding: 12px;
        font-size: 12px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .input-wrapper {
        padding: 8px;
        gap: 8px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
    }
    
    textarea {
        font-size: 14px;
    }
    
    .modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .range-slider,
    .slider-with-options {
        width: 100%;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}