/* ============================================
   FlipBook Builder - Premium Dark Theme CSS
   ============================================ */

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

/* ── CSS Custom Properties ── */
:root {
    --bg-primary: #0b0b14;
    --bg-secondary: #12121e;
    --bg-card: #16162a;
    --bg-card-hover: #1c1c38;
    --bg-elevated: #1e1e36;
    --bg-input: #12121e;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(108, 92, 231, 0.3);

    --text-primary: #f0f0f5;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);

    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.2);
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);

    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --info: #74b9ff;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.15);

    --transition: 0.2s ease;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Outfit', var(--font-body);
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.app {
    display: flex;
    min-height: 100vh;
}

/* ── Login Screen ── */
.login-view {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at 30% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(253, 121, 168, 0.06) 0%, transparent 50%);
}

.login-card {
    width: 95%;
    max-width: 400px;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    text-align: center;
    animation: modalSlideIn 0.5s ease;
}

.login-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.login-logo .emoji {
    font-size: 2rem;
    -webkit-text-fill-color: initial;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-input {
    text-align: center;
    font-size: 1rem;
    padding: 0.85rem 1.25rem;
    letter-spacing: 0.1em;
}

.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: var(--radius-sm);
}

.login-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ── Sidebar ── */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.3s ease;
}

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

.sidebar-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo .emoji {
    font-size: 1.5rem;
    -webkit-text-fill-color: initial;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.nav-item .icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Main Content ── */
.main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(11, 11, 20, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
}

.main-content {
    padding: 2rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #00b894, #55efc4);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-cover .placeholder {
    font-size: 3rem;
    opacity: 0.2;
}

.card-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-status.draft {
    background: rgba(253, 203, 110, 0.2);
    color: var(--warning);
}

.card-status.published {
    background: rgba(0, 184, 148, 0.2);
    color: var(--success);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 1.25rem;
}

/* ── Projects Grid ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.card-new {
    border: 2px dashed var(--border-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.card-new:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.card-new .plus-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-light);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.card-new:hover .plus-icon {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.card-new span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 95%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: rgba(255, 75, 75, 0.2);
    color: var(--danger);
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-subtle);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-color {
    width: 48px;
    height: 40px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.form-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.form-sound-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-sound-row .form-select {
    flex: 1;
}

.form-sound-row .btn {
    flex-shrink: 0;
}

/* ── Editor Tabs ── */
.editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 2rem;
    background: var(--bg-secondary);
}

.editor-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color var(--transition);
}

.editor-tab:hover {
    color: var(--text-secondary);
}

.editor-tab.active {
    color: var(--accent-light);
}

.editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px 2px 0 0;
}

.editor-panel {
    display: none;
    padding: 2rem;
}

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

/* ── Upload Area ── */
.upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-area .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.upload-area .upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-area .upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-progress {
    margin-top: 1rem;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ── Page Thumbnails Grid ── */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.page-thumb {
    position: relative;
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: grab;
    transition: all 0.2s ease;
    aspect-ratio: 3 / 4;
}

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

.page-thumb.selected {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-thumb .page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.35rem 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-thumb .page-type-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.page-type-badge.hard {
    background: rgba(253, 203, 110, 0.3);
    color: var(--warning);
}

.page-type-badge.soft {
    background: rgba(116, 185, 255, 0.3);
    color: var(--info);
}

.page-thumb .page-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.page-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all var(--transition);
}

.page-action-btn:hover {
    background: rgba(255, 75, 75, 0.6);
}

.page-action-btn.type-toggle:hover {
    background: rgba(108, 92, 231, 0.6);
}

/* Dragging state */
.page-thumb.sortable-ghost {
    opacity: 0.3;
}

.page-thumb.sortable-chosen {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

/* ── Hotspot Editor ── */
.hotspot-editor {
    display: flex;
    gap: 2rem;
}

.hotspot-canvas-wrapper {
    flex: 1;
    position: relative;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.hotspot-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.hotspot-canvas {
    position: relative;
    cursor: crosshair;
}

.hotspot-canvas img {
    width: 100%;
    display: block;
}

.hotspot-rect {
    position: absolute;
    border: 2px solid var(--accent);
    background: rgba(108, 92, 231, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hotspot-rect:hover {
    background: rgba(108, 92, 231, 0.3);
}

.hotspot-rect.selected {
    border-color: #fd79a8;
    background: rgba(253, 121, 168, 0.15);
}

.hotspot-rect .hotspot-label {
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 0.65rem;
    background: var(--accent);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.hotspot-sidebar {
    width: 320px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.hotspot-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.hotspot-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-medium);
}

.hotspot-list-item.active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ── Preview Panel ── */
.preview-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16 / 11;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.preview-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    animation: toastIn 0.3s ease;
    min-width: 280px;
    max-width: 420px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast.success { border-color: rgba(0, 184, 148, 0.3); }
.toast.error { border-color: rgba(255, 107, 107, 0.3); }
.toast.info { border-color: rgba(116, 185, 255, 0.3); }

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

.toast-fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100px); opacity: 0; }
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ── Section Header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-count {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
    }
    
    .hotspot-editor {
        flex-direction: column;
    }
    
    .hotspot-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .main-header {
        padding: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .editor-tabs {
        padding: 0 1rem;
        overflow-x: auto;
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Spinner ── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-light);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ── Back button ── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: color var(--transition);
}

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

/* ── Confirm Dialog ── */
.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}

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