/* =============================================
   JX Services Wiki - Premium Design
   Modern GitBook-inspired Theme
   ============================================= */

:root {
    /* Brand Colors */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --secondary-color: #10b981;
    --secondary-light: #34d399;
    
    --accent-color: #f59e0b;
    --accent-light: #fbbf24;
    
    --danger-color: #ef4444;
    --danger-light: #f87171;
    
    /* Background Colors */
    --bg-primary: #0a0b0f;
    --bg-secondary: #0f1015;
    --bg-tertiary: #141520;
    --bg-elevated: #1a1b26;
    --bg-hover: #1e1f2e;
    --bg-card: linear-gradient(145deg, #13141d 0%, #0f1015 100%);
    
    /* Glass Effect */
    --glass-bg: rgba(20, 21, 32, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #6366f1;
    
    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-active: rgba(99, 102, 241, 0.5);
    
    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-bg: linear-gradient(180deg, #0c0d12 0%, #0a0b0f 100%);
    
    /* Admin Bar */
    --admin-bar-height: 52px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 0% 100%, rgba(16, 185, 129, 0.08), transparent);
    pointer-events: none;
    z-index: -1;
}

::selection {
    background: var(--primary-color);
    color: white;
}

/* =============================================
   Admin Bar - Premium Style
   ============================================= */

.admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--admin-bar-height);
    background: linear-gradient(135deg, rgba(15, 16, 21, 0.95) 0%, rgba(10, 11, 15, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.admin-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

.admin-bar-left,
.admin-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Admin Bar Brand */
.admin-bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-bar-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.admin-bar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.admin-bar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

/* Status Indicator */
.admin-bar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.admin-bar-status.saving .status-dot {
    background: var(--accent-color);
}

.admin-bar-status.error .status-dot {
    background: var(--danger-color);
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.admin-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.admin-btn:hover::before {
    opacity: 1;
}

.admin-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-light);
    color: white;
    box-shadow: var(--shadow-glow);
}

.admin-btn.save-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
    border-color: var(--secondary-light);
    color: white;
}

.admin-btn.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.admin-btn i {
    font-size: 14px;
}

/* Discord Login Button */
.discord-login-btn {
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    border-color: #5865F2;
    color: white;
}

.discord-login-btn:hover {
    background: linear-gradient(135deg, #6975F5 0%, #5865F2 100%);
    border-color: #6975F5;
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.4);
}

.discord-login-btn i {
    font-size: 16px;
}

/* Admin Button Disabled */
.admin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.admin-btn:disabled:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    box-shadow: none;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.admin-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    color: white;
    font-size: 10px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* =============================================
   Layout
   ============================================= */

.layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--admin-bar-height);
}

/* =============================================
   Sidebar - Premium Glass Design
   ============================================= */

.sidebar {
    position: fixed;
    top: var(--admin-bar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--admin-bar-height));
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-glow) 0%, transparent 50%, var(--primary-glow) 100%);
    opacity: 0.5;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: var(--shadow-md);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-btn:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.search-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.search-btn span {
    flex: 1;
    text-align: left;
}

.search-btn kbd {
    padding: 4px 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 10px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 4px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    position: relative;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.00);
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-fast);
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(99, 102, 241, 0.08) 100%);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-item:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0.06) 70%, transparent 100%);
    border-color: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08);
}

.nav-item.active::before {
    height: 60%;
}

.nav-item i {
    width: 18px;
    font-size: 13px;
    opacity: 0.8;
    text-align: center;
    color: rgba(148, 163, 184, 0.95);
}

.nav-item:hover i {
    color: rgba(248, 250, 252, 0.92);
}

.nav-item.active i {
    color: rgba(199, 210, 254, 0.95);
}

.nav-item .expand-icon {
    margin-left: auto;
    font-size: 10px;
    transition: transform var(--transition-fast);
    opacity: 0.5;
}

.nav-item:hover .expand-icon {
    opacity: 0.8;
}

.nav-item.expanded .expand-icon {
    transform: rotate(90deg);
}

.nav-children {
    display: block;
    margin-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 2px;
    margin-bottom: 6px;
    padding-left: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-2px);
    transition: max-height var(--transition-slow), opacity var(--transition-normal), transform var(--transition-normal);
    pointer-events: none;
}

.nav-children.expanded {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-children .nav-item {
    font-size: 13px;
    padding: 8px 12px;
    margin-left: 0;
    border-radius: var(--radius-md);
}

.nav-children .nav-item::before {
    width: 2px;
    border-radius: 2px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.footer-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(99, 102, 241, 0.10) 100%);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
    transform: translateY(-2px);
}

.footer-link:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.footer-link i {
    font-size: 15px;
}

.footer-link span {
    display: inline;
}

/* Edit Links Button */
.edit-links-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    background: transparent;
    border: 1px dashed var(--border-color);
    cursor: pointer;
}

.edit-links-btn:hover {
    background: var(--primary-color);
    border-style: solid;
    border-color: var(--primary-color);
    color: white;
}

/* Links Edit Modal */
.links-modal {
    width: 480px;
    max-width: 90vw;
}

.links-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.link-edit-group {
    margin-bottom: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.link-edit-group:hover {
    border-color: var(--border-hover);
}

.link-edit-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.link-icon-select {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.link-icon-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remove-link-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.remove-link-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.link-edit-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.link-edit-group input:last-child {
    margin-bottom: 0;
}

.link-edit-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-link-btn {
    width: 100%;
    padding: 14px;
    border-style: dashed;
}

.add-link-btn:hover {
    border-style: solid;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border-color: var(--primary-color);
}

/* Footer Links Container */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 200;
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar.open ~ .sidebar-overlay,
body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
}

/* =============================================
   Main Content
   ============================================= */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--admin-bar-height));
}

.content-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 48px 80px;
}

/* Page Cover - Premium Gradient */
.page-cover {
    position: relative;
    width: 906px;
    height: 318px;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        #8b5cf6 50%, 
        #a855f7 100%
    );
    background-size: cover;
    background-position: center;
    margin: 0 -48px 32px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Cover image layers */
.cover-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: var(--cover-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

.page-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.2) 0%, transparent 50%),
        linear-gradient(180deg, transparent 40%, var(--bg-primary) 100%);
}

.page-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

.page-cover.has-image {
    background: #0a0b0f;
}

.page-cover.has-image::before {
    display: none;
}

.page-cover.has-image::after {
    display: none;
}

.cover-overlay {
    display: none;
}

/* Cover Actions */
.cover-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 10;
}

.page-cover:hover .cover-actions {
    opacity: 1;
}

.cover-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cover-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.cover-action-btn.danger {
    padding: 10px 12px;
}

.cover-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.7);
    border-color: rgba(239, 68, 68, 0.5);
}

.cover-action-btn i {
    font-size: 14px;
}

.cover-action-btn span {
    display: inline;
}

@media (max-width: 768px) {
    .cover-action-btn span {
        display: none;
    }
    
    .cover-action-btn {
        padding: 10px 12px;
    }
}

.change-cover-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.page-cover:hover .change-cover-btn {
    opacity: 1;
}

.change-cover-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Page Content */
.page-content {
    position: relative;
}

.page-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 40px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-title:focus {
    outline: none;
}

/* Content Blocks */
.content-blocks {
    min-height: 200px;
}

.content-block {
    position: relative;
    margin-bottom: 20px;
    padding: 4px 0;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.edit-mode .content-block {
    padding: 12px 16px;
    margin-left: -16px;
    margin-right: -16px;
}

.edit-mode .content-block:hover {
    background: var(--bg-tertiary);
}

.content-block.selected {
    background: rgba(99, 102, 241, 0.1);
    outline: 2px solid var(--primary-color);
}

/* Block Controls */
.block-controls {
    position: absolute;
    left: -48px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    gap: 4px;
}

.edit-mode .block-controls {
    display: flex;
}

.block-control-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.content-block:hover .block-control-btn {
    opacity: 1;
}

.block-control-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.block-control-btn.drag-handle {
    cursor: grab;
}

.block-control-btn.delete-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Editable Content */
.editable {
    outline: none;
    min-height: 1em;
}

.editable:focus {
    outline: none;
}

.editable:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

/* Typography - Premium */
h2.editable {
    font-size: 32px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    position: relative;
}

h3.editable {
    font-size: 24px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h4.editable {
    font-size: 18px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

p.editable {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Lists - Enhanced */
ul.editable, ol.editable {
    padding-left: 28px;
    margin-bottom: 20px;
}

ul.editable li, ol.editable li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.7;
}

ul.editable li::marker {
    color: var(--primary-color);
}

ol.editable li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

/* Code Blocks - VS Code Dark+ Style */
.code-block {
    position: relative;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin: 24px 0;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 38px;
    background: #2d2d2d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Fake window controls (macOS style) */
.code-header::before {
    content: '';
    display: flex;
    gap: 8px;
    width: 52px;
    height: 12px;
    background:
        radial-gradient(circle at 6px 6px, #ff5f57 5px, transparent 5px),
        radial-gradient(circle at 24px 6px, #febc2e 5px, transparent 5px),
        radial-gradient(circle at 42px 6px, #28c840 5px, transparent 5px);
}

/* Show header always for nice editor look */
body:not(.edit-mode) .code-header {
    display: flex;
}

/* Hide the language input in view mode, just show as text */
body:not(.edit-mode) .code-header .code-language {
    pointer-events: none;
    color: #8b949e;
}

.code-language {
    font-size: 13px;
    color: #cccccc;
    font-weight: 400;
    background: transparent;
    border: none;
    font-family: inherit;
    padding: 4px 8px;
}

.code-language:focus {
    outline: 1px solid #007acc;
    background: #3c3c3c;
}

.copy-code-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #858585;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 400;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-code-btn:hover {
    background: #3c3c3c;
    color: #cccccc;
}

/* Code content wrapper for line numbers */
.code-block .code-content {
    display: flex;
    overflow-x: auto;
}

/* Line numbers gutter */
.code-block .line-numbers {
    flex-shrink: 0;
    padding: 12px 0;
    background: #1e1e1e;
    border-right: 1px solid #3c3c3c;
    text-align: right;
    user-select: none;
    color: #858585;
    font-size: 13px;
    line-height: 1.5;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

.code-block .line-numbers span {
    display: block;
    padding: 0 12px;
    min-width: 40px;
}

pre.editable,
.code-block pre {
    margin: 0;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #d4d4d4;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
    background: #1e1e1e;
    flex: 1;
}

/* Override highlight.js background */
.code-block pre.hljs,
.code-block pre code.hljs {
    background: #1e1e1e;
    padding: 0;
}

.code-block pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    border: none;
}

/* Scrollbar styling for code blocks */
.code-block pre::-webkit-scrollbar,
.code-block .code-content::-webkit-scrollbar {
    height: 8px;
    background: #1e1e1e;
}

.code-block pre::-webkit-scrollbar-thumb,
.code-block .code-content::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
}

.code-block pre::-webkit-scrollbar-thumb:hover,
.code-block .code-content::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}
body:not(.edit-mode) .code-block pre.editable {
    padding-top: 20px;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--primary-light);
}

/* Quotes - Elegant */
blockquote.editable {
    padding: 20px 24px;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 17px;
    margin: 24px 0;
}

/* Callouts - Premium Cards */
.callout {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.callout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.callout-icon {
    font-size: 22px;
    width: 24px;
    text-align: center;
}

.callout.info { border-left: 4px solid var(--primary-color); }
.callout.info .callout-icon { color: var(--primary-color); }

.callout.success { border-left: 4px solid var(--secondary-color); }
.callout.success .callout-icon { color: var(--secondary-color); }

.callout.warning { border-left: 4px solid var(--accent-color); }
.callout.warning .callout-icon { color: var(--accent-color); }

.callout.danger { border-left: 4px solid var(--danger-color); }
.callout.danger .callout-icon { color: var(--danger-color); }

.callout-content {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    margin: 40px 0;
    border: none;
}

/* Images */
.image-block {
    position: relative;
    margin: 32px 0;
}

.image-block img {
    max-width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal);
}

.image-block img:hover {
    transform: scale(1.01);
}

.image-caption {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.image-placeholder:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.image-placeholder i {
    font-size: 40px;
    opacity: 0.5;
}

/* Files (Downloadable Attachments) */
.file-block {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 28px 0;
}

.file-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
    flex: 0 0 auto;
}

.file-body {
    flex: 1;
    min-width: 0;
}

.file-link {
    display: inline-block;
    font-weight: 650;
    color: var(--text-primary);
    text-decoration: none;
    word-break: break-word;
}

.file-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.file-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.file-description {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.file-actions {
    flex: 0 0 auto;
}

.file-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.file-placeholder {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-placeholder:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* Tables - Modern */
.table-wrapper {
    overflow-x: auto;
    margin: 28px 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-hover);
}

/* Add Block Button */
.add-block-container {
    padding: 20px 0;
}

.add-block-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 20px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-block-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* Page Navigation - Premium Cards */
.page-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex: 1;
    max-width: 45%;
    box-shadow: var(--shadow-sm);
}

.nav-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 20px var(--primary-glow);
}

.nav-link.prev {
    align-items: flex-start;
}

.nav-link.next {
    align-items: flex-end;
}

.nav-link-label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nav-link-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-light);
}

/* Page Footer */
.page-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.last-updated {
    font-size: 13px;
    color: var(--text-muted);
}

/* =============================================
   Modals - Glass Effect
   ============================================= */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.close-modal {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.close-modal:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Search Modal */
.search-modal {
    width: 640px;
    max-width: 90vw;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper i {
    color: var(--primary-color);
    font-size: 18px;
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-primary);
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-input-wrapper kbd {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.search-results {
    padding: 16px 20px;
    max-height: 420px;
    overflow-y: auto;
}

.search-hint {
    color: var(--text-muted);
    text-align: center;
    padding: 32px;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.search-result:hover {
    background: var(--bg-hover);
}

.search-result i {
    color: var(--primary-color);
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.search-result-title {
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-title mark {
    background: var(--primary-glow);
    color: var(--primary-light);
    padding: 2px 4px;
    border-radius: 4px;
}

.search-result-path {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Page Manager Modal */
.page-manager {
    width: 520px;
    max-width: 90vw;
}

.page-tree {
    min-height: 200px;
}

.page-tree-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.page-tree-item:hover {
    background: var(--bg-hover);
}

.page-tree-item i {
    color: var(--text-muted);
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.page-tree-item span {
    flex: 1;
    font-weight: 450;
}

.page-tree-item .page-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.page-tree-item:hover .page-actions {
    opacity: 1;
}

.page-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.page-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-action-btn.delete:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.page-tree-children {
    padding-left: 24px;
}

/* New Page Modal */
.new-page-modal {
    width: 480px;
    max-width: 90vw;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Block Selector */
.block-selector {
    position: fixed;
    background: rgba(15, 16, 21, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 300px;
    max-height: 420px;
    overflow: hidden;
    z-index: 1500;
    display: none;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.block-selector.active {
    display: block;
}

.block-selector-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 16, 21, 0.94);
}

.block-selector-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.block-selector-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.block-selector-search i {
    color: var(--text-muted);
    font-size: 14px;
}

.block-selector-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
}

.block-selector-search input::placeholder {
    color: var(--text-muted);
}

.block-options {
    padding: 8px;
    max-height: calc(420px - 86px);
    overflow-y: auto;
}

.block-options::-webkit-scrollbar {
    width: 6px;
}

.block-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 999px;
}

.block-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    font-weight: 450;
}

.block-option:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.block-selector-empty {
    padding: 14px 12px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    margin: 8px;
}

.block-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.block-option i {
    width: 22px;
    text-align: center;
    color: var(--primary-color);
    font-size: 15px;
}

/* Editor Toolbar */
.editor-toolbar {
    position: fixed;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(26, 27, 38, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    animation: fadeIn 0.2s ease;
}

.editor-toolbar.active {
    display: flex;
}

.toolbar-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: rgba(255, 255, 255, 0.18);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-select {
    height: 34px;
    padding: 0 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.toolbar-select:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.toolbar-select:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 6px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 280px;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--secondary-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.info { border-left: 4px solid var(--primary-color); }
.toast.warning { border-left: 4px solid var(--accent-color); }

.toast i {
    font-size: 18px;
}

.toast.success i { color: var(--secondary-color); }
.toast.error i { color: var(--danger-color); }
.toast.info i { color: var(--primary-color); }
.toast.warning i { color: var(--accent-color); }

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Desktop-only login note */
.auth-disabled-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    user-select: none;
}

/* =============================================
   Responsive Design
   ============================================= */

/* Tablet - 1024px und kleiner */
@media (max-width: 1024px) {
    .logo img {
        width: 56px;
        height: 56px;
    }

    /* Tablet: use off-canvas sidebar like mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-btn kbd {
        display: none;
    }

    .content-wrapper {
        padding: 0 32px 60px;
    }
    
    .page-cover {
        margin: 0 -32px 28px;
    }
}

/* Tablet/Phone - 768px und kleiner */
@media (max-width: 768px) {
    body.edit-mode .content-wrapper {
        padding-top: 0;
    }

    .editor-toolbar.pinned {
        top: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Admin Bar Mobile */
    .admin-bar {
        padding: 0 12px;
        height: 48px;
    }
    
    .admin-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .admin-btn span {
        display: none;
    }
    
    .admin-btn i {
        font-size: 16px;
    }
    
    .admin-bar-center {
        display: none;
    }
    
    .admin-bar-divider {
        display: none;
    }
    
    /* User Info Mobile */
    .user-info {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .user-name {
        display: none;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* Sidebar Mobile */
    .sidebar {
        width: 85vw;
        max-width: 320px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .logo {
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .logo img {
        width: 48px;
        height: 48px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .search-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .nav-item {
        padding: 14px 16px;
        font-size: 15px;
        margin: 4px 8px;
    }
    
    .nav-item i {
        font-size: 16px;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
    
    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .sidebar.open ~ .sidebar-overlay,
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    
    /* Main Content Mobile */
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 0 20px 100px;
    }
    
    .page-cover {
        margin: 0 -20px 24px;
        height: 160px;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    /* Typography Mobile */
    .page-title {
        font-size: 32px;
        margin-bottom: 28px;
        word-break: break-word;
    }
    
    h2.editable {
        font-size: 24px;
        margin-top: 36px;
        margin-bottom: 16px;
    }
    
    h3.editable {
        font-size: 20px;
        margin-top: 28px;
        margin-bottom: 12px;
    }
    
    h4.editable {
        font-size: 17px;
        margin-top: 24px;
        margin-bottom: 10px;
    }
    
    p.editable {
        font-size: 15px;
        line-height: 1.75;
    }
    
    ul.editable li, ol.editable li {
        font-size: 15px;
        line-height: 1.7;
    }
    
    /* Code Blocks Mobile */
    .code-block {
        margin: 20px -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .code-block pre {
        font-size: 13px;
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .code-header {
        padding: 0 12px;
        height: 36px;
    }
    
    .copy-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    /* Block Controls Mobile */
    .block-controls {
        left: auto;
        right: 8px;
        top: 8px;
        transform: none;
        flex-direction: row;
    }
    
    .block-control-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* Navigation Links Mobile */
    .page-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-link {
        max-width: 100%;
        padding: 16px;
    }
    
    /* Tables Mobile */
    .table-container {
        margin: 20px -20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 500px;
    }
    
    table th, table td {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    /* Modals Mobile */
    .modal-content {
        width: 95vw !important;
        max-width: none !important;
        margin: 10px;
        max-height: 90vh;
        border-radius: var(--radius-lg);
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(90vh - 140px);
    }
    
    .modal-footer {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Search Modal Mobile */
    .search-modal {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .search-input-wrapper {
        padding: 16px 20px;
    }
    
    .search-input-wrapper input {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .search-input-wrapper kbd {
        display: none;
    }
    
    .search-results {
        padding: 12px 16px;
        max-height: calc(100vh - 80px);
    }
    
    .search-result {
        padding: 14px;
    }
    
    /* Form Elements Mobile */
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px 16px;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* Toast Notifications Mobile */
    .toast-container {
        bottom: 90px;
        right: 16px;
        left: 16px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
        padding: 14px 16px;
    }
    
    /* Footer Links Mobile */
    .sidebar-footer {
        padding: 14px 16px;
        flex-wrap: wrap;
    }
    
    .footer-link {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .footer-link span {
        display: inline;
    }
    
    /* Block Selector Mobile */
    .block-selector {
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px !important;
        max-height: 60vh;
    }
    
    /* Editor Toolbar Mobile */
    .editor-toolbar {
        left: 16px !important;
        right: 16px !important;
        width: auto;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .toolbar-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Cover Actions Mobile */
    .cover-actions {
        bottom: 12px;
        right: 12px;
        left: 12px;
        justify-content: flex-end;
    }
    
    .cover-action-btn span {
        display: none;
    }
    
    .cover-action-btn {
        padding: 12px;
    }
    
    .cover-action-btn i {
        font-size: 16px;
    }
}

/* Phone - 480px und kleiner */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }
    
    /* Admin Bar Small Phone */
    .admin-bar {
        padding: 0 10px;
        gap: 6px;
    }
    
    .admin-btn {
        padding: 8px;
    }
    
    /* Logo Small Phone */
    .logo img {
        width: 44px;
        height: 44px;
    }
    
    .logo-text {
        font-size: 15px;
    }
    
    /* Sidebar Small Phone */
    .sidebar {
        width: 90vw;
    }
    
    /* Content Small Phone */
    .content-wrapper {
        padding: 0 16px 100px;
    }
    
    .page-cover {
        margin: 0 -16px 20px;
        height: 140px;
    }
    
    /* Typography Small Phone */
    .page-title {
        font-size: 26px;
        margin-bottom: 24px;
    }
    
    h2.editable {
        font-size: 22px;
    }
    
    h3.editable {
        font-size: 18px;
    }
    
    h4.editable {
        font-size: 16px;
    }
    
    p.editable {
        font-size: 14px;
    }
    
    ul.editable li, ol.editable li {
        font-size: 14px;
    }
    
    /* Code Blocks Small Phone */
    .code-block {
        margin: 16px -16px;
    }
    
    .code-block pre {
        font-size: 12px;
        padding: 14px;
    }
    
    /* Nav Items Small Phone */
    .nav-item {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    /* Mobile Menu Toggle Small Phone */
    .mobile-menu-toggle {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
        font-size: 20px;
    }
    
    /* Modals Small Phone */
    .modal-content {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    /* Tables Small Phone */
    .table-container {
        margin: 16px -16px;
    }
    
    /* Toast Small Phone */
    .toast-container {
        bottom: 80px;
        right: 12px;
        left: 12px;
    }
    
    .toast {
        padding: 12px 14px;
        gap: 12px;
    }
    
    .toast-message {
        font-size: 13px;
    }
}

/* Extra Small Phone - 360px und kleiner */
@media (max-width: 360px) {
    .page-title {
        font-size: 24px;
    }
    
    h2.editable {
        font-size: 20px;
    }
    
    .content-wrapper {
        padding: 0 12px 90px;
    }
    
    .page-cover {
        margin: 0 -12px 16px;
        height: 120px;
    }
    
    .admin-btn {
        padding: 6px;
    }
    
    .admin-btn i {
        font-size: 14px;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-item {
        min-height: 48px;
    }
    
    .admin-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn {
        min-height: 48px;
    }
    
    .footer-link {
        min-height: 44px;
    }
    
    .block-control-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .toolbar-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .page-action-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Disable hover effects on touch */
    .nav-item:hover {
        transform: none;
    }
    
    .admin-btn:hover {
        transform: none;
    }
    
    .footer-link:hover {
        transform: none;
    }
    
    /* Always show action buttons on touch devices */
    .page-tree-item .page-actions {
        opacity: 1;
    }
    
    .content-block:hover .block-control-btn {
        opacity: 1;
    }
    
    /* Smoother scrolling */
    .sidebar-nav,
    .modal-body,
    .search-results,
    .code-block pre {
        -webkit-overflow-scrolling: touch;
    }
}

/* Landscape Phone Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .admin-bar {
        height: 44px;
    }
    
    .layout {
        padding-top: 44px;
    }
    
    .sidebar {
        top: 44px;
        height: calc(100vh - 44px);
    }
    
    .page-cover {
        height: 120px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: calc(95vh - 120px);
    }
}

/* =============================================
   Scrollbar Styling
   ============================================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* =============================================
   Utility Classes
   ============================================= */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Drag & Drop */
.dragging {
    opacity: 0.5;
}

.drag-over {
    border-top: 2px solid var(--primary-color);
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection */
*::selection {
    background: var(--primary-color);
    color: white;
}

/* =============================================
   UI v2 (2026) - Clean Editor Redesign
   Opt-in via: <body class="ui-v2">
   ============================================= */

body.ui-v2 {
    --primary-color: #58a6ff;
    --primary-light: #79c0ff;
    --primary-dark: #1f6feb;
    --primary-glow: rgba(88, 166, 255, 0.22);

    --secondary-color: #3fb950;
    --secondary-light: #56d364;

    --accent-color: #d29922;
    --accent-light: #e3b341;

    --danger-color: #f85149;
    --danger-light: #ff7b72;

    --bg-primary: #0d1117;
    --bg-secondary: #0b0f14;
    --bg-tertiary: #161b22;
    --bg-elevated: #161b22;
    --bg-hover: #21262d;
    --bg-card: #0d1117;

    --glass-bg: rgba(13, 17, 23, 0.86);
    --glass-border: rgba(240, 246, 252, 0.10);

    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-accent: #58a6ff;

    --border-color: rgba(240, 246, 252, 0.10);
    --border-hover: rgba(240, 246, 252, 0.18);
    --border-active: rgba(88, 166, 255, 0.45);

    --sidebar-bg: #0d1117;
    --shadow-sm: 0 1px 0 rgba(1, 4, 9, 0.6);
    --shadow-md: 0 8px 24px rgba(1, 4, 9, 0.45);
    --shadow-lg: 0 16px 48px rgba(1, 4, 9, 0.55);
    --shadow-glow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

body.ui-v2::before {
    background:
        radial-gradient(ellipse 70% 40% at 30% -10%, rgba(88, 166, 255, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 35% at 100% 0%, rgba(63, 185, 80, 0.08), transparent 55%),
        radial-gradient(ellipse 60% 35% at 0% 100%, rgba(210, 153, 34, 0.06), transparent 55%);
}

/* Admin bar */
body.ui-v2 .admin-bar {
    background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
    border-bottom: 1px solid rgba(240, 246, 252, 0.08);
    box-shadow: 0 1px 3px rgba(1, 4, 9, 0.12), 0 8px 24px rgba(1, 4, 9, 0.12);
    height: 56px;
    padding: 0 24px;
}

body.ui-v2 .admin-bar::after {
    display: none;
}

body.ui-v2 .admin-bar-left,
body.ui-v2 .admin-bar-right {
    gap: 12px;
}

body.ui-v2 .admin-bar-status {
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.25);
    color: #3fb950;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

body.ui-v2 .admin-bar-status .status-dot {
    background: #3fb950;
    width: 7px;
    height: 7px;
}

body.ui-v2 .admin-btn {
    background: transparent;
    border: 1px solid rgba(240, 246, 252, 0.12);
    color: #8b949e;
    box-shadow: none;
    transform: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    gap: 8px;
    transition: all 0.15s ease;
}

body.ui-v2 .admin-btn::before {
    display: none;
}

body.ui-v2 .admin-btn:hover {
    background: rgba(240, 246, 252, 0.04);
    border-color: rgba(240, 246, 252, 0.18);
    color: #c9d1d9;
}

body.ui-v2 .admin-btn.active {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.40);
    color: #58a6ff;
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.15);
}

body.ui-v2 .admin-btn.save-btn {
    background: linear-gradient(180deg, #238636 0%, #2ea043 100%);
    border: 1px solid rgba(240, 246, 252, 0.10);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(27, 31, 36, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.ui-v2 .admin-btn.save-btn:hover {
    background: linear-gradient(180deg, #2ea043 0%, #3fb950 100%);
    box-shadow: 0 0 0 3px rgba(46, 160, 67, 0.20);
}

body.ui-v2 .admin-btn.save-btn.unsaved {
    animation: pulse-save 2s ease-in-out infinite;
}

@keyframes pulse-save {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 160, 67, 0); }
    50% { box-shadow: 0 0 0 4px rgba(46, 160, 67, 0.25); }
}

/* Discord button */
body.ui-v2 .discord-login-btn {
    background: linear-gradient(180deg, #5865F2 0%, #4752C4 100%);
    border: 1px solid rgba(240, 246, 252, 0.10);
    color: #ffffff;
    font-weight: 600;
}

body.ui-v2 .discord-login-btn:hover {
    background: linear-gradient(180deg, #6974f5 0%, #5865F2 100%);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25);
}

/* User info */
body.ui-v2 .user-info {
    background: rgba(240, 246, 252, 0.04);
    border: 1px solid rgba(240, 246, 252, 0.10);
    border-radius: 24px;
    padding: 4px 14px 4px 4px;
    gap: 10px;
}

body.ui-v2 .user-avatar {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(88, 166, 255, 0.50);
}

body.ui-v2 .user-name {
    color: #c9d1d9;
    font-weight: 500;
}

/* Sidebar */
body.ui-v2 .sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.ui-v2 .sidebar::before {
    display: none;
}

body.ui-v2 .sidebar-header {
    padding: 18px;
}

body.ui-v2 .logo img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

body.ui-v2 .logo-text {
    -webkit-text-fill-color: unset;
    color: var(--text-primary);
    background: none;
}

body.ui-v2 .search-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
}

body.ui-v2 .search-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

body.ui-v2 .search-btn kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Content */
body.ui-v2 .content-wrapper {
    max-width: 980px;
    padding: 18px 36px 80px;
}

body.ui-v2 .page-cover {
    width: 906px;
    height: 318px;
    margin: 18px 0 22px;
    border-radius: 14px;
    background: #0d1117;
    border: 1px solid var(--border-color);
}

body.ui-v2 .page-cover::before {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(240, 246, 252, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, transparent 55%, var(--bg-primary) 100%);
}

body.ui-v2 .page-cover::after {
    display: none;
}

body.ui-v2 .page-cover.has-image {
    background: #0d1117;
}

body.ui-v2 .page-cover.has-image::before,
body.ui-v2 .page-cover.has-image::after {
    display: none;
}

@media (max-width: 768px) {
    body.ui-v2 .page-cover {
        width: 100vw;
        height: 180px;
    }
}

body.ui-v2 .page-title {
    font-size: 40px;
    letter-spacing: -0.015em;
    margin-bottom: 28px;
}

body.ui-v2 .page-content {
    background: rgba(13, 17, 23, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px 28px 22px;
}

body.ui-v2 .page-footer {
    color: var(--text-muted);
}

/* Sidebar navigation look */
body.ui-v2 .sidebar-nav {
    padding: 12px 0;
}

body.ui-v2 .nav-section-title {
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

body.ui-v2 .nav-item {
    margin: 2px 10px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
}

body.ui-v2 .nav-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.ui-v2 .nav-item.active {
    background: rgba(88, 166, 255, 0.12);
    border-color: rgba(88, 166, 255, 0.35);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    body.ui-v2 .content-wrapper {
        padding: 16px 16px 70px;
    }

    body.ui-v2 .page-content {
        padding: 18px 16px 16px;
        border-radius: 12px;
    }

    body.ui-v2 .page-title {
        font-size: 32px;
    }
}

body.ui-v2 .content-block {
    margin-bottom: 14px;
}

body.ui-v2.edit-mode .content-block {
    padding: 12px 14px;
    margin-left: -14px;
    margin-right: -14px;
    border: 1px solid transparent;
}

body.ui-v2.edit-mode .content-block:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.ui-v2 .content-block.selected {
    background: rgba(88, 166, 255, 0.12);
    outline: 2px solid rgba(88, 166, 255, 0.45);
}

body.ui-v2 .block-control-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

body.ui-v2 .block-control-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Add block */
body.ui-v2 .add-block-btn {
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 16px;
}

body.ui-v2 .add-block-btn:hover {
    border-color: rgba(88, 166, 255, 0.55);
    background: rgba(88, 166, 255, 0.08);
    color: var(--text-primary);
}

/* Block selector + toolbar */
body.ui-v2 .block-selector {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.ui-v2 .block-selector-header {
    background: var(--bg-tertiary);
}

body.ui-v2 .block-selector-search {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

body.ui-v2 .block-option:hover {
    background: var(--bg-hover);
}

body.ui-v2 .editor-toolbar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.ui-v2 .toolbar-select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

/* Modals */
body.ui-v2 .modal-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

body.ui-v2 .modal-header {
    border-bottom: 1px solid var(--border-color);
}

body.ui-v2 .modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Keep code blocks aligned with VS Code look */
body.ui-v2 .code-block {
    border-color: rgba(240, 246, 252, 0.12);
}
