/* 
 * AI Image Generator - Modern Chat Interface
 * Premium dark theme with glassmorphism effects
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-bg-primary: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-tertiary: #1a1a24;
    --color-bg-elevated: #22222e;

    --color-surface: rgba(255, 255, 255, 0.03);
    --color-surface-hover: rgba(255, 255, 255, 0.06);
    --color-surface-active: rgba(255, 255, 255, 0.08);

    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-focus: rgba(139, 92, 246, 0.5);

    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-text-tertiary: rgba(255, 255, 255, 0.5);
    --color-text-muted: rgba(255, 255, 255, 0.3);

    /* Accent Gradient */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
    --gradient-hover: linear-gradient(135deg, #9d6eff 0%, #f472b6 50%, #fb923c 100%);
    --color-accent: #8b5cf6;
    --color-accent-pink: #ec4899;
    --color-accent-orange: #f97316;

    /* Feedback Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.2);

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;
    --input-height: 80px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Base Styles & Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   App Container
   ============================================ */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    color: white;
}

.new-chat-btn {
    width: 36px;
    height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.new-chat-btn svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
}

.new-chat-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
}

.new-chat-btn:hover svg {
    color: var(--color-accent);
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: var(--color-surface-hover);
}

.conversation-item.active {
    background: var(--color-surface-active);
    border-color: var(--color-border);
}

.conversation-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: var(--color-bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
}

.conversation-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.conversation-thumb-placeholder svg {
    width: 20px;
    height: 20px;
    color: white;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.conversation-delete {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

.conversation-delete svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-tertiary);
}

.conversation-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.conversation-delete:hover svg {
    color: var(--color-error);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}

.aspect-ratio-selector label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aspect-ratio-selector select {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.aspect-ratio-selector select:hover {
    border-color: var(--color-accent);
}

.aspect-ratio-selector select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Sidebar Toggle (Mobile) */
.sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
}

/* ============================================
   Chat Area
   ============================================ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-bg-primary);
}

.chat-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    flex-shrink: 0;
}

.chat-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-tertiary);
}

.icon-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border);
}

.icon-btn:hover svg {
    color: var(--color-error);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 40px;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
}

.welcome-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.welcome-screen h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    max-width: 400px;
    margin-bottom: 32px;
}

.example-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
}

.example-prompt {
    padding: 12px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    color: var(--color-text-secondary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.example-prompt:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
    color: var(--color-text-primary);
    transform: translateY(-2px);
}

/* Message Styles */
.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.message.assistant .message-avatar {
    background: var(--gradient-primary);
}

.message-avatar svg {
    width: 18px;
    height: 18px;
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-primary);
}

.message.user .message-text {
    color: var(--color-text-secondary);
}

/* Generated Image */
.generated-image {
    margin-top: 16px;
    position: relative;
    display: inline-block;
    max-width: 512px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.generated-image:hover {
    transform: scale(1.02);
}

.generated-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.generated-image:hover .image-overlay {
    opacity: 1;
}

.image-action-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.image-action-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

.image-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Loading Message */
.message.loading .message-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading-status {
    display: flex;
    align-items: center;
}

.loading-text-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-dots-text {
    display: flex;
    gap: 4px;
}

.loading-action {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: loadingPulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   Input Area
   ============================================ */
.input-area {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 12px 16px;
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#promptInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 150px;
    outline: none;
}

#promptInput::placeholder {
    color: var(--color-text-muted);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    opacity: 0.5;
}

.send-btn:not(:disabled) {
    opacity: 1;
}

.send-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    padding: 0 4px;
}

.char-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: white;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

#modalImage {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.modal-btn svg {
    width: 18px;
    height: 18px;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-color: var(--color-success);
}

.toast.error {
    border-color: var(--color-error);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--color-success);
}

.toast.error .toast-icon {
    color: var(--color-error);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--color-text-primary);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-tertiary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .chat-header {
        padding-left: 72px;
    }

    .messages-container {
        padding: 16px;
    }

    .input-area {
        padding: 12px 16px 16px;
    }

    .welcome-screen {
        padding: 24px;
    }

    .welcome-screen h2 {
        font-size: 1.4rem;
    }

    .example-prompts {
        flex-direction: column;
    }

    .example-prompt {
        width: 100%;
    }

    .generated-image {
        max-width: 100%;
    }

    .modal-content {
        max-width: 95vw;
    }

    .modal-actions {
        flex-direction: column;
        width: 100%;
    }

    .modal-btn {
        justify-content: center;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .chat-header h1 {
        font-size: 1rem;
    }

    .message {
        gap: 12px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    .message-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-tertiary) 25%,
            var(--color-bg-elevated) 50%,
            var(--color-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-image {
    width: 300px;
    height: 300px;
    margin-top: 16px;
    border-radius: var(--border-radius-lg);
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Settings Groups (Model, Aspect Ratio, Size)
   ============================================ */
.settings-group {
    margin-bottom: 12px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-group select:hover {
    border-color: var(--color-accent);
}

.settings-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.settings-group.pro-only {
    opacity: 0.8;
}

.settings-group.pro-only label::after {
    content: '✨';
    margin-left: 4px;
}

/* ============================================
   Model Badge in Header
   ============================================ */
.model-badge {
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.model-badge.pro {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--color-text-primary);
}

/* ============================================
   Model Info Cards (Welcome Screen)
   ============================================ */
.model-info {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    max-width: 600px;
}

.model-card {
    flex: 1;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    text-align: left;
}

.model-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}

.model-card p {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    margin-bottom: 0;
}

.model-card.pro {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
}

/* ============================================
   Image Upload Preview
   ============================================ */
.image-upload-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
}

.image-upload-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.upload-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.remove-image-btn {
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.remove-image-btn svg {
    width: 14px;
    height: 14px;
    color: var(--color-error);
}

.remove-image-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   Upload Button in Input
   ============================================ */
.upload-btn {
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.upload-btn svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
}

.upload-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
}

.upload-btn:hover svg {
    color: var(--color-accent);
}

.upload-btn.has-image {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border-color: var(--color-accent);
}

.upload-btn.has-image svg {
    color: var(--color-accent);
}

/* ============================================
   Input Footer with Hint
   ============================================ */
.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 4px;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ============================================
   Loading Model Text
   ============================================ */
.loading-model {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    margin-top: 8px;
}

/* ============================================
   Responsive Updates for New Features
   ============================================ */
@media (max-width: 768px) {
    .model-info {
        flex-direction: column;
    }

    .model-card {
        text-align: center;
    }

    .image-upload-preview {
        width: 100%;
    }

    .input-hint {
        display: none;
    }
}