/* ==============================
   SlideForge — CSS
   ============================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a28;
    --bg-card: #16161f;
    --bg-hover: #1e1e2d;
    --bg-input: #1a1a28;

    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99, 102, 241, 0.15);

    --danger: #ef4444;
    --danger-hover: #f87171;
    --success: #22c55e;
    --warning: #f59e0b;

    --border: #2a2a3a;
    --border-hover: #3a3a4a;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);

    --transition: 0.2s ease;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ==============================
   Views
   ============================== */

.view {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
}

.view.active {
    display: flex;
}

/* ==============================
   Buttons
   ============================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-icon {
    padding: 8px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.chevron {
    width: 14px !important;
    height: 14px !important;
    opacity: 0.5;
}

/* ==============================
   Dashboard Header
   ============================== */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
}

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

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

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: var(--radius-sm);
    color: white;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.version-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--accent-subtle);
    color: var(--accent);
    border-radius: 20px;
    font-weight: 600;
}

.header-center {
    flex: 1;
    max-width: 420px;
    margin: 0 24px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-ui);
    outline: none;
}

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

.search-box kbd {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-ui);
}

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

/* ==============================
   Dashboard Toolbar
   ============================== */

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

.sort-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 4px;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all var(--transition);
}

.sort-btn svg {
    width: 13px;
    height: 13px;
}

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

.sort-btn.active {
    color: var(--accent);
    background: var(--accent-subtle);
    border-color: rgba(99, 102, 241, 0.3);
}

.view-controls {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.view-btn svg {
    width: 15px;
    height: 15px;
}

.view-btn:hover {
    color: var(--text-primary);
}

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

/* ==============================
   Dashboard Content
   ============================== */

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

.presentations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.presentations-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}

.pres-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.pres-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.pres-card-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.pres-card-thumbnail .thumb-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: rgba(255,255,255,0.9);
}

.pres-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition);
}

.pres-card:hover .pres-card-overlay {
    opacity: 1;
}

.pres-card-info {
    padding: 14px 16px;
}

.pres-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pres-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.pres-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pres-card-meta svg {
    width: 12px;
    height: 12px;
}

.pres-card-tags {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.tag {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--accent-subtle);
    color: var(--accent);
    border-radius: 20px;
    font-weight: 500;
}

/* List view card */
.list-view .pres-card {
    display: flex;
    border-radius: var(--radius);
}

.list-view .pres-card-thumbnail {
    width: 180px;
    aspect-ratio: auto;
    flex-shrink: 0;
}

.list-view .pres-card-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Context menu for cards */
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.card-actions .btn {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px;
    border-radius: 6px;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    border-radius: 50%;
    margin-bottom: 20px;
}

.empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--accent);
}

.empty-state h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

/* ==============================
   Editor Header
   ============================== */

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    gap: 16px;
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.title-input {
    background: none;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-ui);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    width: 100%;
    max-width: 300px;
    transition: border-color var(--transition);
}

.title-input:hover,
.title-input:focus {
    border-color: var(--border);
}

.title-input:focus {
    border-color: var(--accent);
}

.editor-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-ui);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

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

.tab-btn:hover {
    color: var(--text-primary);
}

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

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all var(--transition);
}

.dropdown-item svg {
    width: 15px;
    height: 15px;
}

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

/* ==============================
   Editor Body
   ============================== */

.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Slides Sidebar */
.slides-sidebar {
    width: 220px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

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

.slides-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slide-thumb {
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
    flex-shrink: 0;
}

.slide-thumb:hover {
    border-color: var(--border-hover);
}

.slide-thumb.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.slide-thumb-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 7px;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    color: rgba(255,255,255,0.8);
}

.slide-thumb-number {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
}

.slide-thumb-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.slide-thumb-actions button {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 3px;
    background: rgba(0,0,0,0.6);
    color: white;
    cursor: pointer;
    font-size: 10px;
    transition: background var(--transition);
}

.slide-thumb-actions button:hover {
    background: var(--danger);
}

.slide-thumb-actions button svg {
    width: 10px;
    height: 10px;
}

/* Main Editor */
.editor-main {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.slide-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    min-height: 0;
}

.slide-canvas {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-canvas .slide-render {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    overflow: hidden;
}

.slide-render h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.slide-render h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.slide-render h3 {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.7;
}

.slide-render p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.slide-render .content-left {
    text-align: left;
    width: 100%;
    align-items: flex-start;
}

.slide-render ul {
    text-align: left;
    font-size: 14px;
    line-height: 2;
    list-style: none;
    padding: 0;
    width: 100%;
}

.slide-render ul li::before {
    content: "→ ";
    color: inherit;
    font-weight: bold;
    opacity: 0.5;
}

.slide-render .two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    text-align: left;
}

.slide-render .two-columns .column ul {
    font-size: 12px;
    line-height: 1.8;
}

.slide-render blockquote {
    font-size: 20px;
    font-style: italic;
    line-height: 1.5;
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    text-align: left;
    opacity: 0.9;
}

.slide-render .quote-author {
    margin-top: 16px;
    font-size: 13px;
    opacity: 0.6;
    font-style: normal;
}

.slide-render pre {
    background: rgba(0,0,0,0.4);
    border-radius: var(--radius);
    padding: 16px;
    width: 100%;
    text-align: left;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

.slide-render .slide-image {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
    border-radius: var(--radius);
}

.slide-render .image-caption {
    margin-top: 12px;
    font-size: 12px;
    opacity: 0.6;
}

/* Slide Editor Panel */
.slide-editor-panel {
    border-top: 1px solid var(--border);
    padding: 20px 30px;
    background: var(--bg-secondary);
    max-height: 40%;
    overflow-y: auto;
}

.editor-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-group input,
.field-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition);
    resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
    border-color: var(--accent);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Properties Sidebar */
.properties-sidebar {
    width: 260px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.properties-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.prop-section {
    margin-bottom: 20px;
}

.prop-section h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.prop-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}

.prop-select:focus {
    border-color: var(--accent);
}

/* Background tabs */
.bg-type-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
    margin-bottom: 10px;
}

.bg-tab {
    flex: 1;
    padding: 5px;
    border: none;
    border-radius: 4px;
    background: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all var(--transition);
}

.bg-tab:hover {
    color: var(--text-primary);
}

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

.bg-panel {
    display: none;
}

.bg-panel.active {
    display: block;
}

.bg-panel input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-input);
    padding: 2px;
}

.preset-colors {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.preset-color {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: white;
}

.gradient-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.gradient-preset {
    height: 36px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.gradient-preset:hover {
    border-color: white;
    transform: scale(1.03);
}

.gradient-preset.active {
    border-color: var(--accent);
}

.bg-image-preview {
    margin-top: 8px;
    min-height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.bg-image-preview img {
    width: 100%;
    display: block;
}

#slide-notes {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    resize: vertical;
    transition: border-color var(--transition);
}

#slide-notes:focus {
    border-color: var(--accent);
}

/* ==============================
   Theme Panel
   ============================== */

.theme-panel {
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.theme-section {
    margin-bottom: 30px;
}

.theme-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.theme-section h3 svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.font-option {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}

.font-option:hover {
    border-color: var(--border-hover);
}

.font-option.active {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.font-option .font-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.font-option .font-sample {
    font-size: 18px;
    line-height: 1.3;
}

.color-schemes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.color-scheme {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}

.color-scheme:hover {
    border-color: var(--border-hover);
}

.color-scheme.active {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.scheme-colors {
    display: flex;
    gap: 3px;
}

.scheme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.scheme-name {
    font-size: 12px;
    font-weight: 500;
}

.bg-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.bg-option {
    height: 70px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.bg-option:hover {
    transform: scale(1.03);
    border-color: var(--border-hover);
}

.bg-option.active {
    border-color: var(--accent);
}

/* ==============================
   Settings Panel
   ============================== */

.settings-panel {
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 15px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.form-group input[type="checkbox"] {
    margin-right: 6px;
}

.danger-zone {
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 16px;
    background: rgba(239, 68, 68, 0.05);
}

.danger-zone h3 {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ==============================
   Presenter View
   ============================== */

#view-presenter {
    position: relative;
    background: #000;
}

.presenter-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

#view-presenter:hover .presenter-toolbar,
.presenter-toolbar:hover {
    opacity: 1;
}

.slide-counter {
    font-size: 13px;
    color: var(--text-secondary);
}

#reveal-container {
    width: 100%;
    height: 100vh;
}

/* Reveal.js overrides in presenter */
#view-presenter .reveal .slides section {
    font-family: var(--font-ui);
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}

#view-presenter .reveal .slides section > div {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ==============================
   Import Loader
   ============================== */

#import-loader {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#import-loader.active {
    opacity: 1;
    pointer-events: all;
}

.import-loader-spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid rgba(152, 87, 243, 0.15);
    border-top-color: #9857F3;
    animation: loader-spin 0.8s linear infinite;
}

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

.import-loader-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f0f0f5;
    letter-spacing: 0.02em;
}

.import-loader-status {
    font-size: 0.9rem;
    color: rgba(240, 240, 245, 0.6);
    text-align: center;
    min-height: 1.4em;
    transition: opacity 0.2s;
}

.import-loader-bar-wrap {
    width: 280px;
    height: 6px;
    border-radius: 3px;
    background: rgba(152, 87, 243, 0.12);
    overflow: hidden;
}

.import-loader-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #9857F3, #c084fc);
    transition: width 0.4s ease;
}

/* ==============================
   Modals
   ============================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 20px;
}

/* Slide type cards in modal */
.slide-types-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.slide-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    font-size: 11px;
    font-family: var(--font-ui);
}

.slide-type-card:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-2px);
}

.type-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    gap: 4px;
}

.tp-big-line {
    width: 60%;
    height: 6px;
    background: var(--text-muted);
    border-radius: 2px;
}

.tp-small-line {
    width: 40%;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0.5;
}

.tp-title-line {
    width: 50%;
    height: 5px;
    background: var(--text-muted);
    border-radius: 2px;
    margin-bottom: 4px;
}

.tp-text-lines {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tp-line {
    width: 100%;
    height: 3px;
    background: var(--text-muted);
    border-radius: 1px;
    opacity: 0.4;
}

.tp-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 80%;
}

.tp-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tp-img-placeholder {
    width: 50%;
    aspect-ratio: 4/3;
    background: var(--text-muted);
    border-radius: 3px;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-img-placeholder svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.tp-quote-mark {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
}

.tp-code-lines {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tp-code-line {
    height: 3px;
    background: #22c55e;
    border-radius: 1px;
    opacity: 0.4;
}

/* Template grid in new pres modal */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
}

.template-card:hover {
    border-color: var(--border-hover);
}

.template-card.active {
    border-color: var(--accent);
}

.template-preview {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
}

/* ==============================
   Toast Notifications
   ============================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: toastIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

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

.toast.success svg {
    color: var(--success);
}

.toast.error svg {
    color: var(--danger);
}

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

/* ==============================
   Scrollbar
   ============================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ==============================
   Blocks Toolbar
   ============================== */

.blocks-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.toolbar-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 4px;
    white-space: nowrap;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.btn-delete-block:not(:disabled):hover {
    color: var(--danger) !important;
}

/* ==============================
   Draggable Blocks on Canvas
   ============================== */

.slide-canvas {
    position: relative;
    user-select: none;
}

/* Slide template elements (draggable) */
.slide-element {
    position: absolute;
    cursor: move;
    transition: outline 0.12s ease;
}

.slide-element:hover {
    outline: 1px dashed rgba(99, 102, 241, 0.4);
    outline-offset: 2px;
}

.slide-element.selected {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.slide-element .resize-handle {
    display: none;
}

.slide-element.selected .resize-handle {
    display: block;
}

/* Custom blocks (draggable) */
.slide-block {
    position: absolute;
    cursor: move;
    min-width: 30px;
    min-height: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    transition: box-shadow 0.15s ease;
    z-index: 10;
    box-sizing: border-box;
}

.slide-block:hover {
    outline: 2px solid rgba(99, 102, 241, 0.4);
    outline-offset: 1px;
}

.slide-block.selected {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.slide-block.dragging {
    opacity: 0.85;
    cursor: grabbing;
    z-index: 100;
}

.block-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6px 10px;
    word-break: break-word;
    text-align: center;
    line-height: 1.3;
}

.block-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border: 2px solid white;
    border-radius: 50%;
    z-index: 20;
    display: none;
}

.slide-block.selected .resize-handle {
    display: block;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.resize-handle.n  { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s  { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.w  { top: 50%; left: -5px; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.e  { top: 50%; right: -5px; transform: translateY(-50%); cursor: e-resize; }

/* Canvas alignment guides */
.canvas-guide {
    position: absolute;
    background: var(--accent);
    opacity: 0.5;
    z-index: 50;
    pointer-events: none;
}

.canvas-guide.horizontal {
    height: 1px;
    left: 0;
    right: 0;
}

.canvas-guide.vertical {
    width: 1px;
    top: 0;
    bottom: 0;
}

/* ==============================
   Block Properties Panel
   ============================== */

.block-props-panel {
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    background: var(--bg-tertiary);
    max-height: 220px;
    overflow-y: auto;
}

.block-props-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.block-props-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
}

.block-props-body .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.block-props-body .field-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.block-props-body .field-group input[type="text"],
.block-props-body .field-group input[type="number"],
.block-props-body .field-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    outline: none;
}

.block-props-body .field-group input[type="color"] {
    width: 100%;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    padding: 2px;
    cursor: pointer;
}

.block-props-body .field-group input[type="checkbox"] {
    margin-top: 6px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* ==============================
   Auth View
   ============================== */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a3e 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-logo .logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: var(--radius);
    color: white;
}

.auth-logo .logo-icon svg {
    width: 24px;
    height: 24px;
}

.auth-logo h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 28px;
}

.auth-form h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: left;
}

.auth-form .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.auth-form .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-form .form-group input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition);
}

.auth-form .form-group input:focus {
    border-color: var(--accent);
}

.auth-form .form-group input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    text-align: left;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
}

.auth-switch {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ==============================
   Responsive
   ============================== */

@media (max-width: 900px) {
    .slides-sidebar {
        width: 160px;
    }
    .properties-sidebar {
        width: 200px;
    }
    .slide-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .dashboard-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .header-center {
        order: 3;
        max-width: 100%;
        margin: 0;
        flex: 0 0 100%;
    }
    .properties-sidebar {
        display: none;
    }
}

/* Block list for imported slides */
.block-list-hint {
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    line-height: 1.4;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.block-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.block-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    background: rgba(255,255,255,0.03);
}
.block-list-item:hover {
    background: rgba(255,255,255,0.08);
}
.block-list-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.block-list-text {
    flex: 1;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.block-list-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.block-list::-webkit-scrollbar { width: 4px; }
.block-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
