/**
 * Lesson Editor Styles
 */

/* Editor Layout */
.lesson-editor {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    background: white;
    border-bottom: 1px solid var(--color-smoke-white);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-lg);
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.editor-title h2 {
    margin: 0;
    font-size: var(--text-xl);
}

.editor-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.editor-layout {
    display: flex;
    gap: var(--space-5);
    flex: 1;
    overflow: hidden;
}

/* Steps Panel */
.steps-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.steps-header h3 {
    margin: 0;
}

.steps-list {
    flex: 1;
    overflow-y: auto;
    padding-right: var(--space-2);
}

/* Step Card */
.step-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: white;
    border: 2px solid var(--color-smoke-white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all 0.15s ease;
}

.step-card:hover {
    border-color: var(--color-offset-blue);
    box-shadow: var(--shadow-md);
}

.step-card.selected {
    border-color: var(--color-auburn-orange);
    background: #fff8f5;
}

.step-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.step-placeholder {
    border: 2px dashed var(--color-auburn-orange);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    background: #fff8f5;
}

.step-drag-handle {
    cursor: grab;
    color: var(--color-light-text);
    padding: var(--space-2);
    margin: calc(var(--space-2) * -1);
}

.step-drag-handle:active {
    cursor: grabbing;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--color-auburn-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.step-info {
    flex: 1;
    min-width: 0;
}

.step-type {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.step-icon {
    font-size: 18px;
}

.step-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-actions {
    display: flex;
    gap: var(--space-1);
}

/* Preview Panel - removed, using modal instead */
.preview-panel {
    width: 400px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-smoke-white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-smoke-white);
}

.preview-header h3 {
    margin: 0;
}

.preview-content {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

/* Preview Content */
.step-preview .preview-type {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.preview-points {
    margin-left: auto;
    color: var(--color-light-text);
    font-size: var(--text-sm);
}

.preview-title {
    margin: 0 0 var(--space-3);
}

.preview-image {
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    margin-bottom: var(--space-3);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
}

.preview-content-text {
    margin-bottom: var(--space-3);
    line-height: 1.6;
}

/* Preview Options */
.preview-options {
    margin-bottom: var(--space-3);
}

.preview-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.preview-option.correct {
    background: var(--color-success-light);
}

.option-letter {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
}

.option-check {
    margin-left: auto;
    color: var(--color-success);
    font-weight: bold;
}

/* Preview True/False */
.preview-tf {
    display: flex;
    gap: var(--space-3);
}

.tf-option {
    flex: 1;
    padding: var(--space-3);
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
}

.tf-option.correct {
    background: var(--color-success-light);
}

/* Preview Matching */
.matching-pair {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.match-left, .match-right {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
}

.match-arrow {
    color: var(--color-light-text);
}

/* Preview Ordering */
.ordering-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.order-num {
    width: 24px;
    height: 24px;
    background: var(--color-auburn-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
}

/* Step Type Selector */
.step-type-selector {
    max-height: 60vh;
    overflow-y: auto;
}

.type-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-smoke-white);
    padding-bottom: var(--space-2);
}

.type-tab {
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--color-light-text);
    transition: all 0.15s;
}

.type-tab:hover {
    background: var(--color-smoke-white);
}

.type-tab.active {
    background: var(--color-auburn-blue);
    color: white;
}

.type-category {
    display: none;
}

.type-category.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.type-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3);
    background: white;
    border: 2px solid var(--color-smoke-white);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.type-option:hover {
    border-color: var(--color-auburn-orange);
    background: #fff8f5;
}

.type-icon {
    font-size: 24px;
    margin-bottom: var(--space-2);
}

.type-label {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.type-desc {
    font-size: var(--text-sm);
    color: var(--color-light-text);
}

/* Step Form */
.step-form-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.step-form-header .step-icon {
    font-size: 24px;
}

/* Image Upload - Compact */
.image-upload-compact {
    padding: 8px 0;
}

.image-thumb {
    width: 80px;
    height: 45px;
    background: var(--color-smoke-white);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumb svg {
    width: 24px;
    height: 24px;
    color: var(--color-light-text);
}

/* Options Form */
.options-list, .matching-list, .ordering-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.option-row, .matching-row, .ordering-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.option-correct {
    flex-shrink: 0;
}

.option-letter, .order-num {
    width: 28px;
    height: 28px;
    background: var(--color-auburn-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.option-text, .match-left, .match-right, .order-item {
    flex: 1;
}

.match-arrow {
    flex-shrink: 0;
    color: var(--color-light-text);
}

/* True/False Buttons */
.tf-buttons {
    display: flex;
    gap: var(--space-3);
}

.tf-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-smoke-white);
    border: 2px solid var(--color-smoke-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.tf-btn:hover {
    border-color: var(--color-offset-blue);
}

.tf-btn.selected {
    background: var(--color-success-light);
    border-color: var(--color-success);
}

.tf-btn input {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-layout {
        flex-direction: column;
    }
    
    .preview-panel {
        width: 100%;
        max-height: 300px;
    }
    
    .type-category.active {
        grid-template-columns: 1fr;
    }
}
/* ============================================
   STANDARDS LIST - LESSON EDITOR
   ============================================ */

.standards-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.standard-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.standard-row:last-child {
    border-bottom: none;
}

.standard-row:hover {
    background: #f8f9fa;
}

.standard-row.selected {
    background: #e8f4e8;
}

.standard-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.standard-code {
    font-size: 11px;
    color: #888;
    font-weight: 500;
}

.standard-title {
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.standard-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-xs {
    padding: 4px 6px;
}

/* Settings Section */
.settings-section {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: left;
    transition: background 0.15s;
}

.settings-toggle:hover {
    background: #eee;
}

.settings-content {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
}

/* Suggest Standards */
.suggest-result {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.suggest-result:hover {
    border-color: var(--color-primary);
    background: #f8f9fa;
}

.suggest-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.suggest-result-header strong {
    font-size: 13px;
}

.suggest-score {
    background: var(--color-primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.suggest-result-title {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
}

.suggest-result-keywords {
    font-size: 12px;
}

.keyword-tag {
    display: inline-block;
    background: #e8f4e8;
    color: #2d6a2d;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
    font-size: 11px;
}

/* ============================================
   SUGGEST STANDARDS OVERLAY
   ============================================ */

.suggest-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001; /* Above the modal */
}

.suggest-overlay-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.suggest-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.suggest-overlay-header h3 {
    margin: 0;
    font-size: 18px;
}

.suggest-overlay-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Suggest Results in Overlay */
.suggest-result {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: all 0.15s;
}

.suggest-result:hover {
    border-color: var(--color-primary);
    background: #f8f9fa;
}

.suggest-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.suggest-result-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggest-code {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.suggest-score {
    background: var(--color-primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
}

.suggest-actions {
    display: flex;
    gap: 4px;
}

.suggest-result-title {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 6px;
}

.suggest-result-keywords {
    font-size: 11px;
}

/* Standard Preview Popup */
.standard-preview-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 10002;
}

.standard-preview-popup-content {
    /* Content styling */
}

/* ============================================
   SELECTED STANDARDS DISPLAY
   ============================================ */

.selected-standards-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    border: 1px solid #e0e0e0;
}

.selected-standard-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border: 1px solid var(--color-auburn-blue);
    border-radius: 20px;
    font-size: 13px;
}

.selected-standard-tag .standard-code {
    font-weight: 600;
    color: var(--color-auburn-blue);
}

.selected-standard-tag .standard-desc {
    color: #666;
    font-size: 12px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon-tiny {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-icon-tiny:hover {
    background: #f0f0f0;
    color: var(--color-auburn-blue);
}

.btn-icon-tiny.btn-remove:hover {
    background: #fee;
    color: var(--color-danger);
}

/* ===== FLASHCARD EDITOR STYLES ===== */
.flashcard-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.flashcard-row {
    background: var(--color-smoke-white);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}

.flashcard-row:hover {
    border-color: var(--color-auburn-blue);
}

.flashcard-term {
    font-size: 15px;
}

.flashcard-definition {
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.image-upload-row {
    margin-top: 4px;
}

.flashcard-image-preview {
    border: 1px solid var(--color-border);
}

/* Preview flashcards */
.preview-flashcards {
    margin-top: 16px;
}

.preview-flashcard {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px;
    min-width: 160px;
    max-width: 220px;
    flex: 1;
}

.preview-flashcard-term {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-auburn-blue);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.preview-flashcard-definition {
    font-size: 13px;
    color: var(--color-text);
}

/* ============================================
   ADVANCED STEP EDITOR
   ============================================ */
.code-editor {
    font-family: 'Courier New', Consolas, monospace !important;
    font-size: 13px !important;
    line-height: 1.5;
    tab-size: 2;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: var(--radius-md);
    padding: var(--space-3);
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.code-editor:focus {
    outline: 2px solid var(--color-auburn-orange);
    outline-offset: -2px;
}

.code-editor::placeholder {
    color: #6a6a6a;
}

/* ============================================
   MATCHING BINS EDITOR
   ============================================ */
.bins-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.bin-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.bin-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bin-name {
    flex: 1;
}

.bin-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.bin-item-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.bin-item-text {
    flex: 1;
}

.bin-item-select {
    flex-shrink: 0;
}

