/* ============================================
   GaziGPT - Premium Dark Theme CSS
   ============================================ */

:root {
    --bg-primary: #0f0f14;
    --bg-secondary: #16161e;
    --bg-tertiary: #1c1c27;
    --bg-surface: #22223a;
    --bg-hover: #2a2a45;
    --bg-active: #33335a;

    --text-primary: #e8e6f0;
    --text-secondary: #9b99b0;
    --text-muted: #6b6980;
    --text-accent: #a78bfa;

    --accent-primary: #7c3aed;
    --accent-secondary: #6366f1;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #6366f1 50%, #818cf8 100%);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;

    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 48px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-size-base: 14px;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: var(--font-size-base); scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.app-container { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow);
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 8px;
}
.sidebar-header .new-chat-btn { flex: 1; }

.sidebar-close-btn {
    width: 36px; height: 36px;
    display: none; align-items: center; justify-content: center;
    background: var(--bg-hover); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition-fast); flex-shrink: 0;
}
.sidebar-close-btn:hover { background: var(--bg-active); color: var(--text-primary); }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-main);
    box-shadow: var(--shadow-glow);
}
.new-chat-btn:hover { transform: translateY(-1px); box-shadow: 0 0 60px var(--accent-glow); }
.new-chat-btn:active { transform: translateY(0); }

.sidebar-search { padding: 12px 16px 8px; }
.search-box {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast);
}
.search-box:focus-within { border-color: var(--accent-primary); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font-main); font-size: 0.85rem;
}
.search-box input::placeholder { color: var(--text-muted); }

.chat-list { flex: 1; overflow-y: auto; padding: 8px; }

.chat-item {
    display: flex; align-items: center;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--bg-active); border: 1px solid rgba(124, 58, 237, 0.2); }

.chat-item-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--bg-surface);
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px; flex-shrink: 0; font-size: 0.9rem;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-title {
    font-size: 0.85rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text-primary);
}
.chat-item-date { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.chat-item-delete {
    opacity: 0; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; color: var(--text-muted);
    cursor: pointer; border-radius: 6px;
    transition: all var(--transition-fast); flex-shrink: 0;
}
.chat-item:hover .chat-item-delete { opacity: 1; }
.chat-item-delete:hover { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.sidebar-footer {
    padding: 12px; border-top: 1px solid var(--border-color);
    display: flex; flex-direction: column; gap: 4px;
}
.sidebar-footer-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: none; border: none;
    color: var(--text-secondary); font-family: var(--font-main);
    font-size: 0.85rem; cursor: pointer;
    border-radius: var(--radius-sm); transition: all var(--transition-fast);
}
.sidebar-footer-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }

.top-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; position: sticky; top: 0;
    z-index: 50;
}

.toggle-sidebar {
    width: 36px; height: 36px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); display: none;
    align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer;
}
.toggle-sidebar:hover { background: var(--bg-hover); color: var(--text-primary); }

.model-selector { position: relative; }
.model-selector-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 8px 16px;
    color: var(--text-primary); font-family: var(--font-main);
    font-size: 0.95rem; font-weight: 500; cursor: pointer;
    transition: all var(--transition-fast);
}
.model-selector-btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.model-selector-btn svg { color: var(--text-muted); }

.model-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0;
    width: 280px; background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
    transform: translateY(-10px); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 60; padding: 6px;
}
.model-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }

.model-option {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all var(--transition-fast);
    color: var(--text-secondary);
}
.model-option:hover { background: var(--bg-hover); color: var(--text-primary); }
.model-option.active { color: var(--text-primary); }

.model-icon {
    font-size: 1.2rem; flex-shrink: 0;
    width: 24px; text-align: center;
}
.model-info { flex: 1; }
.model-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 2px; }
.model-desc { font-size: 0.75rem; color: var(--text-muted); }
.model-check {
    width: 20px; color: var(--text-primary);
    display: flex; align-items: center; justify-content: center;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 20px; text-align: center;
}
.empty-logo { position: relative; margin-bottom: 24px; }
.logo-glow {
    position: absolute; width: 120px; height: 120px;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    border-radius: 50%; animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}
.logo-icon {
    position: relative; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 24px; animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.empty-title {
    font-size: 2rem; font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 8px;
}
.empty-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 40px; }

.feature-cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; max-width: 600px; width: 100%;
}
.feature-card {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--transition-normal);
}
.feature-card:hover {
    background: var(--bg-hover); border-color: var(--accent-primary);
    transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.feature-icon { font-size: 1.4rem; }
.feature-text { font-size: 0.82rem; color: var(--text-secondary); text-align: left; }

/* ===== CHAT MESSAGES ===== */
.chat-messages { flex: 1; overflow-y: auto; padding: 20px 0; }

.message {
    padding: 20px 24px; max-width: 800px;
    margin: 0 auto; width: 100%;
    animation: messageIn 0.3s ease-out;
}
@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-user { margin-bottom: 4px; }
.message-assistant {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.message-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.message-avatar {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; flex-shrink: 0;
}
.message-user .message-avatar { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.message-assistant .message-avatar { background: var(--accent-gradient); }
.message-sender { font-weight: 600; font-size: 0.85rem; }
.message-time { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

.message-body { font-size: 0.92rem; line-height: 1.7; color: var(--text-primary); }
.message-body p { margin-bottom: 12px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body h1, .message-body h2, .message-body h3 { margin: 16px 0 8px; color: var(--text-accent); }
.message-body ul, .message-body ol { padding-left: 24px; margin-bottom: 12px; }
.message-body li { margin-bottom: 4px; }
.message-body a { color: var(--accent-primary); text-decoration: none; }
.message-body a:hover { text-decoration: underline; }
.message-body strong { color: #c4b5fd; }
.message-body code {
    font-family: var(--font-mono); font-size: 0.85em;
    background: var(--bg-tertiary); padding: 2px 6px;
    border-radius: 4px; color: #e879f9;
}
.message-body pre {
    margin: 12px 0; border-radius: var(--radius-sm);
    overflow: hidden; border: 1px solid var(--border-color);
}

details.thinking-box {
    margin: 12px 0;
    border: 1px solid var(--border-color);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-sm);
    padding: 0;
    overflow: hidden;
}
details.thinking-box summary.thinking-header {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.15);
    user-select: none;
    font-size: 0.9rem;
    margin: 0;
}
details.thinking-box summary.thinking-header:hover {
    background: rgba(0,0,0,0.25);
}
details.thinking-box .thinking-content {
    padding: 12px 14px;
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
}
details.thinking-box summary::marker {
    color: var(--accent-primary);
}

.message-body pre code {
    display: block; padding: 16px;
    background: var(--bg-primary) !important;
    overflow-x: auto; font-size: 0.82rem; line-height: 1.6;
}
.code-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem; color: var(--text-muted);
}
.copy-btn {
    padding: 3px 10px; background: var(--bg-hover);
    border: 1px solid var(--border-color); border-radius: 4px;
    color: var(--text-secondary); cursor: pointer;
    font-size: 0.72rem; font-family: var(--font-main);
    transition: all var(--transition-fast);
}
.copy-btn:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

.message-body img {
    max-width: 100%; border-radius: var(--radius-md);
    margin: 12px 0; border: 1px solid var(--border-color);
}

.message-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    background: none; border: none; padding: 4px 8px;
    color: var(--text-muted); cursor: pointer; border-radius: 4px;
    font-size: 0.8rem; font-family: var(--font-main);
    transition: all var(--transition-fast);
}

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

.action-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.action-btn.active svg { fill: currentColor; }

/* ===== TYPING INDICATOR (message-style, assistant side) ===== */
.typing-message {
    padding: 20px 24px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    animation: messageIn 0.3s ease-out;
}
.typing-message .message-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.typing-message .message-avatar {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-gradient); font-size: 0.9rem;
}
.typing-dots {
    display: flex; align-items: center; gap: 5px; padding: 4px 0;
}
.typing-dot {
    width: 8px; height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 12px 20px 20px;
    background: linear-gradient(to top, var(--bg-primary) 60%, transparent);
}

/* Stream cursor */
.stream-cursor {
    display: inline-block;
    color: var(--accent-primary);
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes tool-spin {
    to { transform: rotate(360deg); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Generated image action buttons (both a and button) */
.generated-image-actions button {
    flex: 1;
    text-align: center;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all var(--transition-fast);
}

.input-container { max-width: 800px; margin: 0 auto; }

.input-wrapper {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}
.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-wrapper textarea {
    flex: 1; background: none; border: none; outline: none; resize: none;
    color: var(--text-primary); font-family: var(--font-main);
    font-size: 0.95rem; line-height: 1.5; max-height: 200px; min-height: 24px;
}
.input-wrapper textarea::placeholder { color: var(--text-muted); }

.attach-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm); flex-shrink: 0;
    transition: all var(--transition-fast);
}
.attach-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.send-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-gradient); border: none;
    border-radius: var(--radius-sm); color: white;
    cursor: pointer; flex-shrink: 0;
    transition: all var(--transition-normal);
}
.send-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Stop / Cancel button */
.stop-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none; border-radius: var(--radius-sm);
    color: white; cursor: pointer; flex-shrink: 0;
    transition: all var(--transition-normal);
    animation: stop-pulse 1.5s ease-in-out infinite;
}
.stop-btn:hover { transform: scale(1.08); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
.stop-btn:active { transform: scale(0.95); }
@keyframes stop-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* File preview bar */
.file-preview {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; margin-top: 8px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.82rem; color: var(--text-accent);
}
.file-preview-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview-remove {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1rem; padding: 2px 6px;
    border-radius: 4px; transition: all var(--transition-fast);
}
.file-preview-remove:hover { color: var(--danger); background: rgba(239,68,68,0.15); }

/* Görsel ek önizleme */
.file-preview-image {
    width: 40px; height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(124, 58, 237, 0.3);
}
.file-preview-image img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.input-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 4px 0; gap: 8px;
}
.char-count { font-size: 0.72rem; color: var(--text-muted); }
.input-hint { font-size: 0.72rem; color: var(--text-muted); }

/* Ratio selector */
.ratio-selector {
    display: flex; align-items: center; gap: 6px;
}
.ratio-label { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.ratio-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.72rem;
    padding: 3px 8px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}
.ratio-select:focus { border-color: var(--accent-primary); }
.ratio-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* Generated Image Container */
.generated-image-container {
    background: #0a0a0f;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid rgba(255,255,255,0.06);
    max-width: 420px;
}
.generated-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    margin: 0;
    border: none;
}
.generated-image-actions {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.4);
}
.generated-image-actions a {
    flex: 1;
    text-align: center;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.generated-image-actions .btn-fullscreen {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.generated-image-actions .btn-fullscreen:hover {
    background: var(--bg-active);
}
.generated-image-actions .btn-download {
    background: var(--accent-gradient);
    color: white;
    border: none;
}
.generated-image-actions .btn-download:hover {
    box-shadow: var(--shadow-glow);
}

/* Image Generating Animation Box */
.image-generating-box {
    position: relative;
    background: #050508;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-gen-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        -45deg,
        transparent 40%,
        rgba(99, 102, 241, 0.03) 45%,
        rgba(99, 102, 241, 0.06) 50%,
        rgba(99, 102, 241, 0.03) 55%,
        transparent 60%
    );
    background-size: 300% 300%;
    animation: shimmer-move 2.5s ease-in-out infinite;
}
@keyframes shimmer-move {
    0% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
.image-gen-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.image-gen-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top-color: rgb(99, 102, 241);
    border-radius: 50%;
    animation: tool-spin 1s linear infinite;
    margin-bottom: 16px;
}
.image-gen-text {
    color: #e0e0e0;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.image-gen-hint {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.76rem;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay.show { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px; max-width: 400px; width: 90%;
    text-align: center;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
}
.modal-large { max-width: 550px; text-align: left; }
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    width: 60px; height: 60px; margin: 0 auto 16px;
    background: rgba(239, 68, 68, 0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; border-radius: 6px; transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-text { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-btn {
    padding: 10px 24px; border: none; border-radius: var(--radius-sm);
    font-family: var(--font-main); font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition-fast);
}
.modal-btn-cancel { background: var(--bg-hover); color: var(--text-primary); }
.modal-btn-cancel:hover { background: var(--bg-active); }
.modal-btn-delete { background: var(--danger); color: white; }
.modal-btn-delete:hover { background: var(--danger-hover); transform: translateY(-1px); }

/* ===== SETTINGS ===== */
.settings-body { max-height: 55vh; overflow-y: auto; }
.settings-group { margin-bottom: 20px; }
.settings-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.settings-hint { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

.settings-select, .settings-textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: var(--font-main);
    font-size: 0.88rem; outline: none;
    transition: border-color var(--transition-fast);
}
.settings-select:focus, .settings-textarea:focus { border-color: var(--accent-primary); }
.settings-textarea { resize: vertical; min-height: 80px; }

.settings-range {
    width: 100%; -webkit-appearance: none; appearance: none;
    height: 6px; background: var(--bg-hover);
    border-radius: 3px; outline: none;
}
.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
    background: var(--accent-primary); border-radius: 50%;
    cursor: pointer; transition: transform var(--transition-fast);
}
.settings-range::-webkit-slider-thumb:hover { transform: scale(1.2); }

.settings-toggle-group { display: flex; align-items: center; justify-content: space-between; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--bg-hover); border-radius: 24px;
    transition: all var(--transition-normal);
}
.toggle-slider::before {
    content: ''; position: absolute; width: 18px; height: 18px;
    left: 3px; bottom: 3px; background: white; border-radius: 50%;
    transition: all var(--transition-normal);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.settings-save-btn {
    width: 100%; padding: 12px;
    background: var(--accent-gradient); color: white;
    border: none; border-radius: var(--radius-sm);
    font-family: var(--font-main); font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: all var(--transition-normal);
}
.settings-save-btn:hover { box-shadow: var(--shadow-glow); transform: translateY(-1px); }

.settings-danger-zone {
    border-top: 1px solid rgba(239, 68, 68, 0.2);
    padding-top: 20px; margin-top: 8px;
}
.settings-danger-btn {
    width: 100%; padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger); font-family: var(--font-main);
    font-size: 0.85rem; cursor: pointer;
    transition: all var(--transition-fast);
}
.settings-danger-btn:hover { background: rgba(239, 68, 68, 0.2); }

/* ===== TOAST ===== */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; background: var(--bg-surface);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 0.85rem;
    box-shadow: var(--shadow-md); animation: toastIn 0.3s ease;
    display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar.open ~ .main-content .toggle-sidebar { display: none; }
    .sidebar-close-btn { display: flex; }
    .sidebar-overlay.open { display: block; }
    .toggle-sidebar { display: flex; }
    .feature-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .feature-cards { grid-template-columns: 1fr; }
    .empty-title { font-size: 1.6rem; }
    .message { padding: 16px; }
}
