/* =================================================================
   DECK BUILDER - TEST BUILDER STYLES
   Contains: Lesson Tests and ACTFL Verbal Tests styles
   ================================================================= */

/* =================================================================
   ASSESSMENT ZONE
   ================================================================= */

.zone-header-assessment {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
}

.zone-header-assessment h2 {
    color: white;
}

.zone-header-assessment .group-chevron {
    color: rgba(255, 255, 255, 0.8);
}

/* =================================================================
   LESSON TESTS SECTION
   ================================================================= */

/* Tests List */
.lt-tests-list-container h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lt-test-count {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.9em;
}

.lt-tests-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.lt-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 8px;
}

.lt-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.lt-test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.lt-test-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lt-test-info {
    flex: 1;
}

.lt-test-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.lt-test-lesson {
    font-weight: 600;
    color: var(--primary-color);
}

.lt-test-title {
    color: var(--text-primary);
}

.lt-unlock-badge {
    color: #10b981;
    font-size: 0.9em;
}

.lt-test-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.lt-test-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
}

.lt-status-active {
    background: #dcfce7;
    color: #166534;
}

.lt-status-draft {
    background: #fef3c7;
    color: #92400e;
}

/* Test Editor */
.lt-test-editor {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    margin-top: 20px;
    overflow: hidden;
}

.lt-test-editor.hidden {
    display: none;
}

.lt-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary-color);
    color: white;
}

.lt-editor-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lt-editor-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.lt-editor-section:last-of-type {
    border-bottom: none;
}

.lt-editor-section h5 {
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.lt-editor-section h6 {
    margin: 16px 0 12px 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.lt-section-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* Form Elements */
.lt-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lt-form-group {
    flex: 1;
    min-width: 200px;
}

.lt-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.lt-form-hint {
    display: block;
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.lt-input-with-suffix {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lt-input-with-suffix input {
    width: 80px;
}

.lt-input-suffix {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.lt-checkbox-group label,
.lt-radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.lt-checkbox-group input,
.lt-radio-group input {
    width: auto;
}

/* Lesson Checkboxes */
.lt-lessons-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.lt-lesson-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.lt-lesson-checkbox:hover {
    background: var(--bg-secondary);
}

.lt-lesson-checkbox input {
    width: auto;
}

.lt-lesson-count {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.lt-content-subsection {
    margin-bottom: 20px;
}

.lt-content-summary {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.lt-content-summary strong {
    color: var(--text-primary);
}

/* Module Configuration */
.lt-modules-config {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lt-module-config {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.lt-module-header {
    margin-bottom: 12px;
}

.lt-module-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.lt-module-checkbox input {
    width: auto;
}

.lt-module-checkbox i {
    color: var(--primary-color);
    width: 20px;
}

.lt-module-timing {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    transition: opacity 0.2s ease;
}

.lt-module-timing .lt-form-group {
    min-width: 150px;
    flex: 0 1 auto;
}

.lt-story-timing {
    flex-wrap: wrap;
}

.lt-overall-timer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Seed Settings */
.lt-seed-settings,
.lt-unlock-settings,
.lt-retake-settings {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

/* Editor Actions */
.lt-editor-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.lt-editor-actions .btn-danger {
    margin-left: auto;
}

/* =================================================================
   ACTFL TESTS SECTION
   ================================================================= */

.actfl-tests-list-container h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.actfl-test-count {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.9em;
}

.actfl-tests-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.actfl-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 8px;
}

.actfl-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.actfl-test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.actfl-test-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.actfl-test-info {
    flex: 1;
}

.actfl-test-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.actfl-test-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.actfl-test-level {
    color: var(--primary-color);
    font-weight: 500;
}

/* ACTFL Test Editor */
.actfl-test-editor {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid #7c3aed;
    margin-top: 20px;
    overflow: hidden;
}

.actfl-test-editor.hidden {
    display: none;
}

.actfl-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #7c3aed;
    color: white;
}

.actfl-editor-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.actfl-editor-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.actfl-editor-section:last-of-type {
    border-bottom: none;
}

.actfl-editor-section h5 {
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.actfl-editor-section h6 {
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.actfl-section-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* ACTFL Form Elements */
.actfl-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.actfl-form-group {
    flex: 1;
    min-width: 200px;
}

.actfl-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.actfl-form-hint {
    display: block;
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.actfl-input-with-suffix {
    display: flex;
    align-items: center;
    gap: 4px;
}

.actfl-input-with-suffix input {
    width: 80px;
}

.actfl-input-suffix {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Thresholds */
.actfl-thresholds {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.actfl-threshold {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.actfl-threshold-failure {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-left: 4px solid #ef4444;
}

.actfl-threshold-improving {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left: 4px solid #f59e0b;
}

.actfl-threshold-pass {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-left: 4px solid #22c55e;
}

.actfl-threshold-outstanding {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid #3b82f6;
}

.actfl-threshold-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    min-width: 140px;
}

.actfl-threshold-failure .actfl-threshold-label { color: #dc2626; }
.actfl-threshold-improving .actfl-threshold-label { color: #d97706; }
.actfl-threshold-pass .actfl-threshold-label { color: #16a34a; }
.actfl-threshold-outstanding .actfl-threshold-label { color: #2563eb; }

.actfl-threshold-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actfl-threshold-range input {
    width: 60px;
}

.actfl-threshold-description {
    flex: 1;
    font-size: 0.85em;
    color: var(--text-secondary);
    min-width: 200px;
}

/* CSV Import */
.actfl-import-section {
    margin-bottom: 24px;
}

.actfl-import-description {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.actfl-csv-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
}

.actfl-csv-upload-area:hover,
.actfl-csv-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.actfl-csv-upload-area i {
    font-size: 36px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.actfl-csv-upload-area p {
    margin: 0;
    color: var(--text-secondary);
}

.actfl-csv-file-input {
    display: none;
}

.actfl-csv-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.actfl-csv-file-info.hidden {
    display: none;
}

.actfl-csv-remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.actfl-csv-remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.actfl-import-actions {
    margin-top: 12px;
}

/* Questions List */
.actfl-questions-container {
    margin-top: 24px;
}

.actfl-questions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.actfl-questions-header h6 {
    margin: 0;
}

.actfl-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.actfl-questions-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.actfl-question-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.actfl-question-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85em;
    flex-shrink: 0;
}

.actfl-question-content {
    flex: 1;
    min-width: 0;
}

.actfl-question-cebuano {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actfl-question-english {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.actfl-question-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.actfl-question-category {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: capitalize;
    padding: 1px 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.actfl-question-type-badge {
    font-size: 0.75em;
    color: #2196f3;
    padding: 1px 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 10px;
}

.actfl-question-lesson-badge {
    font-size: 0.75em;
    color: #9c27b0;
    padding: 1px 8px;
    background: rgba(156, 39, 176, 0.1);
    border-radius: 10px;
}

.actfl-question-rubric-badge {
    font-size: 0.75em;
    color: #ff9800;
    padding: 1px 8px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 10px;
}

.actfl-question-actions {
    display: flex;
    gap: 8px;
}

/* Coverage Display */
.actfl-coverage-display {
    margin-top: 16px;
}

.actfl-coverage-info {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85em;
}

.actfl-coverage-row {
    margin: 4px 0;
    line-height: 1.5;
}

.actfl-coverage-covered {
    color: #4caf50;
}

.actfl-coverage-gaps {
    color: #ff9800;
}

/* Rubric Override Section in Question Modal */
.actfl-rubric-override-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.actfl-rubric-override-section h6 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 0.95em;
}

.actfl-rubric-override-section .actfl-form-hint {
    font-weight: normal;
}

/* Question Modal */
.actfl-question-modal {
    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: 10000;
}

.actfl-question-modal.hidden {
    display: none;
}

.actfl-question-modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.actfl-question-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #7c3aed;
    color: white;
    border-radius: 12px 12px 0 0;
}

.actfl-question-modal-header h4 {
    margin: 0;
}

.actfl-question-modal-body {
    padding: 20px;
}

.actfl-question-modal-body .actfl-form-group {
    margin-bottom: 16px;
}

.actfl-question-modal-body textarea {
    min-height: 60px;
    resize: vertical;
}

.actfl-question-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
}

/* ACTFL Editor Actions */
.actfl-editor-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.actfl-editor-actions .btn-danger {
    margin-left: auto;
}

/* =================================================================
   RESPONSIVE ADJUSTMENTS
   ================================================================= */

@media (max-width: 768px) {
    .lt-form-row,
    .actfl-form-row {
        flex-direction: column;
    }

    .lt-form-group,
    .actfl-form-group {
        min-width: 100%;
    }

    .lt-module-timing {
        flex-direction: column;
    }

    .actfl-threshold {
        flex-direction: column;
        align-items: flex-start;
    }

    .actfl-threshold-label {
        min-width: auto;
    }
}
