:root {
    /* Base Variables */
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Default Dark Theme */
    --bg-main: #1e1e2e;
    --bg-panel: #181825;
    --bg-hover: #313244;
    --border: #313244;
    --text-main: #cdd6f4;
    --text-muted: #a6adc8;
    --primary: #89b4fa;
    --primary-hover: #b4befe;
    --success: #a6e3a1;
}

/* Light Theme */
.theme-light {
    --bg-main: #f8f9fa;
    --bg-panel: #ffffff;
    --bg-hover: #f1f3f5;
    --border: #e9ecef;
    --text-main: #212529;
    --text-muted: #6c757d;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
}

/* Minimal Theme */
.theme-minimal {
    --bg-main: #ffffff;
    --bg-panel: #ffffff;
    --bg-hover: #f9fafb;
    --border: #e5e7eb;
    --text-main: #111827;
    --text-muted: #9ca3af;
    --primary: #111827;
    --primary-hover: #374151;
    --success: #111827;
    font-family: var(--font-mono); /* Force mono for minimal */
}

/* Gradient Theme */
.theme-gradient {
    --bg-main: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
    --bg-panel: rgba(15, 23, 42, 0.6);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.2);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --success: #34d399;
}

/* Retro Theme */
.theme-retro {
    --bg-main: #282828;
    --bg-panel: #1d2021;
    --bg-hover: #3c3836;
    --border: #504945;
    --text-main: #ebdbb2;
    --text-muted: #a89984;
    --primary: #d3869b;
    --primary-hover: #b16286;
    --success: #b8bb26;
    font-family: var(--font-mono);
}

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

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
}

/* Container & Toolbar */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.toolbar {
    height: 60px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    backdrop-filter: blur(10px);
}

.toolbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.toolbar-brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-select {
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    appearance: none;
    cursor: pointer;
}
.form-select:focus { border-color: var(--primary); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-success { background: var(--success); color: #000; }
.btn-success:hover { filter: brightness(1.1); }

.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { color: var(--text-main); background: var(--bg-hover); }

/* Split View */
.split-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane, .preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.editor-pane { border-right: 1px solid var(--border); }

.pane-header {
    height: 40px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.pane-header .hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.pane-header code { background: var(--bg-main); padding: 0.1rem 0.3rem; border-radius: 3px; }

/* Editor */
#markdownEditor {
    flex: 1;
    background: var(--bg-main);
    color: var(--text-main);
    border: none;
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

/* Preview Area */
.preview-container {
    flex: 1;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Slide Base Styling */
.slide-content {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.theme-gradient .slide-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-minimal .slide-content {
    box-shadow: none;
    border-color: transparent;
}

.slide-content h1, .slide-content h2, .slide-content h3 { margin-bottom: 1rem; color: var(--primary); }
.slide-content h1 { font-size: 3rem; text-align: center; }
.slide-content h2 { font-size: 2.25rem; }
.slide-content p { font-size: 1.25rem; margin-bottom: 1rem; line-height: 1.6; }
.slide-content ul, .slide-content ol { font-size: 1.25rem; margin-bottom: 1rem; padding-left: 2rem; line-height: 1.6; }
.slide-content li { margin-bottom: 0.5rem; }
.slide-content img { max-width: 100%; max-height: 60vh; border-radius: 8px; margin: 1rem auto; display: block; }
.slide-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
}
.slide-content pre {
    background: #1e1e1e !important;
    padding: 1.5rem !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    overflow-x: auto;
}

/* Presentation Mode Overlays */
.presentation-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-main);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}
.presentation-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 48px; height: 48px;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    z-index: 1010;
}
.close-btn:hover { background: rgba(0,0,0,0.8); }

.deck {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.deck .slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5rem;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-sizing: border-box;
}

.deck .slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    z-index: 10;
}

.deck .slide h1 { font-size: 5rem; margin-bottom: 2rem; color: var(--primary); text-align: center; font-weight: 700; }
.deck .slide h2 { font-size: 3.5rem; margin-bottom: 1.5rem; color: var(--primary); }
.deck .slide p, .deck .slide li { font-size: 2rem; line-height: 1.5; }
.deck .slide pre { font-size: 1.5rem !important; }

.presentation-controls {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1010;
}

.nav-dots { display: flex; gap: 0.5rem; background: rgba(0,0,0,0.3); padding: 0.5rem 1rem; border-radius: 20px; backdrop-filter: blur(5px);}
.nav-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); cursor: pointer; transition: all 0.2s; border: none; }
.nav-dot.active { background: var(--primary); transform: scale(1.2); }
.nav-dot:hover { background: var(--text-main); }
