:root {
    /* Apple Dark Mode Palette & Glass Variables */
    --bg-body: #000000;
    --glass-material: rgba(30, 30, 30, 0.70);
    --glass-material-lighter: rgba(50, 50, 50, 0.60);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    
    --accent-color: #2997ff; /* Apple Blue */
    --accent-glow: rgba(41, 151, 255, 0.3);
    --danger-color: #ff453a;
    
    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 12px;
    
    --blur-strength: 25px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none; /* Clean focus states managed manually */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    /* Deep Ambient Gradient Background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(41, 151, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(100, 50, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(41, 151, 255, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100%;
    position: relative;
    max-width: 1800px; /* Limit width on huge screens */
    margin: 0 auto;
}

/* --- Sidebar (Frosted Glass Panel) --- */
.sidebar {
    width: 280px;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.sidebar-top {
    margin-bottom: 24px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.vector-logo-small {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(41, 151, 255, 0.4);
}

.vector-logo-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.vector-logo-auth {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(41, 151, 255, 0.4);
}

.vector-logo-img-small {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vector-logo-img-large {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Chat History List */
.chat-history {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px; /* Space for scrollbar */
}

/* Elegant Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 0 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.history-item:hover {
    background-color: var(--glass-highlight);
}

.history-item.active {
    background-color: rgba(41, 151, 255, 0.15); /* Accent tint */
    border-color: rgba(41, 151, 255, 0.2);
}

.history-item i:first-child {
    color: var(--text-secondary);
    font-size: 16px;
}

.history-item.active i:first-child {
    color: var(--accent-color);
}

.history-item .item-content {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.delete-chat-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.history-item:hover .delete-chat-btn {
    display: block;
    animation: fadeIn 0.2s ease;
}

.delete-chat-btn:hover {
    color: var(--danger-color);
    background: rgba(255, 69, 58, 0.1);
}

.sidebar-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-btn, .user-profile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-s);
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background 0.2s;
}

.sidebar-btn:hover, .user-profile:hover {
    background-color: var(--glass-highlight);
}

.avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #00C6FF, #0072FF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 114, 255, 0.3);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Transparent to show body gradient */
    background: transparent; 
}

.top-bar {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    /* Only subtle blur for top bar, no hard bg */
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 20px;
    transition: all 0.2s;
}

.model-selector:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    margin-right: 16px;
    display: none;
}

/* --- Chat Area --- */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 180px; /* Space for header and footer */
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
    margin-top: 5vh;
    animation: fadeIn 0.8s ease-out;
}

.welcome-screen[style*="display: none"] {
    display: none !important;
}

.logo-circle {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    padding: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.logo-circle img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.greeting {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 48px;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 620px;
    justify-items: center;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 120px;
    backdrop-filter: blur(5px);
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 24px;
    color: var(--accent-color);
}

.card-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

/* --- Messages --- */
.message-wrapper {
    width: 100%;
    padding: 24px 0;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.message-row {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 18px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Circle for both */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.message-row.user .message-avatar {
    background: linear-gradient(135deg, #00C6FF, #0072FF); /* Apple Blue Gradient */
    color: white;
    font-weight: 600;
}

.message-row.ai .message-avatar {
    background: radial-gradient(circle at 30% 30%, rgba(41,151,255,0.4), rgba(0,0,0,0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
}

.vector-logo-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.message-content {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    /* No Bubble by default for AI, just text */
}

/* User Message Bubble - Glass Style */
.message-row.user .message-content {
    background: rgba(41, 151, 255, 0.15);
    border: 1px solid rgba(41, 151, 255, 0.2);
    padding: 12px 18px;
    border-radius: 18px;
    border-top-right-radius: 4px; /* iMessage style hint */
    backdrop-filter: blur(5px);
}

/* AI Message styling */
.message-row.ai .message-content {
    /* Clean text for AI, or minimal card if preferred. User asked for liquid glass. */
    /* Let's keep AI minimal but clean */
    padding-top: 4px;
}

/* Code Blocks & Pre */
pre {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
    backdrop-filter: blur(10px);
}

code {
    font-family: 'SF Mono', Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 14px;
}

/* --- Input Area Container (Floating Glass Dock) --- */
.input-area-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 20px 30px;
    background: linear-gradient(to top, var(--bg-body) 0%, transparent 100%); /* Fade out background */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
}

.input-box {
    width: 100%;
    max-width: 800px;
    background: rgba(30, 30, 30, 0.6); /* Slightly darker glass for input */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 32px; /* Capsule shape */
    padding: 8px 8px 8px 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.input-box:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

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

.input-box textarea::placeholder {
    color: var(--text-secondary);
}

.attach-btn, .send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.attach-btn {
    background: transparent;
    color: var(--text-secondary);
}

.attach-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.send-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.send-btn:not(:disabled) {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.send-btn:not(:disabled):hover {
    transform: scale(1.05);
}

.footer-text {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 16px;
    text-align: center;
}

/* Attached Files */
.attached-files {
    width: 100%;
    max-width: 800px;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 4px;
    overflow-x: auto;
}

.attached-file-preview {
    position: relative;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-s);
    overflow: hidden;
    flex-shrink: 0;
}

.attached-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.remove-file-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

/* --- Auth Modal (Glass) --- */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 48px rgba(0,0,0,0.4);
    border-radius: var(--radius-l);
    padding: 40px;
    max-width: 450px;
    width: 90%;
    position: relative;
}

.auth-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.auth-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.auth-tab.active {
    border-bottom-color: var(--accent-color);
    color: var(--text-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-s);
    color: white;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-m);
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.auth-submit-btn:hover {
    background: #007aff;
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.auth-footer {
    margin-top: 16px;
    text-align: center;
}

.auth-message {
    font-size: 13px;
    padding: 8px;
    border-radius: var(--radius-s);
}

.auth-message.error {
    color: var(--danger-color);
    background: rgba(255, 69, 58, 0.1);
}

.auth-message.success {
    color: var(--accent-color);
    background: rgba(41, 151, 255, 0.1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100%;
        transform: translateX(-100%);
        background: rgba(20, 20, 20, 0.95); /* More opaque on mobile */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .suggestion-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .input-box {
        border-radius: 24px;
    }
}

/* --- Animations & Keyframes --- */

/* 1. Loading Animation (Liquid Wave) */
.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
    height: 24px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #2997ff, #7c4dff);
    border-radius: 50%;
    display: inline-block;
    animation: liquid-bounce 1.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite both;
    font-size: 0; /* Hide text dots */
    box-shadow: 0 0 10px rgba(41, 151, 255, 0.4);
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes liquid-bounce {
    0%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-6px) scale(1.1);
        opacity: 1;
        box-shadow: 0 0 15px rgba(124, 77, 255, 0.6);
    }
}

/* 2. Message Entry Animation */
.message-wrapper {
    animation: message-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}

@keyframes message-enter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 3. Suggestion Cards Staggered Entry */
.suggestion-cards .card {
    opacity: 0;
    animation: card-enter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.suggestion-cards .card:nth-child(1) { animation-delay: 0.1s; }
.suggestion-cards .card:nth-child(2) { animation-delay: 0.2s; }
.suggestion-cards .card:nth-child(3) { animation-delay: 0.3s; }

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects for Cards */
.card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card:active {
    transform: scale(0.98);
}

/* 4. Modal Animation */
.modal {
    transition: opacity 0.3s ease;
}

.modal-content {
    animation: modal-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
}

@keyframes modal-pop {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 5. Button Micro-interactions */
.send-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.send-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(41, 151, 255, 0.4);
}

.send-btn:not(:disabled):active {
    transform: scale(0.95);
}

.sidebar-toggle {
    transition: transform 0.3s ease, background 0.2s;
}

.sidebar-toggle:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Entry */
.sidebar {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Auth Form Input Animation */
.auth-form input {
    transition: all 0.3s ease;
}

.auth-form input:focus {
    transform: scale(1.01);
}

/* Стили для изображений в сообщениях */
.message-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.message-image {
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: contain;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 14px;
}

.message-generated-image {
    margin-top: 12px;
}

/* --- Code Block Styling (Premium Dark) --- */
.markdown-content pre {
    background: #1e1e1e;
    border-radius: 12px;
    margin: 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #252526; /* VS Code header color */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #d4d4d4;
    text-transform: uppercase;
}

.copy-code-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #cccccc;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.copy-code-btn:active {
    transform: scale(0.98);
}

.markdown-content pre code.hljs {
    display: block;
    padding: 20px;
    overflow-x: auto;
    background: transparent;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Scrollbars */
.markdown-content pre code.hljs::-webkit-scrollbar {
    height: 10px;
}

.markdown-content pre code.hljs::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.markdown-content pre code.hljs::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
    border: 2px solid #1e1e1e;
}

.markdown-content pre code.hljs::-webkit-scrollbar-thumb:hover {
    background: #505050;
}

/* Inline Code */
.markdown-content p code {
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
    color: #ffab70; /* Soft Orange */
    font-family: 'Consolas', monospace;
    font-size: 0.92em;
}

/* Markdown Elements */
.markdown-content p { margin-bottom: 12px; line-height: 1.6; }
.markdown-content ul, .markdown-content ol { margin: 12px 0 12px 24px; }
.markdown-content li { margin-bottom: 6px; }
.markdown-content h1, .markdown-content h2 { margin-top: 24px; color: white; font-weight: 600; }
.markdown-content a { color: #58a6ff; text-decoration: none; }
.markdown-content a:hover { text-decoration: underline; }
/* Model Selector Styling */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.model-selector-container {
    position: relative;
    margin: 0 auto; /* Center horizontally */
}

.model-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.model-selector-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.model-selector-btn i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.model-selector-btn.active {
    color: white;
}

.model-selector-btn.active i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.model-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 220px;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.model-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-secondary);
}

.model-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.model-option.selected {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.model-option i {
    opacity: 0;
    color: var(--accent-color);
    font-size: 16px;
}

.model-option.selected i {
    opacity: 1;
}

.model-name {
    font-size: 14px;
    font-weight: 500;
}

