/* =============================================
   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;
}

/* 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: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    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: transform var(--transition-fast);
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

/* =============================================
   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;
    height: 220px;
    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;
}

.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 {
    min-height: 200px;
    max-height: 500px;
}

.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 - Premium Dark */
.code-block {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
}

.code-language {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: transparent;
    border: none;
    font-family: var(--font-mono);
}

.copy-code-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.copy-code-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

pre.editable {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre-wrap;
}

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;
}

/* 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: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 300px;
    max-height: 420px;
    overflow-y: auto;
    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 {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.block-selector-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.block-options {
    padding: 8px;
}

.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: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: 4px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    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: none;
    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);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.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);
}

/* =============================================
   Responsive Design
   ============================================= */

@media (max-width: 1024px) {
    .content-wrapper {
        padding: 0 32px 60px;
    }
    
    .page-cover {
        margin: 0 -32px 28px;
    }
}

@media (max-width: 768px) {
    .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;
    }
    
    .admin-btn span {
        display: none;
    }
    
    .page-navigation {
        flex-direction: column;
    }
    
    .nav-link {
        max-width: 100%;
    }
    
    .block-controls {
        left: auto;
        right: 8px;
        top: 8px;
        transform: none;
        flex-direction: row;
    }
    
    .page-title {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0 20px 40px;
    }
    
    .page-cover {
        margin: 0 -20px 24px;
        height: 160px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    h2.editable {
        font-size: 24px;
    }
    
    h3.editable {
        font-size: 20px;
    }
    
    .admin-bar {
        padding: 0 12px;
    }
}

/* =============================================
   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;
}
