/* ========================================
   IMAGE GEN LOCAL — Premium Redesign
   Inspired by ChatGPT / Midjourney
   ======================================== */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #171717;
    --bg-tertiary: #1e1e1e;
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-hover: rgba(255, 255, 255, 0.09);
    --bg-input-focus: rgba(255, 255, 255, 0.12);
    --bg-message-user: #2f2f2f;
    --bg-message-ai: transparent;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-button-primary: #ffffff;
    --bg-button-secondary: rgba(255, 255, 255, 0.08);
    --bg-button-secondary-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --text-on-primary: #0d0d0d;
    --accent-primary: #7c3aed;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%);
    --accent-glow: rgba(124, 58, 237, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(124, 58, 237, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    overflow-y: auto;
    min-height: 100vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
    z-index: 100;
    position: relative;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-switch-btn {
    padding: 10px 12px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--accent-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-switch-btn:hover {
    background: var(--bg-button-secondary-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.new-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.new-chat-btn:hover {
    background: var(--bg-button-secondary-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.new-chat-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.faq-btn {
    width: 36px;
    height: 40px;
    padding: 10px 12px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--accent-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-btn:hover {
    background: var(--bg-button-secondary-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.faq-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 4px 8px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.sidebar-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 2px 2px 0;
}

.sidebar-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-item:hover svg {
    opacity: 1;
}

.sidebar-spacer {
    flex: 1;
    min-height: 0;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border-subtle);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

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

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

.user-plan {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: var(--bg-primary);
    height: 100vh;
    overflow: hidden;
}

/* Scrollable content area */
.main-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    min-height: 0;
    padding-bottom: 120px;
}

.main-scroll::-webkit-scrollbar {
    width: 6px;
}

.main-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.main-scroll::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

.main-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ===== Chat Container ===== */
.chat-container {
    width: 100%;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

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

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

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

.chat-messages {
    max-width: 768px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Messages ===== */
.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.message.user .message-avatar {
    background: var(--accent-gradient);
}

.message.assistant .message-avatar {
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message.user .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: var(--bg-message-user);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: var(--bg-message-ai);
    color: var(--text-primary);
    padding: 0;
    border-radius: 0;
}

.message-bubble.error {
    background: var(--bg-message-error, #3b1a1a);
    border: 1px solid var(--border-error, #ff4444);
    color: #ff8888;
}

.message-text {
    white-space: pre-wrap;
}

/* ===== Generated Image ===== */
.image-container {
    margin-top: 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 512px;
    object-fit: contain;
    background: var(--bg-tertiary);
    transition: transform var(--transition-slow);
}

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

.image-actions {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.image-container:hover .image-actions {
    opacity: 1;
}

.image-action-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.image-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.image-action-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== Loading Animation ===== */
.loading-animation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
}

.loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    animation: loadingPulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.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.8);
        opacity: 0.3;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.loading-text {
    font-size: 13px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ===== Input Area ===== */
.input-area {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    z-index: 100;
    background: var(--bg-primary);
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    max-width: 768px;
    margin: 0 auto;
    position: relative;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: var(--radius-xl);
    padding: 8px 8px 8px 16px;
    transition: all var(--transition-fast);
    position: relative;
}

.input-container:focus-within {
    background: #1e1e1e;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), var(--shadow-md);
}

.input-container textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    padding: 6px 0;
    overflow-y: auto;
}

.input-container textarea::placeholder {
    color: var(--text-tertiary);
}

.input-container textarea::-webkit-scrollbar {
    width: 4px;
}

.input-container textarea::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.input-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

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

.send-btn {
    width: 34px;
    height: 34px;
    background: var(--accent-gradient) !important;
    color: white !important;
    border: none;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-fast);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--accent-glow);
}

.send-btn:disabled {
    background: var(--bg-button-secondary) !important;
    color: var(--text-tertiary) !important;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ===== Starter Screen ===== */
.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 56px 24px 40px;
    text-align: center;
    animation: fadeIn 0.5s ease;
    position: relative;
    width: 100%;
}

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

.start-screen-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 24px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.start-screen-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.start-screen h1 {
    font-size: 30px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.start-screen-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 400px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 680px;
    width: 100%;
}

.example-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.example-card:hover {
    transform: translateY(-4px);
}

.example-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.example-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    pointer-events: none;
}

.example-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin: 0;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity var(--transition-base);
    cursor: zoom-out;
}

.lightbox:not(.hidden) {
    display: flex;
    opacity: 1;
}

.lightbox.hidden {
    display: none;
    opacity: 0;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    touch-action: pinch-zoom;
    animation: lightboxZoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.lightbox-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

.lightbox-action-btn {
    padding: 8px 16px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.lightbox-action-btn:hover {
    background: var(--bg-button-secondary-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.lightbox-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== Ad Modal ===== */
.ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.ad-modal:not(.hidden) {
    display: flex;
    opacity: 1;
}

.ad-modal.hidden {
    display: none;
    opacity: 0;
}

.ad-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 32px 28px 28px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: adModalSlideIn 0.3s ease;
}

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

.ad-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.ad-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ad-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.ad-placeholder {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder-text {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.5;
}

.ad-timer {
    font-size: 40px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    line-height: 1;
}

.ad-timer-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.ad-skip-btn {
    padding: 12px 32px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    box-shadow: var(--shadow-glow);
}

.ad-skip-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px var(--accent-glow);
}

.ad-skip-btn:active {
    transform: translateY(0);
}

.ad-skip-btn:disabled {
    background: var(--bg-button-secondary) !important;
    color: var(--text-tertiary) !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ===== Mobile Header & Burger ===== */
.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    z-index: 150;
}

.mobile-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.burger-btn:hover {
    background: var(--bg-button-secondary-hover);
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 260px;
        z-index: 300;
        transition: left 0.3s ease;
        background: var(--bg-secondary);
        box-shadow: var(--shadow-lg);
        display: block;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 250;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .app-layout {
        width: 100%;
        padding-top: 0;
        flex-direction: column;
    }

    .main-content {
        width: 100%;
        min-width: 0;
    }

    .chat-messages {
        padding: 16px 12px;
    }

    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0;
        max-width: 100%;
        aspect-ratio: unset;
    }

    .example-card {
        width: 100%;
        height: auto;
        min-height: 140px;
        margin-bottom: 0;
        aspect-ratio: unset;
        display: block;
    }

    .example-card-overlay {
        padding: 10px 12px 10px;
    }

    .example-card-title {
        font-size: 12px;
    }

    .message-content {
        max-width: 85%;
    }

    .message.assistant .image-container img {
        max-height: 350px;
    }

    .image-actions {
        bottom: 8px;
    }

    .image-action-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .input-area {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        padding: 8px;
        bottom: 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
        z-index: 200;
    }

    .lightbox-actions {
        flex-direction: column;
    }

    .start-screen {
        padding: 24px 16px calc(140px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        justify-content: flex-start;
    }

    .start-screen h1 {
        font-size: 22px;
    }

    .start-screen-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .ad-content {
        padding: 24px 20px 20px;
        max-width: 340px;
    }

    .ad-timer {
        font-size: 32px;
    }

    .ad-placeholder {
        padding: 16px 12px;
        min-height: 100px;
    }

    .ad-close-btn {
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== FAQ Section ===== */
.faq-section {
    max-width: 720px;
    margin: 32px auto 0;
    padding: 0 16px;
}

.faq-title {
    font-size: 22px;
    font-weight: 700;
    color: #e8e8e8;
    margin-bottom: 16px;
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    transition: background 0.2s;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.faq-question {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px;
}

.faq-answer {
    font-size: 14px;
    color: #a0a0a0;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 768px) {
    .faq-section {
        margin: 24px auto 0;
    }
    .faq-title {
        font-size: 19px;
    }
}

/* ===== FAQ Modal ===== */
.faq-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.faq-modal:not(.hidden) {
    display: flex;
    opacity: 1;
}

.faq-modal.hidden {
    display: none;
    opacity: 0;
}

.faq-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
}

.faq-modal-content {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: faqModalSlideIn 0.3s ease;
    z-index: 1;
}

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

.faq-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--bg-button-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.faq-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px;
    text-align: center;
}

.faq-modal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-modal-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: background 0.2s;
}

.faq-modal-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.faq-modal-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.faq-modal-answer {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 768px) {
    .faq-modal-content {
        padding: 24px 16px 20px;
        width: 95%;
        max-height: 85vh;
    }
    .faq-modal-title {
        font-size: 18px;
    }
    .faq-modal-question {
        font-size: 13px;
    }
    .faq-modal-answer {
        font-size: 12px;
    }
}

/* ========================================
   SEO PAGES — generate-free / ai-image-generator / how-to-generate
   ======================================== */

.seo-page {
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-y: auto;
}

.seo-back-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 24px 0 0 24px;
    color: var(--accent-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ========================================
   SEO SECTIONS (Single Page)
   ======================================== */

/* ===== Section Base ===== */
.seo-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px 48px;
    scroll-margin-top: 20px;
}

.seo-section-inner {
    text-align: center;
}

.seo-section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    line-height: 1.3;
}

.seo-section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 40px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== ROADMAP (How It Works) ===== */
.roadmap {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    align-items: center;
}

.roadmap-step {
    width: 100%;
    position: relative;
}

/* Dashed connector lines between steps */
.roadmap-step-connector {
    width: 2px;
    height: 60px;
    margin: 0 auto;
    border: none;
    border-bottom: 2px dashed rgba(124, 58, 237, 0.3);
    position: relative;
}

/* Arrow indicator at the end of connector */
.roadmap-step-connector::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(124, 58, 237, 0.3);
}

/* Hide arrow on the last step */
.roadmap-step:last-child .roadmap-step-connector {
    border-bottom-color: transparent;
}

.roadmap-step:last-child .roadmap-step-connector::after {
    display: none;
}

/* Glass card for each step */
.roadmap-step-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.roadmap-step-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.3), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.roadmap-step-glass:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(124, 58, 237, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
}

.roadmap-step-glass:hover::before {
    opacity: 1;
}

/* Step number */
.roadmap-step-number {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.3);
    position: relative;
}

/* Glow ring around number */
.roadmap-step-number::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(124, 58, 237, 0.2);
    animation: step-glow 3s ease-in-out infinite;
}

@keyframes step-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.roadmap-step-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    text-align: center;
}

.roadmap-step-desc {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}


/* ===== FAQ Section ===== */
.seo-faq-section {
    background: transparent;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(124, 58, 237, 0.15);
}

.faq-item.active {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.25);
}

.faq-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

/* Expand/collapse icon */
.faq-question::after {
    content: '+';
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 50%;
    font-size: 16px;
    font-weight: 400;
    color: var(--accent-secondary);
    transition: all var(--transition-fast);
}

.faq-item.active .faq-question::after {
    content: '−';
    background: rgba(124, 58, 237, 0.25);
}

.faq-answer {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity var(--transition-fast);
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    opacity: 1;
}

/* ===== Text Section (Why Free) ===== */
.seo-text-section {
    background: transparent;
}

.seo-text-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0 0 16px;
    text-align: center;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.seo-text-content:last-child {
    margin-bottom: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .seo-section {
        padding: 40px 16px 32px;
    }

    .seo-section-title {
        font-size: 22px;
    }

    .seo-section-subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .roadmap-step-glass {
        padding: 24px 20px;
    }

    .roadmap-step-number {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .roadmap-step-title {
        font-size: 17px;
    }

    .roadmap-step-desc {
        font-size: 14px;
    }

    .roadmap-step-connector {
        height: 40px;
    }

    .faq-item {
        padding: 16px 18px;
    }

    .faq-question {
        font-size: 15px;
    }

    .faq-answer {
        font-size: 13px;
    }

    .seo-text-content {
        font-size: 14px;
    }
}

/* Scrollbar for SEO sections */
.seo-section::-webkit-scrollbar {
    display: none;
}

