/* ========================================
   AuraPad Pro - Premium Apple-Linear Aesthetic
   Industry-Leading Professional Writing Suite
   ======================================== */

/* CSS Variables - Premium Design System */
:root {
    /* High-End Neutral Base with Mesh Gradient */
    --bg-primary: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #ffffff;
    --bg-hover: #f0f4ff;
    --bg-active: #e5edff;
    --bg-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.03) 0px, transparent 50%);

    /* Signature Gradient - Electric Indigo to Royal Purple */
    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);

    /* Text Colors - Premium Contrast */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    /* Layered Soft Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --shadow-luxe: 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
    --shadow-luxe-lg: 0 15px 30px -5px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15), 0 0 40px rgba(99, 102, 241, 0.1);
    --shadow-glow-active: 0 0 30px rgba(99, 102, 241, 0.25), 0 0 60px rgba(139, 92, 246, 0.15);

    /* Glassmorphism - Frosted Glass */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-strong: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-border-subtle: 1px solid rgba(255, 255, 255, 0.2);
    --glass-blur: blur(4px);
    --glass-blur-strong: blur(8px);

    /* Border System */
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;
    --border-focus: #6366f1;
    --border-radius-sm: 10px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Premium Fonts */
    --font-modern: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-elegant: 'Playfair Display', Georgia, serif;
    --font-professional: 'Montserrat', sans-serif;
    --font-serif: 'Lora', Georgia, serif;
    --font-code: 'JetBrains Mono', 'Courier New', monospace;

    /* Smooth Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Global Styles - Scoped to editor only for WordPress compatibility */
#aurapad-evolution,
#aurapad-evolution * {
    box-sizing: border-box;
}

#aurapad-evolution {
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
    font-family: var(--font-modern);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar - Vibrant */
#aurapad-evolution ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#aurapad-evolution ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

#aurapad-evolution ::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: all var(--transition-fast);
}

#aurapad-evolution ::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   Header Section - Glassmorphic
   ======================================== */
.aurapad-header {
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.98);
    border: var(--glass-border);
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.aurapad-header-inner {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left,
.header-right {
    flex: 0 0 auto;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

/* Logo - Premium Design */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all var(--transition-bounce);
}

.logo-icon:hover {
    transform: rotate(-10deg) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 20px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tab Bar - Vibrant */
.tab-bar {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color-light);
    border-bottom: 3px solid transparent;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    white-space: nowrap;
    position: relative;
    box-shadow: none;
    animation: slideIn 0.3s var(--transition-smooth);
}

.tab-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: var(--accent-indigo);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tab.active {
    background: white;
    color: var(--text-primary);
    border-bottom-color: transparent;
    border-bottom: 3px solid;
    border-image: var(--accent-gradient) 1;
    box-shadow: var(--shadow-md);
    font-weight: 600;
}

.tab.locked::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
    font-size: 12px;
}

.tab-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.tab-edit,
.tab-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0.7;
    transition: all var(--transition-fast);
}

.tab-edit:hover,
.tab-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tab-edit:hover {
    color: var(--accent-indigo);
}

.new-tab-btn {
    padding: 10px 18px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.new-tab-btn:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.theme-toggle {
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--accent-indigo);
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent-indigo);
    transform: scale(1.05);
    box-shadow: var(--shadow-luxe);
}

/* ========================================
   Toolbar - Crystal Glass Effect
   ======================================== */
/* ========================================
   Toolbar - Glassmorphic Islands
   ======================================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
}

.toolbar-island {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.toolbar-island:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Removed .toolbar-group */

.toolbar-btn {
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-indigo);
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.toolbar-btn:active {
    background: var(--bg-active);
    border-color: var(--accent-indigo);
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.toolbar-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.toolbar-select {
    padding: 10px 14px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-modern);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
}

.toolbar-select:hover {
    background: var(--bg-hover);
    border-color: var(--accent-indigo);
    box-shadow: var(--shadow-luxe);
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: var(--shadow-glow);
    z-index: 1000;
}

.premium-font-select {
    min-width: 180px;
}

/* Removed .toolbar-divider */

/* Color Picker System */
.color-picker-wrapper {
    position: relative;
}

.color-indicator {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent-indigo);
    border-radius: 2px;
}

/* Color Picker System - Using Portal (see bottom of file for actual styles) */

.color-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.color-preset {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-luxe);
}

.color-input {
    width: 100%;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* Industry Color Picker */
.industry-picker {
    min-width: 320px !important;
    padding: 16px !important;
}

.picker-left {
    flex: 1;
}

.picker-right {
    width: 120px;
    flex-shrink: 0;
}

.color-preview-swatch {
    transition: background 0.2s ease;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.color-preview-swatch:hover {
    transform: scale(1.02);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hex-input:focus {
    outline: none;
    border-color: var(--accent-indigo) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Zoom Level Display */
.zoom-level {
    padding: 6px 12px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-luxe-lg);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInUp 0.3s var(--transition-smooth);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.dropdown-content a:hover {
    background: var(--bg-hover);
    color: var(--accent-indigo);
}

.dropdown-content i {
    width: 20px;
    text-align: center;
    color: var(--accent-indigo);
}

/* ========================================
   Find & Replace - Glassmorphic Panel
   ======================================== */
.find-replace-panel {
    display: none;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.find-replace-panel.active {
    display: block;
    animation: slideDown 0.3s var(--transition-smooth);
}

.find-replace-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 900px;
}

.find-replace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.find-replace-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.find-replace-header i {
    color: var(--accent-indigo);
}

.find-replace-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.find-input {
    flex: 1;
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-modern);
    font-size: 14px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.find-input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: var(--shadow-glow);
}

.find-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.find-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-indigo);
    transform: translateY(-1px);
    box-shadow: var(--shadow-luxe);
}

.find-btn.primary-btn {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.find-btn.primary-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-glow);
}

.match-counter {
    padding: 6px 12px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
}

.close-find-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.close-find-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ========================================
   Workspace - Floating Canvas
   ======================================== */
/* ========================================
   Workspace - Floating Canvas
   ======================================== */
.workspace {
    flex: 1;
    background: var(--bg-secondary);
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    padding: 32px;
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Global scrollbar - allows scrolling the entire workspace */
}

.editor-container {
    width: 100%;
    min-height: 100%;
    overflow: visible;
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ensure editors don't overlap */
#richEditor {
    display: block;
}

#plainEditor {
    display: none;
}

#plainEditor[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#plainEditor[style*="display: flex"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#richEditor[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#richEditor[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Ensure line numbers never appear in rich editor */
#richEditor .line-numbers,
.rich-editor .line-numbers,
#quillEditor .line-numbers,
.ql-editor .line-numbers {
    display: none !important;
    visibility: hidden !important;
}

/* Floating Canvas Effect */
.floating-canvas {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: none;
    padding: 20px 20px;
    min-height: calc(100% - 80px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-smooth);
    position: relative;
    z-index: auto;
}

.floating-canvas:focus-within {
    border-color: var(--accent-indigo);
    box-shadow: var(--shadow-glow-active);
    animation: pulseGlow 2s infinite;
}

.plain-canvas {
    display: flex;
    gap: 0;
    padding: 32px 0 32px 32px;
}

/* Rich Text Editor */
#quillEditor {
    /* min-height: 600px; */
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    width: 100%;
}

.ql-container {
    font-family: var(--font-modern);
    font-size: 16px;
    border: none !important;
    width: 100%;
}

.ql-editor {
    min-height: 80vh;
    width: 100%;
    /* No max-height or overflow - content flows naturally, workspace handles scrolling */
    color: var(--text-primary);
    padding: 0;
    cursor: text;
}

.ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: italic;
    left: 0;
}

/* Image Resize Handles */
.ql-editor img {
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-luxe);
    transition: all var(--transition-smooth);
}

.ql-editor img:hover {
    box-shadow: var(--shadow-glow);
}

/* Horizontal Rule Divider */
.ql-editor .horizontal-rule-divider,
.horizontal-rule-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
    height: 0;
    width: 100%;
    display: block;
}

/* Plain Text Editor */
.line-numbers {
    padding: 0 16px;
    background: var(--bg-secondary);
    border-right: 2px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-code);
    font-size: 14px;
    line-height: 1.8;
    text-align: right;
    user-select: none;
    overflow: hidden;
    min-width: 60px;
}

/* Ensure plain editor and all its contents are hidden when display is none */
#plainEditor[style*="display: none"] .line-numbers,
#plainEditor[style*="display: none"] #plainTextArea {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure line numbers are only visible in plain editor when it's active */
.plain-editor:not([style*="display: none"]) .line-numbers {
    display: block;
}

.plain-editor[style*="display: none"] .line-numbers {
    display: none !important;
}

#plainTextArea {
    flex: 1;
    padding: 0 32px;
    background: white;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-code);
    font-size: 14px;
    line-height: 1.8;
    resize: none;
    outline: none;
    min-height: 80vh;
}

/* ========================================
   Status Bar - Vibrant
   ======================================== */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    font-size: 13px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    box-shadow: 0 -2px 8px rgba(99, 102, 241, 0.05);
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status-item i {
    font-size: 12px;
    color: var(--accent-indigo);
}

.status-divider {
    color: var(--border-color);
    font-weight: 300;
}

.auto-save-indicator {
    color: var(--accent-indigo);
    font-weight: 600;
}

.auto-save-indicator.saving {
    animation: pulse 1.5s infinite;
}

/* ========================================
   Modal Styles - Premium
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-2xl);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-content h3 i {
    color: var(--accent-indigo);
    font-size: 22px;
}

.modal-content p {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.modal-input {
    width: 100%;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-modern);
    font-size: 15px;
    margin-bottom: 28px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: var(--shadow-glow);
    background: white;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.cancel-btn {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.cancel-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.confirm-btn {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.confirm-btn:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   Animations
   ======================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: var(--shadow-glow-active);
    }

    50% {
        box-shadow: 0 0 50px rgba(139, 92, 246, 0.4);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ========================================
   Tooltips - Premium Micro-Animations
   ======================================== */
/* ========================================
   Tooltips - Premium Micro-Animations
   ======================================== */
.toolbar-btn[data-title]:not(.has-dropdown-open):hover::after,
.new-tab-btn[data-title]:not(.has-dropdown-open):hover::after,
.theme-toggle[data-title]:not(.has-dropdown-open):hover::after,
.font-size-btn[data-title]:not(.has-dropdown-open):hover::after,
.toolbar-select[data-title]:not(.has-dropdown-open):hover::after {
    content: attr(data-title);
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: fadeInDown 0.2s var(--transition-smooth);
    pointer-events: none;
}

.toolbar-btn[data-title]:not(.has-dropdown-open):hover::before,
.new-tab-btn[data-title]:not(.has-dropdown-open):hover::before,
.theme-toggle[data-title]:not(.has-dropdown-open):hover::before,
.font-size-btn[data-title]:not(.has-dropdown-open):hover::before,
.toolbar-select[data-title]:not(.has-dropdown-open):hover::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: var(--text-primary);
    z-index: 1001;
    pointer-events: none;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Focus Mode - Toolbar Fade */
.toolbar.focus-mode {
    opacity: 0.2;
}

/* Auto-Save Pulse Dot */
.save-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseDot 2s infinite;
}

.save-pulse-dot.syncing {
    background: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
}

@keyframes pulseDot {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Empty State Hero */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 48px;
    z-index: 10;
    pointer-events: none;
}

.empty-state.active {
    display: flex;
    pointer-events: all;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    background: var(--accent-gradient-subtle);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

.empty-state-icon i {
    font-size: 48px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state h2 {
    font-size: 32px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
    max-width: 400px;
}

.empty-state-cta {
    padding: 14px 32px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all var(--transition-smooth);
}

.empty-state-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {

    #aurapad-evolution .aurapad-header,
    #aurapad-evolution .toolbar,
    #aurapad-evolution .find-replace-panel,
    #aurapad-evolution .status-bar {
        display: none !important;
    }

    #aurapad-evolution .workspace {
        padding: 0;
        background: white;
    }

    #aurapad-evolution .floating-canvas {
        border: none;
        box-shadow: none;
        max-width: 100%;
        padding: 20px;
    }

    #aurapad-evolution .line-numbers {
        display: none;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .floating-canvas {
        padding: 32px 40px;
        max-width: 95%;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .aurapad-header {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .header-center {
        order: 3;
        width: 100%;
        margin-top: 12px;
        padding: 0;
    }

    .toolbar {
        padding: 12px 16px;
        gap: 8px;
    }

    .toolbar-btn,
    .toolbar-select {
        padding: 8px 12px;
        font-size: 13px;
    }

    .toolbar-divider {
        display: none;
    }

    .workspace {
        padding: 16px;
    }

    .floating-canvas {
        padding: 24px;
        border-radius: var(--border-radius-md);
        max-width: 95%;
        width: 95%;
    }

    .status-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        font-size: 12px;
    }

    .status-left,
    .status-right {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    .toolbar-btn span,
    .new-tab-btn span {
        display: none;
    }

    .tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .floating-canvas {
        padding: 20px;
        max-width: 100%;
        width: 100%;
    }
}

/* ========================================
   Dropdown Portal System (z-index 999999+ for WordPress compatibility)
   WordPress admin bar uses z-index: 99999, so we use 999999+
   All classes prefixed with "aurapad-" to avoid WordPress conflicts
   ======================================== */
#aurapad-dropdown-portal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    overflow: visible !important;
}

.aurapad-dropdown-menu {
    position: fixed !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
    min-width: 240px !important;
    box-sizing: border-box !important;
    padding: 6px 0 8px 0 !important;
    margin-top: 4px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    pointer-events: auto !important;
    z-index: 999999 !important;
    animation: dropdownFadeIn 0.2s ease-out;
}

.aurapad-dropdown-menu::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

.aurapad-dropdown-menu-header,
.dropdown-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aurapad-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.aurapad-dropdown-item:hover {
    background: #f5f7ff;
}

.aurapad-dropdown-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.aurapad-dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.aurapad-dropdown-item-icon-text {
    width: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aurapad-dropdown-item-shortcut {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-code);
}

.aurapad-dropdown-divider,
.dropdown-divider{
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 8px 0;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Font Size Controller */
.font-size-controller {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 4px;
}

.font-size-btn {
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.font-size-btn:hover {
    background: var(--bg-hover);
}

.font-size-input {
    width: 45px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.font-size-input::-webkit-inner-spin-button,
.font-size-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* ========================================
   Image Resize Handles
   ======================================== */
.image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-wrapper.selected {
    outline: 2px solid var(--accent-indigo);
    outline-offset: 2px;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid var(--accent-indigo);
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.image-wrapper.selected .resize-handle {
    opacity: 1;
}

.resize-handle.resize-nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.resize-handle.resize-n {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.resize-handle.resize-ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.resize-handle.resize-e {
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    cursor: e-resize;
}

.resize-handle.resize-se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.resize-handle.resize-s {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.resize-handle.resize-sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.resize-handle.resize-w {
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    cursor: w-resize;
}

.floating-caption-btn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.image-wrapper.selected .floating-caption-btn {
    opacity: 1;
}

.floating-caption-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* ========================================
   Sticky Notes
   ======================================== */
.sticky-note {
    position: absolute;
    background: #ffefd5;
    border-left: 4px solid #f59e0b;
    border-radius: var(--border-radius-sm);
    padding: 12px 14px;
    margin: 0;
    box-shadow: var(--shadow-md);
    z-index: 100;
    max-width: 220px;
    min-width: 180px;
}

.sticky-note-handle {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #f59e0b;
    cursor: move;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.sticky-note:hover .sticky-note-handle {
    opacity: 1;
}

.sticky-note-content {
    color: #78350f;
    font-size: 16px;
    line-height: 1.6;
    font-family: 'Dancing Script', 'Brush Script MT', 'Lucida Handwriting', cursive;
    font-style: normal;
    font-weight: 500;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    outline: none;
}

.sticky-note-content::-webkit-scrollbar {
    width: 4px;
}

.sticky-note-content::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 2px;
}

/* ========================================
   Collapsible Containers
   ======================================== */
.collapsible-container-wrapper {
    margin: 16px 0;
    width: 100%;
}

.ql-editor .collapsible-container-wrapper {
    margin: 16px 0;
}

.collapsible-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin: 0;
    overflow: hidden;
    background: white;
    display: block;
}

.ql-editor .collapsible-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin: 0;
    overflow: hidden;
    background: white;
    display: block;
}

.collapsible-container summary {
    padding: 14px 18px;
    background: var(--bg-secondary);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
    user-select: none;
    outline: none;
    list-style: none;
}

.collapsible-container summary:hover {
    background: var(--bg-hover);
}

.collapsible-container summary::-webkit-details-marker {
    display: none;
}

.collapsible-container summary::marker {
    display: none;
    content: '';
}

.collapsible-container summary::before {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: var(--accent-indigo);
    transition: transform var(--transition-smooth);
    transform: rotate(0deg);
    flex-shrink: 0;
}

.collapsible-container:not([open]) summary::before {
    transform: rotate(-90deg);
}

.collapsible-content {
    padding: 18px;
    background: white;
    min-height: 40px;
}

.ql-editor .collapsible-content {
    padding: 18px;
    background: white;
    min-height: 40px;
}

.collapsible-content p {
    margin: 0;
    padding: 0;
}

.collapsible-content p:first-child {
    margin-top: 0;
}

.collapsible-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Table Grid Picker
   ======================================== */
.table-grid-picker {
    display: grid;
    grid-template-columns: repeat(8, 30px);
    grid-template-rows: repeat(8, 30px);
    gap: 4px;
    padding: 16px;
}

.table-grid-cell {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.table-grid-cell:hover,
.table-grid-cell.highlight {
    background: var(--accent-gradient-subtle);
    border-color: var(--accent-indigo);
}

.table-size-display {
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========================================
   Draw Canvas Modal
   ======================================== */
.draw-modal {
    max-width: 700px;
}

#drawCanvas {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    cursor: crosshair;
    background: white;
    display: block;
    margin: 0 auto 16px;
}

.draw-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.draw-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.draw-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-indigo);
}

#drawColorPicker {
    width: 50px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

#drawSizeSlider {
    width: 120px;
}

/* ========================================
   Enhanced Floating Canvas (merged with earlier definition)
   ======================================== */

/* Image Resizer Handles */
/* Floating Image Tools Overlay */
.image-tools-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    border: 2px solid var(--accent-indigo);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.image-tools-overlay .resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-indigo);
    border: 2px solid white;
    border-radius: 50%;
    z-index: 1010;
    pointer-events: auto;
    transition: transform 0.2s ease;
}

.image-tools-overlay .resize-handle:hover {
    transform: scale(1.2);
}

.image-tools-overlay .resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.image-tools-overlay .resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.image-tools-overlay .resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.image-tools-overlay .resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.image-tools-overlay .image-caption-btn {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
    pointer-events: auto;
    z-index: 1010;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-tools-overlay .image-caption-btn i {
    color: var(--accent-indigo);
}

.image-tools-overlay .image-caption-btn:hover {
    background: var(--accent-indigo);
    color: white;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.image-tools-overlay .image-caption-btn:hover i {
    color: white;
}

/* Caption Popup */
.caption-popup {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    animation: fadeInUp 0.2s ease-out;
}

.caption-popup input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    outline: none;
}

.caption-popup input:focus {
    border-color: var(--accent-indigo);
}

.caption-popup .popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.caption-popup button {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.caption-popup .confirm-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

.caption-popup .cancel-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Custom Image With Caption Blot */
.ql-editor .image-with-caption-block {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 10px 0;
}

.ql-editor .image-with-caption-block img {
    display: block;
    max-width: 100%;
    height: auto;
}

.ql-editor .image-with-caption-block .image-caption-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 10;
    padding: 6px 12px;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    font-style: normal;
    pointer-events: auto;
    /* Enable clicking */
    cursor: text;
    /* Show text cursor */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 16px);
    min-width: 100px;
    outline: none;
    transition: all 0.2s ease;
}

.ql-editor .image-caption-overlay:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
}

.ql-editor .image-caption-overlay:focus {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Placeholder for empty caption */
.ql-editor .image-caption-overlay.empty:before {
    content: attr(data-placeholder);
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

/* Hide background when caption is empty */
.ql-editor .image-caption-overlay.empty {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Show background on hover even when empty */
.ql-editor .image-caption-overlay.empty:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Base caption styles (fallback or for other contexts) */
.image-caption {
    font-size: 14px;
    color: var(--text-tertiary);
    font-style: italic;
    display: inline-block;
    user-select: none;
}

/* Table Styles in Quill Editor */
.ql-editor .custom-table-block {
    margin: 10px 0;
    padding: 0;
}

.ql-editor .custom-table-block table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.ql-editor .custom-table-block table td,
.ql-editor .custom-table-block table th {
    padding: 12px;
    border: 1px solid #e2e8f0;
    min-width: 100px;
    vertical-align: top;
    outline: none;
}

.ql-editor .custom-table-block table td:focus {
    background-color: #f8fafc;
    border-color: #6366f1;
}

.ql-editor .custom-table-block table th {
    background-color: #f8fafc;
    font-weight: 600;
}

/* Legacy table styles */
.ql-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    border: 1px solid #e2e8f0;
}

.ql-editor table td,
.ql-editor table th {
    padding: 12px;
    border: 1px solid #e2e8f0;
    min-width: 100px;
    vertical-align: top;
}

.ql-editor table th {
    background-color: #f8fafc;
    font-weight: 600;
}

/* Sticky Note Styling */
.sticky-note {
    position: absolute;
    width: 200px;
    min-height: 150px;
    background: #fff9c4;
    /* Post-it Yellow */
    border-radius: 2px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    transform: rotate(-1deg);
    z-index: 100;
}

.sticky-note:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 101;
}

.sticky-note-handle {
    height: 24px;
    background: rgba(0, 0, 0, 0.05);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.3);
    font-size: 12px;
}

.sticky-note-handle:active {
    cursor: grabbing;
}

/* Color Picker Portal Fix - WordPress compatibility */
.aurapad-color-picker-panel {
    display: none;
    position: fixed !important;
    z-index: 999999 !important;
    background: white !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    min-width: 240px !important;
    pointer-events: auto !important;
}

.aurapad-color-picker-panel.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

/* Column Layout Modal */
.column-modal {
    max-width: 600px !important;
    padding: 24px !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.column-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.layout-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.layout-card:hover {
    border-color: var(--accent-indigo);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.layout-card span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.layout-preview {
    width: 100%;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: flex;
    gap: 4px;
    padding: 4px;
}

.layout-preview div {
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-2-equal::before,
.col-2-equal::after {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-2-25-75::before {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-2-25-75::after {
    content: '';
    flex: 3;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-2-75-25::before {
    content: '';
    flex: 3;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-2-75-25::after {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-3-equal::before,
.col-3-equal::after {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-3-equal {
    justify-content: space-between;
}

.col-3-equal div {
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-3-25-50-25::before {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-3-25-50-25::after {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-3-25-50-25 div {
    flex: 2;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-4-equal::before,
.col-4-equal::after {
    content: '';
    flex: 1;
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
}

.col-4-equal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.col-4-equal::before,
.col-4-equal::after {
    content: none;
}

.col-4-equal div {
    background: var(--accent-indigo);
    opacity: 0.2;
    border-radius: 3px;
    width: 100%;
    height: 100%;
}

/* Inserted Column Blocks */
.custom-column-block {
    margin: 24px 0;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 0;
    transition: all 0.2s;
    background: transparent;
    position: relative;
}

.column-container {
    display: grid;
    column-gap: 2px;
    row-gap: 4px;
    width: 100%;
}

.column-cell {
    min-height: 60px;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: 0;
    transition: all 0.2s;
    outline: none;
    background: white;
}

.column-cell:focus {
    background: white;
    border-style: solid;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.column-cell:empty::before {
    content: 'Type here...';
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive Columns */
@media (max-width: 768px) {
    .column-container {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   Print Optimization
   ======================================== */
@media print {

    /* Remove default page margins */
    @page {
        margin: 0;
        size: A4;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Hide all UI elements */
    .aurapad-header,
    .toolbar,
    .status-bar,
    .tab-bar,
    .new-tab-btn,
    .theme-toggle,
    .find-replace-panel,
    .modal,
    #dropdown-portal,
    .empty-state,
    .floating-canvas::before {
        display: none !important;
    }

    /* Reset workspace for print */
    #aurapad-evolution {
        height: auto !important;
        overflow: visible !important;
    }

    .workspace {
        padding: 0 !important;
        background: white !important;
        background-image: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .editor-container {
        height: auto !important;
        overflow: visible !important;
    }

    .floating-canvas {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        min-height: auto !important;
    }

    .ql-editor {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Table print optimization */
    .custom-table-block,
    .ql-editor .custom-table-block {
        margin: 10px 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
    }

    .custom-table-block table,
    .ql-editor .custom-table-block table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        font-size: 8pt !important;
        border-collapse: collapse !important;
    }

    .custom-table-block table td,
    .custom-table-block table th,
    .ql-editor .custom-table-block table td,
    .ql-editor .custom-table-block table th {
        padding: 3px 4px !important;
        font-size: 8pt !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Hide Column Layout labels and borders in print */
    .custom-column-block {
        margin: 10px 0 !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .custom-column-block::before {
        display: none !important;
    }

    .column-container {
        gap: 20px !important;
    }

    .column-cell {
        border: none !important;
        padding: 0 !important;
        min-height: auto !important;
        background: transparent !important;
    }

    /* Ensure text is black for printing */
    body,
    .ql-editor {
        color: black !important;
        background: white !important;
    }

    /* Page breaks */
    .page-break {
        page-break-after: always;
    }
}