/**
 * SCORM Editor Styles
 * 3-panel layout: Lesson Tree | Block Editor | Live Preview
 */

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f3f4f6;
  --color-border: #e5e7eb;
  --color-text: #111827;
  --color-text-secondary: #6b7280;

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  --header-height: 60px;
  --footer-height: 32px;
  --sidebar-width: 280px;
  --preview-width: 400px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --radius-md: 0.375rem;
}

/* Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-sans); font-size: 14px; color: var(--color-text); background: var(--color-bg); overflow: hidden; }
body { display: flex; flex-direction: column; }

/* Header */
.editor-header { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); padding: 0 var(--spacing-lg); background: var(--color-bg); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-sm); flex-shrink: 0; }
.editor-header__logo { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); }
.editor-header__version { font-size: 0.75rem; font-weight: 400; color: #999; margin-left: 12px; }
.editor-header__center { flex: 1; margin: 0 var(--spacing-xl); text-align: center; }
.editor-header__title { font-size: 1.125rem; font-weight: 600; }
.editor-header__modified { color: var(--color-warning); font-size: 0.875rem; margin-left: var(--spacing-sm); }
.editor-header__right { display: flex; gap: var(--spacing-md); }
.editor-header__button { padding: var(--spacing-sm) var(--spacing-lg); border: none; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s; background: var(--color-primary); color: white; }
.editor-header__button:hover:not(:disabled) { background: var(--color-primary-hover); }
.editor-header__button:disabled { opacity: 0.5; cursor: not-allowed; }
.editor-header__button--primary { background: var(--color-success); }
.editor-header__button--primary:hover:not(:disabled) { background: #059669; }
.editor-header__button--secondary { background: var(--color-bg-tertiary); color: var(--color-text); }

.editor-header__button--success { background: #10B981; color: white; }
.editor-header__button--success:hover:not(:disabled) { background: #059669; }

/* Preview Panel Header */
.editor-preview__header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
}

.editor-preview__header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.editor-preview__header-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.editor-preview__course-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-preview__modified {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 600;
}

/* Preview Panel Buttons */
.editor-preview__button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-primary);
    color: white;
    white-space: nowrap;
}
.editor-preview__button:hover:not(:disabled) { background: var(--color-primary-hover); transform: translateY(-1px); }
.editor-preview__button:disabled { opacity: 0.5; cursor: not-allowed; }
.editor-preview__button--primary { background: var(--color-success); }
.editor-preview__button--primary:hover:not(:disabled) { background: #059669; }
.editor-preview__button--secondary { background: var(--color-bg-tertiary); color: var(--color-text); }
.editor-preview__button--success { background: #10B981; color: white; }
.editor-preview__button--success:hover:not(:disabled) { background: #059669; }

/* Main Layout: 3-panel resizable */
.editor-main {
    display: flex;
    flex-direction: row;  /* Explicit row direction */
    flex: 1;
    overflow: hidden;
    position: relative;  /* Ensure positioning context */
}

/* Resize handles */
.resize-handle {
    width: 6px;
    height: 100%;
    background: var(--color-border);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s;
    z-index: 10;
    min-width: 6px;
    max-width: 6px;
    display: flex !important;
}
.resize-handle:hover,
.resize-handle.dragging {
    background: var(--color-primary);
}
.resize-handle[data-resize="left"] {
    order: 2;  /* Between editor-content (1) and editor-sidebar (3) */
}
.resize-handle[data-resize="right"] {
    order: 4;  /* Between editor-sidebar (3) and editor-preview (5) */
}

/* Center Panel: Course Structure */
.editor-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary);
    overflow: hidden;
    width: 350px;  /* Default width, overridden by JS */
    min-width: 250px;
    max-width: 600px;
    order: 3 !important;
    flex-shrink: 0;
    flex-grow: 0;  /* Don't grow */
    flex-basis: auto;  /* Use width */
}
.editor-sidebar__header { padding: var(--spacing-md) var(--spacing-lg); border-bottom: 1px solid var(--color-border); background: var(--color-bg); display: flex; justify-content: space-between; align-items: center; min-height: 56px; }
.editor-sidebar__header h3 { font-size: 1rem; font-weight: 600; color: var(--color-text); }
.editor-sidebar__count { font-size: 0.75rem; color: var(--color-text-secondary); }
.editor-sidebar__tree { flex: 1; overflow-y: auto; padding: var(--spacing-sm); }
.editor-sidebar__welcome { padding: var(--spacing-xl); text-align: center; color: var(--color-text-secondary); }

/* Homepage Button (Bug #2 fix) */
.launchpage-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.launchpage-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.launchpage-button svg {
    flex-shrink: 0;
}

/* Lesson Tree Items */
.lesson-item { margin-bottom: var(--spacing-sm); }
.lesson-item__header { padding: var(--spacing-sm) var(--spacing-md); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; }
.lesson-item__header:hover { background: var(--color-bg-tertiary); }
.lesson-item__header.expanded { background: var(--color-bg-tertiary); }
.lesson-item__blocks { margin-top: var(--spacing-xs); padding-left: var(--spacing-md); display: none; }
.lesson-item__blocks.visible { display: block; }
.block-item { padding: var(--spacing-md); margin-bottom: var(--spacing-xs); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; font-size: 0.875rem; transition: all 0.2s; display: flex; align-items: flex-start; gap: var(--spacing-sm); }
.block-item:hover { background: var(--color-bg-tertiary); }
.block-item.selected { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.block-item--lesson-title { background: var(--color-bg-tertiary, #fafafa); border-color: var(--color-primary); border-left-width: 3px; }
.block-item--lesson-title:hover { background: #f0f0f0; }
.block-item--lesson-title.selected { background: var(--color-primary); color: white; }
.block-item__drag-handle { cursor: grab; opacity: 0.4; font-size: 1rem; user-select: none; padding: 0 var(--spacing-xs); transition: opacity 0.2s; flex-shrink: 0; }
.block-item__drag-handle:hover { opacity: 0.8; }
.block-item__drag-handle:active { cursor: grabbing; }
.block-item__icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1; opacity: 0.8; }
.block-item.selected .block-item__icon { opacity: 1; }
.block-item__content { flex: 1; display: flex; flex-direction: column; gap: var(--spacing-xs); min-width: 0; }
.block-item__header { display: flex; justify-content: space-between; align-items: center; }
.block-item__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-item__number { font-size: 0.75rem; opacity: 0.7; margin-left: var(--spacing-sm); flex-shrink: 0; }
.block-item__meta { display: flex; flex-direction: column; gap: 2px; font-size: 0.75rem; }
.block-item__category { color: var(--color-primary); font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em; }
.block-item.selected .block-item__category { color: rgba(255, 255, 255, 0.9); }
.block-item__preview { color: var(--color-text-secondary); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.block-item.selected .block-item__preview { color: rgba(255, 255, 255, 0.8); }
.block-item__actions { display: flex; gap: var(--spacing-xs); flex-shrink: 0; margin-top: 2px; }
.block-item__action { background: transparent; border: none; cursor: pointer; padding: var(--spacing-xs); border-radius: var(--radius-sm); opacity: 0.6; transition: all 0.2s; font-size: 0.875rem; }
.block-item__action:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
.block-item.selected .block-item__action:hover { background: rgba(255, 255, 255, 0.2); }
.block-item__action--delete:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.block-item.selected .block-item__action--delete:hover { background: rgba(239, 68, 68, 0.2); color: #fee2e2; }

/* Sortable states */
.block-item--ghost { opacity: 0.4; }
.block-item--chosen { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.block-item--drag { transform: rotate(2deg); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); }

/* Visible block highlight (scroll sync) - REMOVED per user request */

/* Block separator (insert between blocks) */
.block-separator {
    position: relative;
    height: 8px;
    margin: var(--spacing-xs) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.block-separator:hover {
    opacity: 1;
}
.block-separator__button {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: 2px solid var(--color-bg-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.block-separator__button:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: var(--color-primary-hover);
}

/* Block insert button */
.block-insert-button { width: 100%; padding: var(--spacing-sm); margin-top: var(--spacing-sm); background: transparent; border: 2px dashed var(--color-border); border-radius: var(--radius-md); color: var(--color-text-secondary); cursor: pointer; font-size: 0.875rem; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: var(--spacing-xs); }
.block-insert-button:hover { background: var(--color-bg-tertiary); border-color: var(--color-primary); color: var(--color-primary); }

/* Left Panel: Block Editor */
.editor-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg);
    width: 450px;
    min-width: 300px;
    max-width: 800px;
    order: 1 !important;
    flex-shrink: 0;
}
.editor-content__header { padding: var(--spacing-md) var(--spacing-lg); border-bottom: 1px solid var(--color-border); background: var(--color-bg); display: flex; justify-content: space-between; align-items: center; min-height: 56px; }
.editor-content__header h3 { font-size: 1rem; font-weight: 600; color: var(--color-text); }
.editor-content__type { font-size: 0.75rem; padding: var(--spacing-xs) var(--spacing-sm); background: var(--color-bg-tertiary); border-radius: var(--radius-md); color: var(--color-text-secondary); font-family: var(--font-mono); }
.editor-content__editor { flex: 1; overflow-y: auto; padding: var(--spacing-lg); }
.editor-content__welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--color-text-secondary); text-align: center; }
.editor-content__icon { font-size: 3rem; margin-bottom: var(--spacing-md); opacity: 0.5; }

/* Parameter Forms */
.param-form { max-width: 600px; }
.param-group { margin-bottom: var(--spacing-lg); }
.param-label { display: block; font-weight: 600; margin-bottom: var(--spacing-sm); font-size: 0.875rem; }
.param-input, .param-textarea, .param-select { width: 100%; padding: var(--spacing-sm) var(--spacing-md); border: 1px solid var(--color-border); border-radius: var(--radius-md); font-family: inherit; font-size: 0.875rem; transition: all 0.2s; }
.param-input:focus, .param-textarea:focus, .param-select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.param-textarea { resize: vertical; min-height: 80px; font-family: var(--font-mono); }
.param-checkbox { margin-right: var(--spacing-sm); }
.param-help { font-size: 0.75rem; color: var(--color-text-secondary); margin-top: var(--spacing-xs); }

/* Block Viewer */
.block-viewer { max-width: 800px; }
.block-viewer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-border);
}
.block-viewer__header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}
.block-viewer__edit-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.block-viewer__edit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}
.block-viewer__params { }

/* Parameter Display Values */
.param-value {
    padding: var(--spacing-md);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.6;
}
.param-empty {
    color: var(--color-text-secondary);
    font-style: italic;
}
.param-boolean {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.param-html {
    color: var(--color-text);
    word-wrap: break-word;
}
.param-text {
    color: var(--color-text);
}
.param-code {
    display: block;
    padding: var(--spacing-sm);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    overflow-x: auto;
}

/* Parameter Tables and Lists */
.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.param-table td {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}
.param-list {
    margin: 0;
    padding-left: var(--spacing-lg);
    list-style: disc;
}
.param-list li {
    margin-bottom: var(--spacing-xs);
}

/* Block Editor (Edit Mode) */
.block-editor { max-width: 800px; }
.block-editor__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-border);
}
.block-editor__header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}
.block-editor__actions {
    display: flex;
    gap: var(--spacing-sm);
}
.block-editor__btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}
.block-editor__btn--primary {
    background: var(--color-success);
    color: white;
}
.block-editor__btn--primary:hover {
    background: #059669;
    transform: translateY(-1px);
}
.block-editor__btn--secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.block-editor__btn--secondary:hover {
    background: var(--color-bg-secondary);
}
.block-editor__form { }

/* Enhanced Parameter Inputs */
.param-textarea--html {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.5;
}
.param-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-sm);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}
.param-checkbox-label:hover {
    background: var(--color-bg-tertiary);
}

/* Array Editor */
.param-array { }
.array-editor {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.array-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}
.array-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}
.array-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.array-remove {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.array-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}
.array-add {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: var(--spacing-xs);
}
.array-add:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Table Rows Editor */
.table-rows-editor {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.table-row-edit {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.table-row-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.table-cell-input {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    background: var(--color-bg);
}
.table-cell-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Right Panel: Live Preview */
.editor-preview {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary);
    overflow: hidden;
    flex: 1 1 auto !important;  /* Grow to fill available space */
    min-width: 400px;
    order: 5 !important;
    width: auto !important;  /* Override any inline styles */
}
.editor-preview__header { padding: var(--spacing-md); border-bottom: 1px solid var(--color-border); background: var(--color-bg); display: flex; justify-content: space-between; align-items: center; }
.editor-preview__header h3 { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; color: var(--color-text-secondary); }
.preview-updating-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.editor-preview__refresh { padding: var(--spacing-xs) var(--spacing-md); border: 1px solid var(--color-border); background: var(--color-bg); border-radius: var(--radius-md); font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.editor-preview__refresh:hover:not(:disabled) { background: var(--color-bg-tertiary); }
.editor-preview__refresh:disabled { opacity: 0.5; cursor: not-allowed; }
.editor-preview__container { flex: 1; position: relative; overflow: hidden; }
.editor-preview__frame { width: 100%; height: 100%; border: none; background: white; }
.editor-preview__welcome { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--color-text-secondary); pointer-events: none; }
.editor-preview__icon { font-size: 3rem; opacity: 0.3; margin-bottom: var(--spacing-md); }
.editor-preview__actions { display: flex; gap: var(--spacing-sm); align-items: center; }
.editor-preview__expand {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.editor-preview__expand:hover:not(:disabled) {
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary);
}
.editor-preview__expand:disabled { opacity: 0.5; cursor: not-allowed; }
.editor-preview__expand svg { display: block; transition: transform 0.3s ease; }

/* Expanded Preview State */
.editor-main.preview-expanded .editor-sidebar,
.editor-main.preview-expanded .editor-content,
.editor-main.preview-expanded .resize-handle {
    display: none !important;
}
.editor-main.preview-expanded .editor-preview {
    width: 100% !important;
    max-width: none !important;
    min-width: unset !important;
    flex: 1 !important;
}
.editor-main.preview-expanded .editor-preview__expand svg {
    transform: rotate(180deg);
}

/* Footer */
.editor-footer { display: flex; justify-content: space-between; align-items: center; height: var(--footer-height); padding: 0 var(--spacing-lg); background: var(--color-bg-tertiary); border-top: 1px solid var(--color-border); font-size: 0.75rem; color: var(--color-text-secondary); flex-shrink: 0; }
.editor-footer__stat { margin-left: var(--spacing-md); }

/* Loading Overlay */
.loading-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10000; }
.loading-overlay__spinner { width: 40px; height: 40px; border: 3px solid rgba(255, 255, 255, 0.3); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay__text { color: white; margin-top: var(--spacing-md); font-size: 0.875rem; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.modal__content { position: relative; background: white; border-radius: var(--radius-md); padding: var(--spacing-xl); min-width: 400px; max-width: 90vw; box-shadow: var(--shadow-md); }
.modal__title { font-size: 1.25rem; font-weight: 700; margin-bottom: var(--spacing-md); }
.modal__message { color: var(--color-text-secondary); margin-bottom: var(--spacing-lg); }
.modal__button { padding: var(--spacing-sm) var(--spacing-xl); background: var(--color-primary); color: white; border: none; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; transition: all 0.2s; }
.modal__button:hover { background: var(--color-primary-hover); }
.modal__progress { height: 8px; background: var(--color-bg-tertiary); border-radius: 999px; overflow: hidden; margin: var(--spacing-md) 0; }
.modal__progress-bar { height: 100%; background: var(--color-primary); transition: width 0.3s; }

/* Block Selector Modal */
.modal__content--large { min-width: 600px; max-width: 800px; }
.modal__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--spacing-lg); }
.modal__close { background: transparent; border: none; font-size: 1.5rem; color: var(--color-text-secondary); cursor: pointer; padding: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: all 0.2s; }
.modal__close:hover { background: var(--color-bg-tertiary); color: var(--color-text); }

.block-selector { display: flex; flex-direction: column; gap: var(--spacing-lg); max-height: 60vh; overflow-y: auto; }
.block-selector__category { border-bottom: 1px solid var(--color-border); padding-bottom: var(--spacing-md); }
.block-selector__category:last-child { border-bottom: none; }
.block-selector__category-title { font-size: 0.875rem; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-sm); }
.block-selector__types { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--spacing-sm); }
.block-selector__type { padding: var(--spacing-md); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; font-size: 0.875rem; text-align: center; }
.block-selector__type:hover { background: var(--color-bg-tertiary); border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }

/* ===============================================
   Parameter Editor - Dynamic Form Generator
   =============================================== */
.parameter-editor {
  padding: var(--spacing-lg);
  height: 100%;
  overflow-y: auto;
}

.parameter-editor__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.parameter-editor__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}

.parameter-editor__edit-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.parameter-editor__edit-btn:hover {
  background: var(--color-primary-hover);
}

/* Conversion Section */
.conversion-section {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.conversion-section__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
}

.conversion-section__controls {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.conversion-section__select {
  flex: 1;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
}

.conversion-section__select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.conversion-section__btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.conversion-section__btn:hover {
  background: var(--color-primary-dark);
}

.conversion-section__btn:active {
  transform: translateY(1px);
}

.parameter-editor__form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.parameter-editor__field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.parameter-editor__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.parameter-editor__input,
.parameter-editor__textarea {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s;
}

.parameter-editor__input:focus,
.parameter-editor__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.parameter-editor__input[readonly] {
  background: var(--color-bg-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* HTML Preview (before WYSIWYG) */
.html-preview {
  min-height: 40px;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  background: white;
  font-size: 0.875rem;
  line-height: 1.6;
  cursor: pointer;
  transition: all 0.2s;
}

.html-preview:hover {
  background: #f0f9ff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.html-preview:empty:before {
  content: 'Empty content';
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Rendered HTML content inside preview */
.html-preview p {
  margin: 0.5em 0;
}

.html-preview p:first-child {
  margin-top: 0;
}

.html-preview p:last-child {
  margin-bottom: 0;
}

.html-preview strong {
  font-weight: 600;
}

.html-preview em {
  font-style: italic;
}

.html-preview ul,
.html-preview ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.html-preview li {
  margin: 0.25em 0;
}

.parameter-editor__textarea {
  min-height: 80px;
  resize: vertical;
}

.parameter-editor__checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.parameter-editor__checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.parameter-editor__hint {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

.parameter-editor__fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.parameter-editor__legend {
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0 var(--spacing-sm);
}

/* Array Fields */
.parameter-editor__array {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
}

.parameter-editor__array-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.parameter-editor__array-count {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.parameter-editor__array-add {
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.parameter-editor__array-add:hover {
  background: var(--color-primary-hover);
}

.parameter-editor__array-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.parameter-editor__array-item {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.parameter-editor__array-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.parameter-editor__array-item-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.parameter-editor__array-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.parameter-editor__array-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Action Buttons */
.parameter-editor__actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.parameter-editor__action-btn {
  padding: var(--spacing-sm) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.parameter-editor__action-btn--cancel {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.parameter-editor__action-btn--cancel:hover {
  background: var(--color-bg-secondary);
}

.parameter-editor__action-btn--save {
  background: var(--color-primary);
  color: white;
}

.parameter-editor__action-btn--save:hover {
  background: var(--color-primary-hover);
}

/* Image Upload Field */
.parameter-editor__image-field { display: flex; flex-direction: column; gap: var(--spacing-md); }
.parameter-editor__image-preview { width: 100%; height: 200px; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; background: var(--color-bg); display: flex; align-items: center; justify-content: center; }
.parameter-editor__image-preview-img { width: 100%; height: 100%; object-fit: contain; }
.parameter-editor__image-preview-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--spacing-sm); color: var(--color-text-secondary); font-size: 0.875rem; }
.parameter-editor__image-preview-placeholder span:first-child { font-size: 2rem; }
.parameter-editor__image-actions { display: flex; gap: var(--spacing-sm); align-items: center; }
.parameter-editor__input--file-path { flex: 1; cursor: default; }
.parameter-editor__file-upload-btn { padding: var(--spacing-sm) var(--spacing-md); background: var(--color-primary); color: white; border: none; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.parameter-editor__file-upload-btn:hover { background: var(--color-primary-hover); }
.parameter-editor__file-clear-btn { padding: var(--spacing-sm) var(--spacing-md); background: transparent; color: #ef4444; border: 1px solid #ef4444; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.parameter-editor__file-clear-btn:hover { background: rgba(239, 68, 68, 0.1); }
.parameter-editor__file-clear-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===============================================
   Table Editor - Inline Spreadsheet
   =============================================== */
.table-editor {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
}

.table-editor__toolbar {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.table-editor__btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.table-editor__btn:hover {
  background: var(--color-primary-hover);
}

.table-editor__scroll {
  overflow: auto;
  max-height: 600px;
  background: white;
}

.table-editor__table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  table-layout: fixed;
}

.table-editor__table th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 0;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 2;
  min-width: 150px;
  height: 45px;
}

.table-editor__table td {
  border: 1px solid #dee2e6;
  padding: 0;
  vertical-align: top;
  position: relative;
  background: white;
  min-width: 150px;
  height: 40px;
}

.table-editor__header-input {
  width: 100%;
  padding: var(--spacing-sm);
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.875rem;
  outline: none;
  box-sizing: border-box;
}

.table-editor__header-input:focus {
  background: #fff3cd;
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.table-editor__cell-input {
  width: 100%;
  min-width: 150px;
  padding: var(--spacing-sm);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  resize: none;
  outline: none;
  overflow: hidden;
  box-sizing: border-box;
  line-height: 1.4;
}

.table-editor__cell-input:focus {
  background: #fffbeb;
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.table-editor__cell-preview {
  width: 100%;
  min-width: 150px;
  padding: var(--spacing-sm);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s;
}

.table-editor__cell-preview:hover {
  background: #f0f9ff;
}

.table-editor__cell-preview strong {
  font-weight: 600;
}

.table-editor__cell-preview em {
  font-style: italic;
}

.table-editor__delete-col {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}

.table-editor__table th:hover .table-editor__delete-col {
  opacity: 1;
}

.table-editor__delete-col:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.table-editor__row-actions {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  text-align: center;
  width: 50px;
  min-width: 50px;
  padding: 4px;
}

.table-editor__delete-row {
  width: 28px;
  height: 28px;
  padding: 0;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.table-editor__delete-row:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* ===============================================
   Comparison Table Editor
   =============================================== */
.comparison-table-editor {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.comparison-table-editor__section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background: var(--color-bg-tertiary, #fafafa);
}

.comparison-table-editor__section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.comparison-table-editor__section-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.comparison-table-editor__btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.comparison-table-editor__btn:hover {
  background: var(--color-primary-dark, #7c3aed);
}

/* Columns Section */
.comparison-table-editor__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.comparison-table-editor__column {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
}

.comparison-table-editor__column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}

.comparison-table-editor__column-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.comparison-table-editor__column-fields {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.comparison-table-editor__input {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.comparison-table-editor__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.comparison-table-editor__input--subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.comparison-table-editor__checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
  cursor: pointer;
}

.comparison-table-editor__checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Features Section */
.comparison-table-editor__features {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.comparison-table-editor__feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.comparison-table-editor__input--feature-name {
  flex: 1;
  min-width: 150px;
  font-weight: 500;
}

.comparison-table-editor__feature-values {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
  flex-shrink: 0;
}

.comparison-table-editor__input--value {
  width: 100px;
  text-align: center;
  font-size: 0.8125rem;
}

.comparison-table-editor__value-cell {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparison-table-editor__value-cell--boolean {
  font-size: 1.25rem;
  cursor: pointer;
}

.comparison-table-editor__value-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-right: var(--spacing-xs);
}

.comparison-table-editor__value-preview {
  width: 200px;
  min-height: 40px;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.4;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}

.comparison-table-editor__value-preview:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-tertiary, #fafafa);
}

.comparison-table-editor__value-preview strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

.comparison-table-editor__value-preview em {
  font-style: italic;
}

.comparison-table-editor__delete-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
}

.comparison-table-editor__delete-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ===============================================
   WYSIWYG Editor - Rich Text Editing
   =============================================== */
.wysiwyg-container { width: 100%; }
.wysiwyg-editor { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; background: white; }
.wysiwyg-toolbar { display: flex; align-items: center; gap: var(--spacing-xs); padding: var(--spacing-sm); background: var(--color-bg-secondary); border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.wysiwyg-btn { padding: var(--spacing-xs) var(--spacing-sm); background: white; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 0.875rem; cursor: pointer; transition: all 0.2s; }
.wysiwyg-btn:hover { background: var(--color-bg-secondary); border-color: var(--color-primary); }
.wysiwyg-btn:active { background: var(--color-primary); color: white; }
.wysiwyg-separator { width: 1px; height: 20px; background: var(--color-border); margin: 0 var(--spacing-xs); }
.wysiwyg-content { min-height: 150px; max-height: 400px; padding: var(--spacing-md); font-family: inherit; font-size: 0.9375rem; line-height: 1.6; overflow-y: auto; outline: none; }
.wysiwyg-content:empty:before { content: attr(data-placeholder); color: #9ca3af; }
.wysiwyg-content:focus { background: #fffbeb; }
.wysiwyg-content p { margin: 0 0 0.5em 0; }
.wysiwyg-content p:last-child { margin-bottom: 0; }
.wysiwyg-content strong { font-weight: 600; }
.wysiwyg-content em { font-style: italic; }
.wysiwyg-content ul, .wysiwyg-content ol { margin: 0.5em 0; padding-left: 1.5em; }
.wysiwyg-content li { margin: 0.25em 0; }
.wysiwyg-source { width: 100%; min-height: 200px; padding: var(--spacing-md); font-family: 'Courier New', monospace; font-size: 0.875rem; border: none; resize: vertical; outline: none; }

/* ===============================================
   Parameter Viewer - Accordion Items Display
   =============================================== */
.param-accordion-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.param-accordion-item {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
}

.param-accordion-item__number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.param-accordion-item__content {
  flex: 1;
  min-width: 0;
}

.param-accordion-item__content strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-primary);
  font-weight: 600;
}

.param-accordion-item__body {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ===============================================
   Parameter Viewer - Footnotes Display
   =============================================== */
.param-footnotes {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.param-footnote-item {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.param-footnote-number {
  flex-shrink: 0;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.param-footnote-content {
  flex: 1;
  min-width: 0;
}

.param-footnote-content strong {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 0.9375rem;
}

.param-footnote-url {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

/* Icon List Items */
.param-icon-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.param-icon-list-item {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.param-icon-list-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.param-icon-list-content {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  line-height: 1.5;
}

/* Comparison Table Columns */
.param-comparison-columns {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.param-comparison-column {
  flex: 1;
  min-width: 120px;
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  position: relative;
}

.param-comparison-column--highlighted {
  background: var(--color-primary-light, #f0e6ff);
  border-color: var(--color-primary);
}

.param-comparison-column__title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.param-comparison-column__subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.param-comparison-column__badge {
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  color: var(--color-primary);
  font-size: 1rem;
}

/* Comparison Table Features (Read-only) */
.param-comparison-features {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.param-comparison-feature {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
}

.param-comparison-feature__name {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  font-weight: 600;
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}

.param-comparison-feature__values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-sm);
}

.param-comparison-value {
  padding: var(--spacing-sm);
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.param-comparison-value strong {
  font-weight: 600;
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--color-primary);
}

.param-comparison-value--true {
  color: var(--color-success, #22c55e);
  font-weight: 600;
}

.param-comparison-value--false {
  color: var(--color-error, #ef4444);
}

/* Timeline Events */
.param-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.param-timeline-event {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
}

.param-timeline-date {
  flex-shrink: 0;
  min-width: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
}

.param-timeline-content {
  flex: 1;
  min-width: 0;
}

.param-timeline-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.param-timeline-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Labeled Graphic Markers */
.param-markers {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.param-marker-item {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.param-marker-label {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.param-marker-content {
  flex: 1;
  min-width: 0;
}

.param-marker-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.param-marker-desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* Image Carousel Items */
.param-carousel-images {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.param-carousel-image {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.param-carousel-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.75rem;
}

.param-carousel-content {
  flex: 1;
  min-width: 0;
}

.param-carousel-src {
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  word-break: break-all;
}

.param-carousel-caption {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  line-height: 1.4;
}

/* Course Metadata Section */
.course-metadata {
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-md);
}

.course-metadata__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

.course-metadata__textarea {
  width: 100%;
  padding: var(--spacing-sm);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  resize: vertical;
  min-height: 60px;
  margin-bottom: var(--spacing-sm);
}

.course-metadata__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.course-metadata__button {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.course-metadata__button:hover {
  background: var(--color-primary-hover);
}

.course-metadata__button:active {
  transform: translateY(1px);
}

/* Language Switcher */
.language-switcher {
  position: relative;
  display: inline-block;
}

.language-switcher__button {
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.language-switcher__button:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-primary);
}

.language-switcher__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 150px;
  z-index: 10000;
}

.language-option {
  padding: 0.625rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-option:first-child {
  border-radius: 0.375rem 0.375rem 0 0;
}

.language-option:last-child {
  border-radius: 0 0 0.375rem 0.375rem;
}

.language-option:hover {
  background: var(--color-bg-secondary);
}

.language-option.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

/* Gallery Picker Button */
.parameter-editor__file-gallery-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.parameter-editor__file-gallery-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.parameter-editor__file-gallery-btn:active {
  transform: translateY(0);
}
