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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --bg: #f7f7f8;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(99, 102, 241, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
}

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

/* ====== HEADER ====== */
.slides-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.logo-text span {
    color: var(--primary);
}

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

.header-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ====== INPUT VIEW ====== */
.input-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 24px 80px;
}

.input-container {
    max-width: 640px;
    width: 100%;
    text-align: center;
}

.slides-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
}

.slides-icon svg {
    width: 36px;
    height: 36px;
    color: white;
}

.input-container h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.input-container .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.prompt-box {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.prompt-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.prompt-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.6;
    color: var(--text);
    background: transparent;
    min-height: 100px;
}

.prompt-textarea::placeholder {
    color: #94a3b8;
}

.prompt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.char-count {
    font-size: 12px;
    color: #94a3b8;
}

/* ====== MODE SELECTOR ====== */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.mode-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.mode-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.mode-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.mode-card .mode-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.mode-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mode-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.mode-card .mode-time {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
}

/* ====== GENERATE BUTTON ====== */
.generate-btn {
    width: 100%;
    margin-top: 20px;
    padding: 16px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* ====== PROGRESS VIEW ====== */
.progress-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 40px 24px;
}

.progress-view.active {
    display: flex;
}

.progress-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.progress-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.progress-steps {
    margin-top: 28px;
    text-align: left;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: #94a3b8;
    transition: color 0.3s;
}

.progress-step.active {
    color: var(--primary);
    font-weight: 500;
}

.progress-step.done {
    color: #10b981;
}

.progress-step .step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    transition: all 0.3s;
}

.progress-step.active .step-icon {
    background: var(--primary);
    color: white;
}

.progress-step.done .step-icon {
    background: #10b981;
    color: white;
}

/* ====== VIEWER ====== */
.viewer-view {
    display: none;
    height: calc(100vh - 56px);
}

.viewer-view.active {
    display: flex;
}

/* Sidebar */
.viewer-sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 12px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0 8px 12px;
}

.slide-thumb {
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.slide-thumb:hover {
    background: var(--primary-light);
}

.slide-thumb.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.slide-thumb .thumb-number {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.slide-thumb .thumb-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Main slide area */
.viewer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.toolbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.slide-counter {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: center;
}

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

.toolbar-action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.toolbar-action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toolbar-action-btn.primary:hover {
    background: var(--primary-hover);
}

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

/* Slide canvas */
.slide-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: auto;
    background: var(--bg);
}

.slide-card {
    width: 100%;
    max-width: 840px;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.08);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ====== DECORATIVE SHAPES (all slide types) ====== */
.slide-card::before,
.slide-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.slide-card > * {
    position: relative;
    z-index: 1;
}

/* ====== TITLE SLIDE ====== */
.slide-card.type-title {
    text-align: center;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 40%),
        linear-gradient(135deg, var(--theme-dark, #1e1b4b) 0%, var(--theme-primary, #6366f1) 40%, var(--theme-accent, #818cf8) 100%);
    color: white;
}

.slide-card.type-title::before {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    top: -80px;
    right: -60px;
}

.slide-card.type-title::after {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    bottom: -40px;
    left: -30px;
}

.slide-card.type-title .slide-deco-line {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.slide-card.type-title h2 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.15);
    line-height: 1.2;
}

.slide-card.type-title .slide-subtitle {
    font-size: 17px;
    opacity: 0.9;
    font-weight: 400;
    max-width: 70%;
    line-height: 1.5;
}

/* ====== SECTION SLIDE ====== */
.slide-card.type-section {
    text-align: center;
    justify-content: center;
    align-items: center;
    background:
        linear-gradient(160deg, var(--theme-dark, #1e1b4b) 0%, var(--theme-primary, #6366f1) 100%);
    color: white;
}

.slide-card.type-section::before {
    width: 500px;
    height: 500px;
    border: 2px solid rgba(255,255,255,0.06);
    background: none;
    top: -200px;
    left: -100px;
}

.slide-card.type-section::after {
    width: 350px;
    height: 350px;
    border: 2px solid rgba(255,255,255,0.04);
    background: none;
    bottom: -150px;
    right: -80px;
}

.slide-card.type-section .slide-section-number {
    font-size: 64px;
    font-weight: 900;
    opacity: 0.12;
    position: absolute;
    top: 20px;
    left: 30px;
    line-height: 1;
}

.slide-card.type-section h2 {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.slide-card.type-section .slide-subtitle {
    font-size: 16px;
    opacity: 0.75;
    max-width: 65%;
}

/* ====== CONTENT SLIDE ====== */
.slide-card.type-content {
    background: var(--surface);
    padding-left: 64px;
}

.slide-card.type-content::before {
    width: 6px;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--theme-primary, #6366f1) 0%, var(--theme-light, #c7d2fe) 100%);
    top: 0;
    left: 0;
}

.slide-card.type-content::after {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--theme-light, #c7d2fe) 0%, transparent 70%);
    opacity: 0.2;
    bottom: -60px;
    right: -40px;
}

.slide-card.type-content .slide-header-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.slide-card.type-content .slide-header-bar .slide-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--theme-primary, #6366f1), var(--theme-accent, #818cf8));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.slide-card.type-content h2,
.slide-card.type-summary h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text);
    border-bottom: none;
    padding-bottom: 0;
    display: block;
}

/* ====== NUMBERED BULLETS ====== */
.slide-bullets {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.slide-bullets li {
    font-size: 16px;
    line-height: 1.55;
    padding: 10px 14px 10px 48px;
    position: relative;
    color: #334155;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.slide-bullets li:hover {
    background: rgba(99, 102, 241, 0.04);
}

.slide-bullets li::before {
    content: attr(data-index);
    position: absolute;
    left: 8px;
    top: 10px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--theme-light, #eef2ff);
    color: var(--theme-primary, #6366f1);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 26px;
}

/* ====== SUMMARY SLIDE ====== */
.slide-card.type-summary {
    border-left: none;
    background:
        linear-gradient(135deg, rgba(99,102,241,0.03) 0%, rgba(99,102,241,0.08) 100%);
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 3%, white) 0%,
            color-mix(in srgb, var(--theme-primary, #6366f1) 8%, white) 100%);
    padding-left: 64px;
}

.slide-card.type-summary::before {
    width: 6px;
    height: 100%;
    border-radius: 3px;
    background: var(--theme-primary, #6366f1);
    top: 0;
    left: 0;
}

.slide-card.type-summary::after {
    content: '\2714';
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    font-size: 120px;
    opacity: 0.04;
    bottom: 10px;
    right: 30px;
    color: var(--theme-primary, #6366f1);
}

.slide-card.type-summary .slide-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--theme-primary, #6366f1);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.slide-number-badge {
    position: absolute;
    bottom: 16px;
    right: 24px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.slide-card .slide-footer-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--theme-primary, #6366f1) 0%, var(--theme-accent, #818cf8) 50%, transparent 100%);
}

/* Speaker Notes */
.notes-panel {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    max-height: 120px;
    overflow-y: auto;
}

.notes-panel.hidden {
    display: none;
}

.notes-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.notes-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .input-container h1 { font-size: 24px; }
    .input-container .subtitle { font-size: 14px; }
    .mode-selector { grid-template-columns: 1fr; }
    .viewer-sidebar { display: none; }
    .slide-canvas { padding: 16px; }
    .slide-card { padding: 28px 24px; }
    .slide-card.type-content, .slide-card.type-summary { padding-left: 36px; }
    .slide-card.type-title h2 { font-size: 24px; }
    .slide-card.type-section h2 { font-size: 22px; }
    .slide-card.type-content h2, .slide-card.type-summary h2 { font-size: 18px; }
    .slide-bullets li { font-size: 14px; padding-left: 40px; }
    .slide-card.type-section .slide-section-number { font-size: 40px; }
    .slide-card.type-content .slide-icon-circle { width: 32px; height: 32px; font-size: 14px; }
    .toolbar-actions .toolbar-text { display: none; }
    .slides-header { padding: 0 16px; }
    .progress-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .slide-card { aspect-ratio: auto; min-height: 300px; }
}

/* ====== UNIFIED HEADER UPDATES ====== */
.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.home-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.header-btn-accent {
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
    color: var(--primary) !important;
}

.header-btn-accent:hover {
    background: rgba(99, 102, 241, 0.14) !important;
}

.header-btn-accent svg {
    fill: var(--primary);
}

/* ====== PAYWALL OVERLAY ====== */
.paywall-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

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

.paywall-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: paywallIn 0.25s ease-out;
}

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

.paywall-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.paywall-close:hover {
    color: var(--text);
}

.paywall-icon {
    width: 72px;
    height: 72px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
}

.paywall-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.paywall-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.paywall-btn {
    display: inline-block;
    padding: 14px 36px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.paywall-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* ====== LOCKED THUMBNAILS ====== */
.slide-thumb.locked {
    opacity: 0.5;
    position: relative;
}

.slide-thumb.locked .thumb-title {
    filter: blur(3px);
}

.slide-thumb.locked .lock-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.slide-thumb.locked .lock-badge svg {
    width: 12px;
    height: 12px;
}

/* ====== LOCKED SLIDE OVERLAY ====== */
.slide-locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 10;
}

.slide-locked-overlay .lock-icon-big {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
}

.slide-locked-overlay p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.slide-locked-overlay .unlock-btn {
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.slide-locked-overlay .unlock-btn:hover {
    background: var(--primary-hover);
}

/* ====== DOWNLOAD DROPDOWN ====== */
.download-dropdown {
    position: relative;
}

.download-dropdown .chevron-icon {
    width: 14px;
    height: 14px;
    margin-left: 2px;
    transition: transform 0.2s;
}

.download-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

.download-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: dropdownIn 0.15s ease-out;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.download-dropdown.open .download-menu {
    display: block;
}

.download-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text);
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    white-space: nowrap;
}

.download-menu button:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.download-menu button svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.download-menu button:hover svg {
    color: var(--primary);
}

/* ====== SELECTOR SECTIONS ====== */
.selector-section {
    width: 100%;
    max-width: 620px;
    margin: 0 auto 18px;
}

.selector-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====== STYLE CHIPS ====== */
.style-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.style-chip {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.style-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.style-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ====== THEME COLOR CIRCLES ====== */
.theme-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.theme-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    background: none;
    cursor: pointer;
    padding: 3px;
    transition: all 0.15s;
}

.theme-circle span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.theme-circle:hover {
    transform: scale(1.15);
}

.theme-circle.active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-secondary);
}

/* ====== LANGUAGE PILLS ====== */
.lang-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.lang-pill {
    padding: 7px 18px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.lang-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lang-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ====== SLIDE COUNT SLIDER ====== */
.slide-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.range-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
}

.slide-count-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 300px;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.slide-count-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--surface);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.15s;
}

.slide-count-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slide-count-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--surface);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    cursor: pointer;
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 600px) {
    .style-selector {
        gap: 6px;
    }
    .style-chip {
        padding: 6px 12px;
        font-size: 12px;
    }
    .theme-circle {
        width: 32px;
        height: 32px;
    }
    .lang-pill {
        padding: 6px 14px;
        font-size: 12px;
    }
}

/* ====== HISTORY SECTION ====== */
.history-section {
    width: 100%;
    max-width: 620px;
    margin: 32px auto 0;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.history-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.history-clear-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}

.history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.history-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.history-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.history-item-body {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.history-item-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ====== FEEDBACK BAR ====== */
.feedback-bar {
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.feedback-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 840px;
    margin: 0 auto;
}

.feedback-input-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.feedback-input-row input:focus {
    border-color: var(--theme-primary, var(--primary));
}

.feedback-send-btn {
    padding: 10px 20px;
    background: var(--theme-primary, var(--primary));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    position: relative;
}

.feedback-send-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.feedback-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.feedback-send-btn.loading {
    color: transparent;
}

.feedback-send-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: feedbackSpin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
    .feedback-bar { padding: 8px 12px; }
    .feedback-input-row input { font-size: 13px; padding: 8px 10px; }
    .feedback-send-btn { padding: 8px 14px; font-size: 13px; }
}

/* ====== ENHANCED DESIGN: PATTERNS & DEPTH ====== */

/* Title slide: dot pattern overlay + frosted subtitle */
.slide-card.type-title {
    background-image:
        radial-gradient(circle at 2px 2px, rgba(255,255,255,0.07) 1px, transparent 0),
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 40%),
        linear-gradient(135deg, var(--theme-dark, #1e1b4b) 0%, var(--theme-primary, #6366f1) 40%, var(--theme-accent, #818cf8) 100%);
    background-size: 24px 24px, 100% 100%, 100% 100%, 100% 100%;
}

.slide-card.type-title .slide-subtitle {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 24px;
    border-radius: 10px;
    margin-top: 4px;
}

/* Section slide: diagonal stripes + glow */
.slide-card.type-section {
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,0.015) 40px, rgba(255,255,255,0.015) 80px),
        linear-gradient(160deg, var(--theme-dark, #1e1b4b) 0%, var(--theme-primary, #6366f1) 100%);
}

.slide-card.type-section .slide-section-number {
    font-size: 100px;
    opacity: 0.06;
    top: 10px;
    right: 30px;
    left: auto;
    font-weight: 900;
    letter-spacing: -4px;
}

.slide-card.type-section h2 {
    border-bottom: 3px solid rgba(255,255,255,0.25);
    padding-bottom: 14px;
    display: inline-block;
}

/* Content slide: depth shadow layers */
.slide-card.type-content {
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 8px 24px rgba(0,0,0,0.06),
        0 24px 48px rgba(0,0,0,0.04);
}

/* Content variant B: big number layout */
.slide-card.type-content[data-variant="b"] {
    padding-left: 48px;
    padding-right: 48px;
}

.slide-card.type-content[data-variant="b"]::before {
    width: 100%;
    height: 4px;
    border-radius: 0;
    background: linear-gradient(90deg, var(--theme-primary, #6366f1) 0%, var(--theme-accent, #818cf8) 50%, transparent 100%);
    top: 0;
    left: 0;
}

.slide-card.type-content[data-variant="b"] .slide-big-number {
    position: absolute;
    right: 28px;
    top: 20px;
    font-size: 80px;
    font-weight: 900;
    opacity: 0.06;
    color: var(--theme-primary, #6366f1);
    line-height: 1;
}

/* Content variant C: card-per-bullet */
.slide-card.type-content[data-variant="c"] {
    padding-left: 48px;
}

.slide-card.type-content[data-variant="c"]::before {
    display: none;
}

.slide-card.type-content[data-variant="c"] .slide-bullets li {
    background: var(--bg, #f7f7f8);
    border: 1px solid var(--border, #e5e7eb);
    border-left: 3px solid var(--theme-primary, #6366f1);
    border-radius: 10px;
    padding: 12px 14px 12px 48px;
    margin-bottom: 8px;
}

.slide-card.type-content[data-variant="c"] .slide-bullets li:hover {
    background: var(--surface, #fff);
    border-color: var(--theme-primary, #6366f1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Summary slide: card bullets */
.slide-card.type-summary .slide-bullets li {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 14px 14px 14px 48px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.slide-card.type-summary .slide-bullets li:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateX(2px);
}

/* Watermark slide number */
.slide-card .slide-watermark {
    position: absolute;
    bottom: 12px;
    left: 20px;
    font-size: 100px;
    font-weight: 900;
    opacity: 0.025;
    color: var(--text, #000);
    line-height: 1;
    pointer-events: none;
}

/* Footer line glow effect */
.slide-card .slide-footer-line {
    box-shadow: 0 -1px 8px rgba(99, 102, 241, 0.15);
}

/* All slide types: subtle inner shadow for depth */
.slide-card.type-content,
.slide-card.type-summary {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.8),
        0 1px 3px rgba(0,0,0,0.04),
        0 8px 24px rgba(0,0,0,0.06),
        0 24px 48px rgba(0,0,0,0.04);
}

@media (max-width: 768px) {
    .slide-card.type-content[data-variant="b"] .slide-big-number { font-size: 50px; }
    .slide-card.type-section .slide-section-number { font-size: 60px; }
}
