/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f9ff; /* Very light blue for sidebar */
    --bg-tertiary: #e0f2fe;
    --bg-card: rgba(59, 130, 246, 0.05); /* Light blue tint cards */
    --bg-card-hover: rgba(59, 130, 246, 0.08);
    --border-subtle: rgba(59, 130, 246, 0.1);
    --border-active: rgba(59, 130, 246, 0.3);
    --text-primary: #0f172a; /* Slate 900 for high contrast */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8; /* Slate 400 */
    --accent-primary: #3b82f6; /* Vibrant Blue */
    --accent-secondary: #0ea5e9; /* Sky Blue */
    --accent-gradient: linear-gradient(135deg, #3b82f6, #2dd4bf);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(59, 130, 246, 0.08);
    --shadow-md: 0 4px 16px rgba(59, 130, 246, 0.12);
    --shadow-lg: 0 8px 32px rgba(59, 130, 246, 0.15);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background ambient glow */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(45, 212, 191, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ===== HEADER ===== */
.header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
}

.logo:hover .logo-icon {
    transform: rotate(15deg) scale(1.1);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== PWA INSTALL BUTTON ===== */
.install-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-active);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.install-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.install-btn.visible {
    display: flex;
}

/* ===== MAIN LAYOUT ===== */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: calc(100vh - 65px);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 380px;
    min-width: 380px;
    padding: 24px;
    border-right: 1px solid var(--border-subtle);
    background: rgba(240, 249, 255, 0.7);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

/* ===== CONTROLS ===== */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

/* Prompt Helper Button */
.prompt-helper-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--accent-primary);
    font-size: 0.65rem;
    font-weight: 600;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.prompt-helper-btn:hover {
    background: rgba(129, 140, 248, 0.15);
    border-color: var(--accent-primary);
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
}

.avatar-upload-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.upload-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.avatar-preview-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}

.avatar-preview-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.remove-avatar-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0 6px 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-avatar-btn:hover { color: #ef4444; }

/* ===== INPUTS ===== */
.handle-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.handle-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.handle-input::placeholder { color: var(--text-muted); }

.text-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    transition: all var(--transition-fast);
    outline: none;
    line-height: 1.6;
}

.text-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.text-input::placeholder { color: var(--text-muted); font-size: 0.75rem; }

.main-textarea { min-height: 200px; font-size: 0.85rem; line-height: 1.7; }

.input-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 8px 12px;
    background: rgba(129, 140, 248, 0.06);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(129, 140, 248, 0.1);
}

/* ===== THEME GRID ===== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
}

.theme-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.theme-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.theme-btn.active {
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-primary);
}

.theme-preview { width: 100%; height: 28px; border-radius: 6px; }

.midnight-preview { background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca); }
.ocean-preview { background: linear-gradient(135deg, #0c4a6e, #0369a1, #0ea5e9); }
.sunset-preview { background: linear-gradient(135deg, #7c2d12, #ea580c, #f59e0b); }
.minimal-preview { background: linear-gradient(135deg, #f8fafc, #e2e8f0, #cbd5e1); }
.neon-preview { background: linear-gradient(135deg, #0f0f23, #1a0533, #0f172a); }
.forest-preview { background: linear-gradient(135deg, #064e3b, #065f46, #10b981); }
.coral-preview { background: linear-gradient(135deg, #be123c, #f43f5e, #fda4af); }
.lavender-preview { background: linear-gradient(135deg, #581c87, #9333ea, #c4b5fd); }
.charcoal-preview { background: linear-gradient(135deg, #18181b, #3f3f46, #71717a); }
.aurora-preview { background: linear-gradient(135deg, #0f766e, #2dd4bf, #a78bfa); }
.candy-preview { background: linear-gradient(135deg, #db2777, #f472b6, #fde047); }

/* ===== SIZE OPTIONS ===== */
.size-options { display: flex; gap: 8px; }

.size-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.size-btn:hover { background: var(--bg-card-hover); }

.size-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.size-btn.active {
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-primary);
}

/* ===== FONT SELECTOR ===== */
.font-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.font-select:hover {
    border-color: var(--border-active);
    background-color: var(--bg-card-hover);
}

.font-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.font-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* ===== RANGE SLIDER ===== */
.range-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

/* Webkit (Chrome, Safari, Edge) */
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.4);
    transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* FIX: Firefox range slider styling */
.range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.4);
    transition: transform var(--transition-fast);
}

.range-slider::-moz-range-thumb:hover { transform: scale(1.2); }

.range-slider::-moz-range-track {
    background: var(--bg-tertiary);
    border-radius: 999px;
    height: 6px;
    border: none;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

#fontSizeValue { color: var(--accent-primary); font-weight: 600; }

/* ===== GENERATE BUTTON ===== */
.generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(129, 140, 248, 0.45);
}

.generate-btn:hover::before { opacity: 1; }
.generate-btn:active { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== PREVIEW AREA ===== */
.preview-area {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.preview-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.slide-count-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-primary);
    margin-left: 8px;
}

.preview-actions { display: flex; gap: 8px; }

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

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.primary-action {
    background: rgba(129, 140, 248, 0.12);
    border-color: rgba(129, 140, 248, 0.3);
    color: var(--accent-primary);
}

.primary-action:hover { background: rgba(129, 140, 248, 0.2); }

/* ===== SLIDES CONTAINER ===== */
.slides-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-content: flex-start;
}

.slide-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: grab;
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

.slide-card:hover { transform: scale(1.02); }
.slide-card.dragging { 
    opacity: 0.5; 
    cursor: grabbing;
    transform: scale(1.05);
}
.slide-card.drag-over { 
    box-shadow: 0 0 0 3px var(--accent-primary), var(--shadow-lg);
    transform: scale(1.02);
}

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

/* Drag handle */
.drag-handle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 5;
    cursor: grab;
}

.slide-card:hover .drag-handle { opacity: 1; }
.drag-handle:hover { background: rgba(129, 140, 248, 0.7); color: white; }

/* Slide action buttons group */
.slide-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.slide-card:hover .slide-actions { opacity: 1; }

.slide-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.slide-action-btn:hover {
    transform: scale(1.1);
}

.slide-action-btn.edit-slide:hover { background: rgba(59, 130, 246, 0.8); }
.slide-action-btn.delete-slide:hover { background: rgba(239, 68, 68, 0.8); }
.slide-action-btn.download-single:hover { background: rgba(129, 140, 248, 0.8); }

/* ===== CONTENT STATUS BADGE (Smart Balancing) ===== */
.content-status {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition-fast);
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.slide-card:hover .content-status { opacity: 1; }

.content-status.status-ok {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.content-status.status-warning {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.content-status.status-short {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.split-slide-btn {
    padding: 2px 8px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.split-slide-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Content warning visual indicator on slide */
.slide-inner.content-warning {
    box-shadow: inset 0 0 0 3px rgba(245, 158, 11, 0.4);
}

.slide-inner.content-short {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* ===== SLIDE INNER (Preview) ===== */
.slide-inner {
    width: 320px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 36px;
    position: relative;
    overflow: hidden;
}

.slide-inner.portrait { aspect-ratio: 4 / 5; }

/* Base gradient overlay with light effects */
.slide-inner::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12) 0%, transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 35%),
        radial-gradient(circle at 60% 30%, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Noise/grain texture overlay for premium feel */
.slide-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.slide-number-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.6;
    margin-bottom: 10px;
    z-index: 2;
}

.slide-title-text {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 14px;
    z-index: 2;
    max-width: 90%;
}

/* Font family classes for preview slides */
.slide-inner.font-playfair .slide-title-text { font-family: 'Playfair Display', Georgia, serif; }
.slide-inner.font-inter .slide-title-text { font-family: 'Inter', -apple-system, sans-serif; }
.slide-inner.font-poppins .slide-title-text { font-family: 'Poppins', -apple-system, sans-serif; }
.slide-inner.font-space .slide-title-text { font-family: 'Space Grotesk', -apple-system, sans-serif; }
.slide-inner.font-merriweather .slide-title-text { font-family: 'Merriweather', Georgia, serif; }
.slide-inner.font-outfit .slide-title-text { font-family: 'Outfit', -apple-system, sans-serif; }

.slide-body-text {
    font-size: 0.78rem;
    font-weight: 400;
    text-align: center;
    line-height: 1.65;
    opacity: 0.85;
    z-index: 2;
    max-width: 88%;
}

.slide-author-combo {
    position: absolute;
    bottom: 18px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.slide-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slide-handle {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.8;
}

.slide-page-indicator {
    position: absolute;
    bottom: 18px;
    right: 18px;
    font-size: 0.55rem;
    font-weight: 700;
    opacity: 0.4;
    z-index: 2;
}

/* Title slide special styling */
.slide-inner.title-slide .slide-title-text { font-size: 1.6rem; margin-bottom: 10px; }
.slide-inner.title-slide .slide-body-text { font-size: 0.85rem; opacity: 0.65; font-style: italic; }

/* Decorative corner shapes - enhanced blobs */
.slide-deco-tl {
    position: absolute; top: -25px; left: -25px;
    width: 90px; height: 90px; 
    border-radius: 60% 40% 50% 70% / 50% 60% 40% 60%;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    z-index: 0;
    animation: morphBlob1 8s ease-in-out infinite;
}

.slide-deco-br {
    position: absolute; bottom: -35px; right: -35px;
    width: 110px; height: 110px; 
    border-radius: 50% 60% 40% 70% / 60% 40% 70% 50%;
    background: linear-gradient(315deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%);
    z-index: 0;
    animation: morphBlob2 10s ease-in-out infinite;
}

/* Additional decorative elements */
.slide-inner .slide-deco-accent {
    position: absolute;
    top: 50%;
    right: -60px;
    width: 120px;
    height: 120px;
    border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    z-index: 0;
    animation: morphBlob3 12s ease-in-out infinite;
}

@keyframes morphBlob1 {
    0%, 100% { border-radius: 60% 40% 50% 70% / 50% 60% 40% 60%; transform: rotate(0deg) scale(1); }
    50% { border-radius: 40% 60% 70% 50% / 60% 40% 60% 50%; transform: rotate(10deg) scale(1.05); }
}

@keyframes morphBlob2 {
    0%, 100% { border-radius: 50% 60% 40% 70% / 60% 40% 70% 50%; transform: rotate(0deg) scale(1); }
    50% { border-radius: 70% 40% 60% 50% / 40% 70% 50% 60%; transform: rotate(-10deg) scale(1.08); }
}

@keyframes morphBlob3 {
    0%, 100% { border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; opacity: 1; }
    50% { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; opacity: 0.6; }
}

.slide-accent-line {
    width: 40px; height: 3px; border-radius: 2px;
    background: currentColor; opacity: 0.3;
    margin-bottom: 14px; z-index: 1;
}

.accent-text {
    color: var(--accent-secondary);
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* CTA slide */
.slide-inner.cta-slide .slide-title-text { font-size: 1.5rem; }
.slide-inner.cta-slide .slide-body-text { opacity: 0.6; font-size: 0.8rem; }

/* ===== THEME BACKGROUNDS - Enhanced with mesh gradients ===== */
.theme-midnight { 
    background: 
        radial-gradient(ellipse at 10% 90%, rgba(99, 102, 241, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 10%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%); 
    color: #e0e7ff; 
}

.theme-ocean { 
    background: 
        radial-gradient(ellipse at 0% 100%, rgba(14, 165, 233, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(56, 189, 248, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0ea5e9 100%); 
    color: #e0f2fe; 
}

.theme-sunset { 
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(251, 146, 60, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 20%, rgba(245, 158, 11, 0.4) 0%, transparent 45%),
        linear-gradient(135deg, #7c2d12 0%, #ea580c 50%, #f59e0b 100%); 
    color: #fff7ed; 
}

.theme-minimal { 
    background: 
        radial-gradient(ellipse at 30% 70%, rgba(148, 163, 184, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(203, 213, 225, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%); 
    color: #1e293b; 
}
.theme-minimal .slide-deco-tl,
.theme-minimal .slide-deco-br { background: rgba(0,0,0,0.03); }
.theme-minimal::after { opacity: 0.02; }

.theme-neon { 
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, #0f0f23 0%, #1a0533 50%, #0f172a 100%); 
    color: #e9d5ff; 
}
.theme-neon .slide-title-text { text-shadow: 0 0 30px rgba(168, 85, 247, 0.6), 0 0 60px rgba(168, 85, 247, 0.3); }
.theme-neon .slide-deco-tl { background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, transparent 100%); }
.theme-neon .slide-deco-br { background: linear-gradient(315deg, rgba(236, 72, 153, 0.12) 0%, transparent 100%); }

.theme-forest { 
    background: 
        radial-gradient(ellipse at 10% 90%, rgba(16, 185, 129, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 20%, rgba(52, 211, 153, 0.25) 0%, transparent 50%),
        linear-gradient(135deg, #064e3b 0%, #065f46 50%, #10b981 100%); 
    color: #d1fae5; 
}

.theme-coral { 
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(253, 164, 175, 0.4) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 20%, rgba(244, 63, 94, 0.3) 0%, transparent 45%),
        linear-gradient(135deg, #be123c 0%, #f43f5e 50%, #fda4af 100%); 
    color: #fff1f2; 
}

.theme-lavender { 
    background: 
        radial-gradient(ellipse at 0% 50%, rgba(196, 181, 253, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 50%, rgba(147, 51, 234, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #581c87 0%, #9333ea 50%, #c4b5fd 100%); 
    color: #faf5ff; 
}
.theme-lavender .slide-title-text { text-shadow: 0 0 25px rgba(196, 181, 253, 0.4); }

.theme-charcoal { 
    background: 
        radial-gradient(ellipse at 30% 70%, rgba(113, 113, 122, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(82, 82, 91, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #18181b 0%, #3f3f46 50%, #71717a 100%); 
    color: #fafafa; 
}

.theme-aurora { 
    background: 
        radial-gradient(ellipse at 0% 0%, rgba(167, 139, 250, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(45, 212, 191, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(52, 211, 153, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, #0f766e 0%, #2dd4bf 50%, #a78bfa 100%); 
    color: #f0fdfa; 
}
.theme-aurora .slide-title-text { text-shadow: 0 0 35px rgba(45, 212, 191, 0.5), 0 0 70px rgba(167, 139, 250, 0.3); }
.theme-aurora .slide-deco-tl { background: linear-gradient(135deg, rgba(45, 212, 191, 0.2) 0%, transparent 100%); }
.theme-aurora .slide-deco-br { background: linear-gradient(315deg, rgba(167, 139, 250, 0.15) 0%, transparent 100%); }

.theme-candy { 
    background: 
        radial-gradient(ellipse at 10% 10%, rgba(253, 224, 71, 0.4) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 90%, rgba(244, 114, 182, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(219, 39, 119, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #db2777 0%, #f472b6 50%, #fde047 100%); 
    color: #fdf2f8; 
}
.theme-candy .slide-deco-tl { background: linear-gradient(135deg, rgba(253, 224, 71, 0.2) 0%, transparent 100%); }
.theme-candy .slide-deco-br { background: linear-gradient(315deg, rgba(244, 114, 182, 0.15) 0%, transparent 100%); }

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    padding: 80px 40px; width: 100%;
}

.empty-icon { margin-bottom: 20px; opacity: 0.15; animation: float 3s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); max-width: 320px; line-height: 1.6; }

/* ===== HIDDEN RENDER AREA ===== */
.render-area { position: fixed; top: -9999px; left: -9999px; pointer-events: none; z-index: -1; }

.render-slide {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; padding: 80px; position: relative; overflow: hidden;
}

/* Enhanced light effects for export */
.render-slide::before {
    content: '';
    position: absolute; width: 200%; height: 200%; top: -50%; left: -50%;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12) 0%, transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 35%),
        radial-gradient(circle at 60% 30%, rgba(255,255,255,0.05) 0%, transparent 40%);
    z-index: 0;
}

/* Noise texture for export slides */
.render-slide::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* Enhanced decorative blobs for export */
.render-slide .slide-deco-tl { 
    position: absolute; top: -50px; left: -50px; 
    width: 200px; height: 200px; 
    border-radius: 60% 40% 50% 70% / 50% 60% 40% 60%;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    z-index: 0;
}
.render-slide .slide-deco-br { 
    position: absolute; bottom: -70px; right: -70px; 
    width: 240px; height: 240px; 
    border-radius: 50% 60% 40% 70% / 60% 40% 70% 50%;
    background: linear-gradient(315deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 100%);
    z-index: 0;
}
.render-slide .slide-accent-line { width: 80px; height: 4px; border-radius: 2px; background: currentColor; opacity: 0.3; margin-bottom: 28px; z-index: 2; }
.render-slide .slide-number-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.6; margin-bottom: 24px; z-index: 2; }
.render-slide .slide-title-text { font-weight: 800; text-align: center; line-height: 1.3; margin-bottom: 32px; z-index: 2; max-width: 85%; }
.render-slide .slide-body-text { font-weight: 400; text-align: center; line-height: 1.7; opacity: 0.85; z-index: 2; max-width: 80%; }

/* Font family classes for render slides */
.render-slide.font-playfair .slide-title-text { font-family: 'Playfair Display', Georgia, serif; }
.render-slide.font-inter .slide-title-text { font-family: 'Inter', -apple-system, sans-serif; }
.render-slide.font-poppins .slide-title-text { font-family: 'Poppins', -apple-system, sans-serif; }
.render-slide.font-space .slide-title-text { font-family: 'Space Grotesk', -apple-system, sans-serif; }
.render-slide.font-merriweather .slide-title-text { font-family: 'Merriweather', Georgia, serif; }
.render-slide.font-outfit .slide-title-text { font-family: 'Outfit', -apple-system, sans-serif; }

.render-slide .slide-handle { font-size: 14px; font-weight: 600; opacity: 0.5; z-index: 2; } /* Fallback */

.render-slide .slide-author-combo {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.render-slide .slide-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.render-slide .slide-author-combo .slide-handle {
    position: relative;
    bottom: auto;
    left: auto;
    font-size: 18px;
    font-weight: 600;
    opacity: 0.85;
}
.render-slide .slide-page-indicator { position: absolute; bottom: 40px; right: 40px; font-size: 12px; font-weight: 700; opacity: 0.4; z-index: 2; }

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
}

.loading-overlay.active { display: flex; }

.loading-content { text-align: center; }

.loading-spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.loading-sub { font-size: 0.8rem; color: var(--text-muted); }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px; border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.9); backdrop-filter: blur(8px);
    color: white; font-size: 0.85rem; font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000; pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(239, 68, 68, 0.9); }

/* ===== LICENSE MODAL ===== */
.license-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.license-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.4s ease;
}

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

.license-modal .logo-icon { margin: 0 auto 16px; }

.license-modal h2 {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.license-modal .version-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.license-terms {
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.license-terms h4 {
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.license-terms ul {
    list-style: none;
    padding: 0;
}

.license-terms li {
    padding: 4px 0;
    padding-left: 18px;
    position: relative;
}

.license-terms li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--accent-primary);
}

.license-terms li.allowed::before {
    content: '✓';
    color: #10b981;
}

.license-terms li.forbidden::before {
    content: '✗';
    color: #ef4444;
}

.license-accept-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.3);
}

.license-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(129, 140, 248, 0.45);
}

.license-accept-btn svg {
    display: inline;
    vertical-align: middle;
    margin-right: 6px;
}

/* ===== ACCESS GATE ===== */
.gate-view {
    width: 100%;
}

.gate-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.gate-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-align: left;
}

.gate-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
    text-align: center;
}

.gate-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.gate-input::placeholder {
    color: var(--text-muted);
}

.gate-error {
    font-size: 0.78rem;
    color: #ef4444;
    font-weight: 500;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.gate-success {
    font-size: 0.82rem;
    color: #10b981;
    font-weight: 500;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    margin-top: 12px;
    line-height: 1.5;
}

.gate-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gate-divider::before,
.gate-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.gate-link-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
    padding: 8px;
}

.gate-link-btn:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ===== APP FOOTER ===== */
.app-footer {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 32px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(10, 10, 15, 0.6);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.app-footer .not-for-sale {
    color: #ef4444;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== SLIDE EDITOR MODAL ===== */
.slide-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.slide-editor-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.slide-editor-modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.editor-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.editor-input,
.editor-textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    margin-bottom: 16px;
}

.editor-input:focus,
.editor-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.editor-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.editor-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.editor-btn.cancel-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

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

.editor-btn.save-btn {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.editor-btn.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(129, 140, 248, 0.4);
}

/* ===== PROMPT HELPER MODAL ===== */
.prompt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.prompt-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.prompt-modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-modal .modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.prompt-template {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.prompt-template::-webkit-scrollbar { width: 6px; }
.prompt-template::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

.prompt-actions {
    display: flex;
    gap: 12px;
}

.prompt-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.prompt-btn.copy-btn {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.prompt-btn.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(129, 140, 248, 0.4);
}

.prompt-btn.close-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

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

.prompt-tips {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.prompt-tips h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.prompt-tips ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prompt-tips li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
}

.prompt-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .app-container { 
        flex-direction: column; 
        height: auto; 
        min-height: unset; 
    }
    .sidebar { 
        width: 100%; 
        min-width: unset; 
        border-right: none; 
        border-bottom: 1px solid var(--border-subtle); 
        max-height: none; 
        overflow-y: visible;
        padding: 20px;
    }
    .header { 
        flex-direction: column; 
        gap: 12px; 
        text-align: center; 
        padding: 16px; 
    }
    .header-right { 
        justify-content: center; 
        width: 100%;
        gap: 12px;
    }
    .slide-inner { 
        width: 320px; 
        height: 320px; 
    }
    .slides-container { 
        justify-content: flex-start; 
        padding: 16px 0; 
        /* Ensure smooth horizontal scroll on touch */
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    .slide-wrapper {
        scroll-snap-align: center;
    }
    .preview-area { 
        padding: 16px; 
        overflow-y: visible; 
        flex: none; 
        min-height: 500px; 
    }
    .preview-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 16px; 
    }
    .preview-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sidebar { 
        padding: 16px; 
    }
    .slide-inner { 
        width: 280px; 
        height: 280px; 
    }
    .theme-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .license-modal { 
        padding: 20px; 
        width: 95%;
        max-height: 95vh;
    }
    .header-right {
        flex-direction: column;
    }
}
