/* ChronoTrust Visual Page Editor - Professional Styles */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --editor-primary: #6366f1;
    --editor-primary-hover: #4f46e5;
    --editor-success: #10b981;
    --editor-success-hover: #059669;
    --editor-warning: #f59e0b;
    --editor-error: #ef4444;
    --editor-dark: #1e1e2e;
    --editor-darker: #181825;
    --editor-light: #313244;
    --editor-text: #cdd6f4;
    --editor-text-muted: #a6adc8;
    --editor-border: #45475a;
    --editor-highlight: rgba(99, 102, 241, 0.15);
    --editor-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --editor-radius: 8px;
    --editor-radius-lg: 12px;
}

/* ========================================
   Main Editor Toolbar
   ======================================== */
.editor-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--editor-dark);
    z-index: 100000;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-top: 1px solid var(--editor-border);
}

.editor-toolbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.editor-toolbar-left,
.editor-toolbar-center,
.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-toolbar-center {
    flex: 1;
    justify-content: center;
}

/* Editor Logo */
.editor-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px;
    border-right: 1px solid var(--editor-border);
}

.editor-logo-icon {
    font-size: 1.5rem;
    color: var(--editor-primary);
}

.editor-logo-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--editor-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Editor Buttons */
.editor-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--editor-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.editor-btn .btn-icon {
    font-size: 1rem;
}

.editor-btn-primary {
    background: linear-gradient(135deg, var(--editor-primary) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.editor-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.editor-btn-primary.active {
    background: linear-gradient(135deg, var(--editor-success) 0%, #34d399 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.editor-btn-success {
    background: linear-gradient(135deg, var(--editor-success) 0%, #34d399 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.editor-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.editor-btn-secondary {
    background: var(--editor-light);
    color: var(--editor-text);
    border: 1px solid var(--editor-border);
}

.editor-btn-secondary:hover {
    background: var(--editor-border);
}

.editor-btn-ghost {
    background: transparent;
    color: var(--editor-text-muted);
    padding: 10px 14px;
}

.editor-btn-ghost:hover {
    background: var(--editor-light);
    color: var(--editor-text);
}

.editor-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Small Buttons */
.editor-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--editor-light);
    border: 1px solid var(--editor-border);
    border-radius: 6px;
    color: var(--editor-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-btn-sm:hover:not(:disabled) {
    background: var(--editor-border);
    color: var(--editor-text);
}

.editor-btn-sm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Status Indicator */
.editor-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--editor-light);
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--editor-text-muted);
}

.status-text {
    color: var(--editor-text-muted);
}

.status-ready .status-dot { background: var(--editor-text-muted); }
.status-editing .status-dot { background: var(--editor-primary); animation: pulse 2s infinite; }
.status-unsaved .status-dot { background: var(--editor-warning); animation: pulse 1s infinite; }
.status-saving .status-dot { background: var(--editor-primary); animation: spin 1s linear infinite; }
.status-saved .status-dot { background: var(--editor-success); }
.status-error .status-dot { background: var(--editor-error); }

.status-unsaved .status-text { color: var(--editor-warning); font-weight: 500; }
.status-saved .status-text { color: var(--editor-success); }
.status-error .status-text { color: var(--editor-error); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

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

/* Edit Mode Bar */
.editor-toolbar-edit-mode {
    background: var(--editor-darker);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--editor-border);
}

.edit-mode-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--editor-text-muted);
    font-size: 0.85rem;
}

.edit-mode-icon {
    font-size: 1.1rem;
}

.edit-mode-actions {
    display: flex;
    gap: 8px;
}

/* Body adjustments when editor is active */
body:has(.editor-toolbar) {
    padding-bottom: 120px;
}

body.edit-mode-active:has(.editor-toolbar) {
    padding-bottom: 160px;
}

/* ========================================
   Floating Formatting Toolbar
   ======================================== */
.floating-toolbar {
    position: absolute;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--editor-dark);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    box-shadow: var(--editor-shadow);
    z-index: 100001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-toolbar.visible {
    display: flex;
    animation: fadeInUp 0.2s ease;
}

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

.ft-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--editor-text);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9rem;
}

.ft-btn:hover {
    background: var(--editor-light);
    color: var(--editor-primary);
}

.ft-btn:active {
    transform: scale(0.95);
}

.ft-divider {
    width: 1px;
    height: 20px;
    background: var(--editor-border);
    margin: 0 6px;
}

/* Color picker styles */
.ft-color-group {
    display: flex;
    gap: 4px;
}

.ft-color-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--editor-text);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
    position: relative;
}

.ft-color-btn:hover {
    background: var(--editor-light);
}

.ft-color-btn .color-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
}

.ft-select {
    padding: 6px 10px;
    background: var(--editor-light);
    border: 1px solid var(--editor-border);
    border-radius: 6px;
    color: var(--editor-text);
    font-size: 0.8rem;
    cursor: pointer;
}

.ft-select:focus {
    outline: none;
    border-color: var(--editor-primary);
}

/* ========================================
   Editable Elements
   ======================================== */
.editable-element {
    transition: all 0.2s ease;
}

.editable-highlight {
    position: relative;
    outline: 2px dashed var(--editor-primary) !important;
    outline-offset: 4px;
    background-color: var(--editor-highlight) !important;
    cursor: pointer !important;
    border-radius: 4px;
}

.editable-highlight::after {
    content: 'Click to edit';
    position: absolute;
    top: -30px;
    left: 0;
    padding: 4px 10px;
    background: var(--editor-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.editable-highlight:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Image editable */
img.editable-highlight::after {
    content: 'Click to change image';
}

.element-selected {
    outline: 3px solid var(--editor-primary) !important;
    outline-offset: 4px;
    background-color: rgba(99, 102, 241, 0.1) !important;
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.1);
}

.element-selected::after {
    content: 'Editing' !important;
    background: var(--editor-success) !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Preview Mode */
body.preview-mode .editable-highlight {
    outline: none !important;
    background-color: transparent !important;
}

body.preview-mode .editable-highlight::after {
    display: none;
}

body.preview-mode .editor-toolbar-edit-mode {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e1e2e 100%);
}

/* ========================================
   Modals
   ======================================== */
.editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100002;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.editor-modal.visible {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.editor-modal-content {
    background: var(--editor-dark);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--editor-shadow);
    animation: slideUp 0.3s ease;
}

.editor-modal-sm {
    max-width: 400px;
}

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

.editor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--editor-border);
}

.editor-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--editor-text);
}

.editor-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--editor-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.editor-modal-close:hover {
    background: var(--editor-light);
    color: var(--editor-text);
}

.editor-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.editor-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--editor-border);
    background: var(--editor-darker);
}

/* Form Elements in Editor */
.editor-modal .form-group {
    margin-bottom: 20px;
}

.editor-modal .form-group:last-child {
    margin-bottom: 0;
}

.editor-modal label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--editor-text);
}

.editor-modal input[type="text"],
.editor-modal input[type="url"],
.editor-modal input[type="email"],
.editor-modal textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--editor-darker);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    color: var(--editor-text);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.editor-modal input:focus,
.editor-modal textarea:focus {
    outline: none;
    border-color: var(--editor-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.editor-modal small {
    display: block;
    margin-top: 6px;
    color: var(--editor-text-muted);
    font-size: 0.75rem;
}

.editor-modal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--editor-text);
}

.editor-modal .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Image Preview */
.image-preview-container {
    width: 100%;
    height: 200px;
    background: var(--editor-darker);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Image Upload Dropzone */
.image-upload-dropzone {
    border: 2px dashed var(--editor-border);
    border-radius: var(--editor-radius);
    padding: 30px 20px;
    text-align: center;
    background: var(--editor-darker);
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-upload-dropzone:hover,
.image-upload-dropzone.dragover {
    border-color: var(--editor-primary);
    background: var(--editor-highlight);
}

.image-upload-dropzone .dropzone-content p {
    margin: 10px 0 5px;
    color: var(--editor-text);
}

.image-upload-dropzone .dropzone-content small {
    color: var(--editor-text-muted);
}

/* Upload Progress */
.upload-progress-bar {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-progress-bar .progress-track {
    flex: 1;
    height: 6px;
    background: var(--editor-darker);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-bar .progress-fill {
    height: 100%;
    background: var(--editor-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.upload-progress-bar span {
    font-size: 0.85rem;
    color: var(--editor-text-muted);
    white-space: nowrap;
}

/* Form Divider */
.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--editor-text-muted);
    font-size: 0.85rem;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--editor-border);
}

.form-divider span {
    padding: 0 12px;
}

/* ========================================
   Image Editing
   ======================================== */

/* All images become editable in edit mode */
body.edit-mode-active .editor-image-editable {
    cursor: pointer;
    transition: all 0.2s ease;
}

body.edit-mode-active .editor-image-editable:hover {
    outline: 3px solid var(--editor-primary);
    outline-offset: 2px;
}

.editor-image-selected {
    outline: 3px solid var(--editor-primary) !important;
    outline-offset: 2px;
}

.editor-image-dragover {
    outline: 3px dashed var(--editor-success) !important;
    outline-offset: 2px;
    opacity: 0.7;
}

/* Image wrapper for resize handles */
.editor-image-wrapper {
    position: relative;
    display: inline-block;
}

/* Resize handles */
.editor-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--editor-primary);
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 1000;
    cursor: pointer;
}

.editor-resize-nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.editor-resize-ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.editor-resize-sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.editor-resize-se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

/* Size display */
.editor-image-size {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--editor-dark);
    color: var(--editor-text);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    white-space: nowrap;
    z-index: 1000;
}

/* Global drop overlay */
.editor-drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: rgba(99, 102, 241, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.editor-drop-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.drop-overlay-content {
    text-align: center;
    color: #fff;
}

.drop-overlay-content h3 {
    font-size: 2rem;
    margin: 20px 0 10px;
}

.drop-overlay-content p {
    opacity: 0.8;
}

/* ========================================
   Settings Panel
   ======================================== */
.settings-panel {
    position: fixed;
    top: 0;
    right: -350px;
    bottom: 0;
    width: 350px;
    background: var(--editor-dark);
    border-left: 1px solid var(--editor-border);
    z-index: 100001;
    transition: right 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}

.settings-panel.visible {
    right: 0;
}

.settings-panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--editor-border);
}

.settings-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--editor-text);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

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

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--editor-text-muted);
    margin-bottom: 16px;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--editor-darker);
    border: 1px solid transparent;
    border-radius: var(--editor-radius);
    color: var(--editor-text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.settings-link:hover {
    border-color: var(--editor-border);
    background: var(--editor-light);
}

.settings-link.active {
    border-color: var(--editor-primary);
    background: rgba(99, 102, 241, 0.1);
}

.settings-link span:first-child {
    font-size: 1.1rem;
}

/* Keyboard Shortcuts */
.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--editor-text-muted);
}

kbd {
    padding: 4px 8px;
    background: var(--editor-darker);
    border: 1px solid var(--editor-border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--editor-text);
}

/* ========================================
   Notifications
   ======================================== */
.notification-area {
    position: fixed;
    bottom: 180px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100003;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.editor-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--editor-dark);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    box-shadow: var(--editor-shadow);
    color: var(--editor-text);
    font-size: 0.9rem;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
}

.editor-notification.visible {
    transform: translateX(0);
    opacity: 1;
}

.notification-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.editor-notification.success .notification-icon {
    background: var(--editor-success);
    color: white;
}

.editor-notification.error .notification-icon {
    background: var(--editor-error);
    color: white;
}

.editor-notification.info .notification-icon {
    background: var(--editor-primary);
    color: white;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .editor-toolbar-inner {
        padding: 10px 16px;
        flex-wrap: wrap;
    }

    .editor-toolbar-left {
        display: none;
    }

    .editor-toolbar-center {
        order: 2;
        width: 100%;
        justify-content: center;
        padding-top: 10px;
    }

    .editor-toolbar-right {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    .editor-btn .btn-text {
        display: none;
    }

    .editor-btn {
        padding: 10px 14px;
    }

    .editor-toolbar-edit-mode {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .floating-toolbar {
        position: fixed;
        bottom: 170px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
    }

    .floating-toolbar.visible {
        display: flex;
    }

    .notification-area {
        bottom: 200px;
        right: 16px;
        left: 16px;
    }

    .editor-notification {
        transform: translateY(100%);
    }

    .editor-notification.visible {
        transform: translateY(0);
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .editor-toolbar,
    .floating-toolbar,
    .settings-panel,
    .notification-area,
    .editor-modal {
        display: none !important;
    }

    body:has(.editor-toolbar) {
        padding-bottom: 0;
    }
}

/* Hide editor on admin page */
body.admin-page .editor-toolbar,
body.admin-page .floating-toolbar,
body.admin-page .settings-panel {
    display: none !important;
}

/* ========================================
   Section Editable Styles
   ======================================== */
.section-editable {
    position: relative;
    transition: all 0.3s ease;
}

body.edit-mode-active .section-editable {
    outline: 2px dashed rgba(99, 102, 241, 0.4) !important;
    outline-offset: -4px;
}

body.edit-mode-active .section-editable::before {
    content: 'Right-click for options';
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    background: var(--editor-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.edit-mode-active .section-editable:hover::before {
    opacity: 1;
}

/* Media Editable Styles */
.media-editable {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.edit-mode-active .media-editable {
    outline: 3px dashed var(--editor-primary) !important;
    outline-offset: 4px;
}

body.edit-mode-active .media-editable::before {
    content: 'Click to edit media';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 20px;
    background: var(--editor-primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
}

body.edit-mode-active .media-editable:hover::before {
    opacity: 1;
}

/* Color Picker Row */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-row input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    cursor: pointer;
    background: transparent;
}

.color-picker-row input[type="text"] {
    flex: 1;
}

/* Gradient Row */
.gradient-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gradient-row input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    cursor: pointer;
    background: transparent;
}

.gradient-row span {
    color: var(--editor-text-muted);
    font-size: 1.2rem;
}

.gradient-row .checkbox-label {
    margin-left: auto;
}

/* Color Presets */
.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--editor-darker);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    transform: scale(1.1);
    border-color: var(--editor-primary);
}

/* Media Options */
.media-options {
    margin-top: 16px;
}

/* Select in Editor Modal */
.editor-modal select {
    width: 100%;
    padding: 12px 14px;
    background: var(--editor-darker);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    color: var(--editor-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-modal select:focus {
    outline: none;
    border-color: var(--editor-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Preview mode hides section hints */
body.preview-mode .section-editable::before,
body.preview-mode .media-editable::before {
    display: none !important;
}

body.preview-mode .section-editable,
body.preview-mode .media-editable {
    outline: none !important;
}

/* ========================================
   Right-Click Context Menu
   ======================================== */
.editor-context-menu {
    position: fixed;
    z-index: 100010;
    background: var(--editor-dark);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 8px 0;
    min-width: 200px;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: contextMenuIn 0.15s ease;
}

.editor-context-menu.visible {
    display: block;
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--editor-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.context-menu-item:hover {
    background: var(--editor-light);
    color: var(--editor-primary);
}

.context-menu-item .context-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.context-menu-divider {
    height: 1px;
    background: var(--editor-border);
    margin: 8px 0;
}

