/**
 * Insight Dezign Visual Editor - Editor Styles
 * Admin only.
 */

/* ── Toggle Bar ── */
#idve-toggle-bar {
    margin: 10px 0;
    padding: 8px 0;
}
#idve-toggle-btn {
    font-size: 13px;
}

/* ── Editor Container ── */
#idve-editor {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #23282d;
    background: #f1f1f1;
    min-height: 500px;
}

/* ── Toolbar ── */
#idve-toolbar {
    position: sticky;
    top: 32px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}
.idve-toolbar-logo { width: 36px; height: 36px; margin-right: 4px; }
#idve-toolbar .idve-toolbar-spacer { flex: 1; }

/* ── Buttons ── */
.idve-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f7f7f7;
    color: #23282d;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.idve-btn:hover { background: #eee; border-color: #999; }
.idve-btn:disabled { opacity: 0.5; cursor: default; }
.idve-btn-primary { background: #0073aa; color: #fff; border-color: #0073aa; }
.idve-btn-primary:hover { background: #005a87; }
.idve-btn-danger { color: #dc3232; }
.idve-btn-danger:hover { background: #dc3232; color: #fff; border-color: #dc3232; }
.idve-btn-publish { background: #2271b1; color: #fff; border-color: #2271b1; }
.idve-btn-publish:hover { background: #135e96; border-color: #135e96; color: #fff; }

/* ── Unsaved Warning ── */
#idve-unsaved-warning {
    display: none;
    font-size: 12px;
    color: #826200;
    background: #fff8e5;
    border: 1px solid #ffb900;
    border-radius: 3px;
    padding: 4px 10px;
    margin-right: 8px;
}

/* ── Canvas ── */
#idve-canvas {
    padding: 20px;
    max-width: 100%;
}

/* ── Section ── */
.idve-editor-section {
    margin-bottom: 20px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.15s;
}
.idve-editor-section:hover { border-color: #0073aa; }
.idve-editor-section.idve-selected { border-color: #0073aa; border-style: solid; }
.idve-section-collapsed { border-style: dashed; }

/* ── Collapse Toggle ── */
.idve-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    transition: transform 0.15s, color 0.15s;
    transform: rotate(90deg);
    margin-left: 4px;
    flex-shrink: 0;
}
.idve-section-collapsed .idve-collapse-btn { transform: rotate(0deg); }
.idve-collapse-btn:hover { color: #0073aa; }

.idve-section-body { padding: 0; }

.idve-editor-section-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
}
.idve-editor-section-header .idve-label { flex: 1; }

/* ── Row ── */
.idve-editor-row {
    margin: 8px 10px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.15s;
}
.idve-editor-row:hover { border-color: #0073aa; }
.idve-editor-row.idve-selected { border-color: #0073aa; border-style: solid; }
.idve-editor-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f1f1f1;
    border-bottom: 1px solid #e2e2e2;
}
.idve-editor-row-header .idve-label { font-size: 11px; color: #888; text-transform: uppercase; }
.idve-editor-row-content {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px;
}

/* ── Column ── */
.idve-editor-column {
    border: 1px dashed #ddd;
    border-radius: 3px;
    padding: 8px;
    background: #fafafa;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.idve-editor-column:hover { border-color: #0073aa; }
.idve-editor-column.idve-selected { border-color: #0073aa; border-style: solid; background: #f0f7fc; }
.idve-editor-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
}

/* ── Block ── */
.idve-editor-block {
    border: 1px solid #eee;
    border-radius: 3px;
    margin-bottom: 8px;
    background: #fff;
    transition: all 0.15s;
}
.idve-editor-block:hover { border-color: #0073aa; box-shadow: 0 0 0 1px #0073aa; }
.idve-editor-block.idve-selected { border-color: #0073aa; box-shadow: 0 0 0 2px #0073aa; }
.idve-editor-block.idve-hidden { opacity: 0.4; }
.idve-editor-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-size: 11px;
    color: #666;
}
.idve-editor-block-content {
    padding: 10px;
    min-height: 30px;
}

/* ── Actions ── */
.idve-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.idve-editor-section:hover > .idve-editor-section-header .idve-actions,
.idve-editor-row:hover > .idve-editor-row-header .idve-actions,
.idve-editor-block:hover > .idve-editor-block-header .idve-actions { opacity: 1; }

/* Column actions — show on hover */
.idve-editor-column-header .idve-actions { opacity: 0; transition: opacity 0.15s; }
.idve-editor-column:hover > .idve-editor-column-header .idve-actions { opacity: 1; }
.idve-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 14px;
}
.idve-action-btn:hover { background: #eee; color: #23282d; }
.idve-settings-btn:hover { background: #0073aa !important; color: #fff !important; }
.idve-action-btn[data-action="delete"]:hover { background: #dc3232; color: #fff; }

/* ── Labels ── */
.idve-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Add Buttons ── */
.idve-add-row-btn,
.idve-add-block-btn,
.idve-add-section-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 3px;
    background: transparent;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    margin-top: 8px;
}
.idve-add-row-btn { margin: 8px 10px; }
.idve-add-row-btn:hover,
.idve-add-block-btn:hover,
.idve-add-section-btn:hover { border-color: #0073aa; color: #0073aa; background: #f0f7fc; }

/* ── Settings Modal ── */
.idve-settings-modal {
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.idve-settings-modal .idve-modal-header {
    flex-shrink: 0;
}
.idve-modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #eee;
    padding: 0 20px;
    flex-shrink: 0;
    background: #f7f7f7;
}
.idve-modal-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.idve-modal-tab:hover { color: #23282d; }
.idve-modal-tab.active { color: #0073aa; border-bottom-color: #0073aa; background: #fff; }
.idve-settings-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.idve-tab-content { display: none; }
.idve-tab-content.active { display: block; }
.idve-settings-modal .idve-modal-footer {
    flex-shrink: 0;
}

/* ── Field Groups ── */
.idve-field-group { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.idve-field-group:last-child { border-bottom: none; }
.idve-field-group h4 {
    margin: 0 0 12px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

/* ── Fields ── */
.idve-field { margin-bottom: 12px; }
.idve-field label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: #23282d; }
.idve-field input[type="text"],
.idve-field input[type="number"],
.idve-field input[type="url"],
.idve-field textarea,
.idve-field select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    color: #23282d;
    background: #fff;
}
.idve-field input:focus,
.idve-field textarea:focus,
.idve-field select:focus { border-color: #0073aa; box-shadow: 0 0 0 1px #0073aa; outline: none; }
.idve-field textarea { min-height: 80px; font-family: monospace; }

/* ── Color Field (native — used by border color) ── */
.idve-color-field { display: flex; align-items: center; gap: 8px; }
.idve-color-field input[type="color"] { width: 40px; height: 32px; padding: 2px; border: 1px solid #ddd; border-radius: 3px; cursor: pointer; }
.idve-color-field input[type="text"] { flex: 1; font-family: monospace; }
.idve-color-clear { padding: 4px 8px; border: 1px solid #ddd; border-radius: 3px; background: #f7f7f7; cursor: pointer; font-size: 11px; }
.idve-opacity-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.idve-opacity-label { font-size: 11px; color: #666; min-width: 46px; }
.idve-opacity-row input[type="range"] { flex: 1; }
.idve-opacity-value { font-size: 11px; color: #666; min-width: 32px; text-align: right; }

/* ── Tooltips ── */
.idve-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    position: relative;
    vertical-align: middle;
}
.idve-tooltip-trigger:hover { background: #0073aa; }
.idve-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
    width: 200px;
    padding: 8px 10px;
    border-radius: 4px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    z-index: 10;
    transition: visibility 0.15s, opacity 0.15s;
    pointer-events: none;
}
.idve-tooltip-text::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #333;
}
.idve-tooltip-trigger:hover .idve-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ── Iris Color Picker ── */
.idve-iris-field .wp-picker-container { width: 100%; }
.idve-iris-field .wp-picker-container .wp-color-result { margin: 0 0 6px; }
.idve-iris-field .wp-picker-input-wrap { display: flex; align-items: center; gap: 4px; }
.idve-iris-field .wp-picker-input-wrap input.wp-color-picker { width: 100% !important; }
.idve-iris-field .iris-picker { max-width: 100%; }
.idve-iris-field .wp-picker-holder { margin-bottom: 6px; }

/* ── Toggle ── */
.idve-toggle { display: flex; align-items: center; justify-content: space-between; }
.idve-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.idve-toggle-switch.active { background: #0073aa; }
.idve-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.idve-toggle-switch.active::after { transform: translateX(16px); }

/* ── Range ── */
.idve-range-field { display: flex; align-items: center; gap: 8px; }
.idve-range-field input[type="range"] { flex: 1; }
.idve-range-value { min-width: 40px; text-align: right; font-size: 12px; color: #666; }

/* ── Spacing (margin/padding) ── */
.idve-spacing-row {
    display: flex;
    gap: 6px;
}
.idve-spacing-cell {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}
.idve-spacing-label {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    min-width: 14px;
    text-align: center;
}
.idve-spacing-cell input {
    width: 100%;
    padding: 4px 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 12px;
}

/* ── Linked/Unlinked Spacing ── */
.idve-spacing-label-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 4px;
}
.idve-link-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f7f7f7;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    transition: all 0.15s;
    text-decoration: none;
}
.idve-link-toggle:hover { border-color: #0073aa; color: #0073aa; }
.idve-link-toggle.linked { background: #0073aa; color: #fff; border-color: #0073aa; }
.idve-spacing-simple { margin-bottom: 4px; }
.idve-spacing-simple input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 12px;
}

/* ── Border Field ── */
.idve-field-sublabel {
    font-size: 11px;
    color: #666;
    margin: 8px 0 4px;
}
.idve-field-sublabel:first-child,
.idve-field .idve-field-sublabel:first-of-type { margin-top: 4px; }
.idve-border-style-row {
    display: flex;
    gap: 12px;
    margin: 8px 0;
}
.idve-border-style-cell { flex: 0 0 120px; }
.idve-border-style-cell select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}
.idve-border-color-cell { flex: 1; }
.idve-border-color-cell .idve-color-field { gap: 4px; }
.idve-border-color-cell .idve-color-field input[type="color"] { width: 32px; height: 28px; }
.idve-border-color-cell .idve-color-field input[type="text"] { flex: 1; padding: 4px 6px; font-size: 12px; }

/* ── Image Field ── */
.idve-image-field { text-align: center; }
.idve-image-preview { max-width: 100%; max-height: 150px; border: 1px solid #ddd; border-radius: 3px; margin-bottom: 8px; }
.idve-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 3px;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
}
.idve-image-placeholder:hover { border-color: #0073aa; color: #0073aa; }

/* ── Rich Text Toolbar ── */
#idve-richtext-toolbar {
    position: absolute;
    z-index: 2000;
    display: flex;
    gap: 2px;
    padding: 4px 6px;
    background: #23282d;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#idve-richtext-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}
#idve-richtext-toolbar button:hover { background: rgba(255,255,255,0.15); }
#idve-richtext-toolbar button.active { background: rgba(255,255,255,0.25); }
.idve-toolbar-divider { width: 1px; background: rgba(255,255,255,0.2); margin: 2px 4px; }

/* ── Drag & Drop ── */
.idve-drag-handle { cursor: grab; color: #ccc; padding: 2px 4px; font-size: 16px; }
.idve-drag-handle:hover { color: #666; }
.idve-drag-handle:active { cursor: grabbing; }
.idve-dragging { opacity: 0.4; }
.idve-drop-indicator { height: 3px; background: #0073aa; border-radius: 2px; margin: 4px 0; }
.idve-drop-zone-active { outline: 2px dashed #0073aa; outline-offset: -2px; }

/* ── Modals ── */
.idve-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.idve-modal {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.idve-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}
.idve-modal-header h3 { margin: 0; font-size: 16px; }
.idve-modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: #666; }
.idve-modal-close:hover { color: #dc3232; }
.idve-modal-body { padding: 20px; }
.idve-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 20px; border-top: 1px solid #eee; }

/* ── Block Picker ── */
.idve-block-category { margin-bottom: 16px; }
.idve-block-category:last-child { margin-bottom: 0; }
.idve-block-category-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.idve-block-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.idve-block-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.idve-block-picker-item:hover { border-color: #0073aa; background: #f0f7fc; }
.idve-block-picker-item .dashicons { font-size: 24px; width: 24px; height: 24px; color: #0073aa; }
.idve-block-picker-item span { font-size: 12px; color: #23282d; }

/* ── Preset Picker ── */
.idve-preset-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.idve-preset-item { padding: 10px; border: 1px solid #eee; border-radius: 4px; cursor: pointer; transition: all 0.15s; }
.idve-preset-item:hover { border-color: #0073aa; background: #f0f7fc; }
.idve-preset-visual { display: flex; gap: 3px; height: 30px; margin-bottom: 6px; }
.idve-preset-col { background: #0073aa; border-radius: 2px; opacity: 0.3; }
.idve-preset-label { font-size: 11px; color: #666; text-align: center; }

/* ── Column Width Warning ── */
.idve-width-warning {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #fff8e5;
    border: 1px solid #ffb900;
    border-radius: 3px;
    font-size: 11px;
    color: #826200;
    margin-bottom: 8px;
}

/* ── Block Previews ── */
.idve-editor-block-content img { max-width: 100%; height: auto; }
.idve-editor-block-content .idve-preview-button {
    display: inline-block;
    padding: 8px 20px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}
.idve-editor-block-content .idve-preview-code {
    background: #f5f5f5;
    padding: 8px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    max-height: 80px;
    overflow: hidden;
    color: #666;
}
.idve-editor-block-content .idve-spacer-preview {
    background: repeating-linear-gradient(-45deg, transparent, transparent 5px, #f0f0f0 5px, #f0f0f0 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}
.idve-editor-block-content .idve-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 3px;
    color: #999;
}
.idve-editor-block-content [contenteditable="true"] {
    outline: none;
    border: 1px solid #0073aa;
    border-radius: 2px;
    padding: 4px;
    min-height: 20px;
}

/* ── Group Block ── */
.idve-editor-group-content {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 8px;
    margin: 4px 0;
    min-height: 40px;
    background: rgba(0,0,0,0.01);
}

/* ── Audio Field Preview ── */
.idve-audio-preview { padding: 8px; background: #f7f7f7; border-radius: 3px; margin-bottom: 6px; }

/* ── TinyMCE in modal ── */
.idve-richtext-field .wp-editor-wrap { border: 1px solid #ddd; border-radius: 3px; }
.idve-richtext-field .wp-editor-container { border: none; }
.idve-richtext-field .mce-toolbar-grp { background: #f7f7f7; border-bottom: 1px solid #eee; }
.idve-richtext-field .wp-switch-editor { font-size: 12px; height: auto; padding: 4px 10px; }
.idve-richtext-field .quicktags-toolbar { padding: 4px; background: #f7f7f7; border-bottom: 1px solid #eee; }

/* ── Settings modal scrollbar ── */
.idve-settings-modal-body::-webkit-scrollbar { width: 6px; }
.idve-settings-modal-body::-webkit-scrollbar-track { background: transparent; }
.idve-settings-modal-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.idve-settings-modal-body::-webkit-scrollbar-thumb:hover { background: #999; }

/* ── Global Styles Modal ── */
.idve-global-styles-modal { max-width: 900px; width: 95%; }
.idve-global-styles-modal .idve-modal-body { padding: 0; }
.idve-global-styles-modal .CodeMirror { min-height: 400px; height: calc(80vh - 160px); }

/* ── Class Browser ── */
.idve-browse-classes-btn { margin-top: 4px; font-size: 12px; padding: 3px 10px; }
.idve-class-browser-modal { max-width: 700px; width: 95%; }
.idve-class-browser-search { width: 100%; padding: 8px 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; box-sizing: border-box; }
.idve-class-browser-search:focus { border-color: #0073aa; box-shadow: 0 0 0 1px #0073aa; outline: none; }
.idve-class-browser-list { max-height: 400px; overflow-y: auto; }
.idve-class-browser-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid #eee; }
.idve-class-browser-item:last-child { border-bottom: none; }
.idve-class-browser-name { font-family: monospace; font-weight: 600; min-width: 120px; font-size: 13px; }
.idve-class-browser-props { flex: 1; font-size: 12px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idve-class-swatch { width: 16px; height: 16px; border-radius: 2px; border: 1px solid #ddd; flex-shrink: 0; }
.idve-class-insert-btn { flex-shrink: 0; font-size: 12px; padding: 3px 10px; }

/* ── Drift Warning Modal ── */
.idve-drift-modal { max-width: 480px; width: 90%; }
.idve-drift-modal .idve-modal-body p { margin: 0; font-size: 14px; line-height: 1.6; color: #23282d; }

/* ── AI Button ── */
.idve-btn-ai {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
}
.idve-btn-ai:hover { opacity: 0.9; }
.idve-btn-ai .dashicons { font-size: 16px; width: 16px; height: 16px; line-height: 16px; }

/* ── AI Modal ── */
.idve-ai-modal { max-width: 600px; width: 92%; }
.idve-ai-modal .idve-modal-body { display: flex; flex-direction: column; gap: 14px; }

/* ── AI Mode Selector ── */
.idve-ai-modes { display: flex; gap: 0; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.idve-ai-mode {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    background: #f7f7f7;
    border-right: 1px solid #ddd;
    transition: all 0.15s;
    text-align: center;
}
.idve-ai-mode:last-child { border-right: none; }
.idve-ai-mode:hover { background: #eee; }
.idve-ai-mode input { display: none; }
.idve-ai-mode:has(input:checked) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.idve-ai-mode-disabled { opacity: 0.4; cursor: not-allowed; }
.idve-ai-mode-disabled:hover { background: #f7f7f7; }

/* Mode description */
.idve-ai-mode-desc { margin: 0; font-size: 12px; color: #888; font-style: italic; }

/* ── AI Prompt ── */
#idve-ai-prompt {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
#idve-ai-prompt:focus { border-color: #667eea; box-shadow: 0 0 0 1px #667eea; outline: none; }
#idve-ai-prompt:disabled { background: #f5f5f5; }

/* ── AI Error ── */
.idve-ai-error {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    color: #991b1b;
    font-size: 13px;
}

/* ── AI Loading ── */
.idve-ai-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}
.idve-ai-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: idve-spin 0.8s linear infinite;
}
@keyframes idve-spin {
    to { transform: rotate(360deg); }
}

/* ── Block-level AI prompt bar (inside settings modal) ── */
.idve-ai-block-prompt {
    border-top: 1px solid #eee;
    padding: 12px 20px;
    background: #f9f9fb;
}
.idve-ai-block-prompt-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.idve-ai-block-prompt textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.idve-ai-block-prompt textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 1px #667eea;
}
.idve-ai-block-prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.idve-ai-block-error {
    color: #dc3232;
    font-size: 12px;
    padding: 4px 0;
}
.idve-ai-block-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

/* ── Settings modal footer AI button ── */
.idve-settings-ai-btn {
    margin-right: auto;
}

/* ── Icon Picker ── */
.idve-icon-preview {
    display: flex; align-items: center; justify-content: center;
    width: 60px; height: 60px; border: 1px solid #ddd; border-radius: 4px;
    margin-bottom: 8px; background: #f9f9f9;
}
.idve-icon-field .idve-btn { margin-top: 4px; }

.idve-icon-picker-modal { max-width: 700px; width: 95%; }
.idve-icon-search {
    width: 100%; padding: 8px 12px; margin-bottom: 12px;
    border: 1px solid #ddd; border-radius: 3px; font-size: 13px; box-sizing: border-box;
}
.idve-icon-search:focus { border-color: #0073aa; box-shadow: 0 0 0 1px #0073aa; outline: none; }
.idve-icon-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px;
    max-height: 400px; overflow-y: auto;
}
.idve-icon-picker-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 4px; border: 1px solid #eee; border-radius: 4px;
    cursor: pointer; transition: all 0.15s; text-align: center;
}
.idve-icon-picker-item:hover { border-color: #0073aa; background: #f0f7fc; }
.idve-icon-picker-item i { font-size: 20px; color: #333; }
.idve-icon-picker-item span { font-size: 10px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
