/* ============================================================
   WORKSHEET WIZARD — Wizard UI CSS
   ============================================================ */

/* ---- Wizard Shell ---------------------------------------- */
.wsw-wizard-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Step Progress Bar ----------------------------------- */
.wsw-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 10px 16px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    flex-wrap: wrap;
}

.wsw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 80px;
    max-width: 140px;
}

.wsw-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: #ddd;
    transition: background 0.4s;
    z-index: 0;
}

.wsw-step.done:not(:last-child)::after,
.wsw-step.active:not(:last-child)::after {
    background: #10b981;
}

.wsw-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #aaa;
    transition: all 0.3s;
    z-index: 1;
    position: relative;
}

.wsw-step.active .wsw-step-circle {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}

.wsw-step.done .wsw-step-circle {
    border-color: #4CAF50;
    background: #4CAF50;
    color: #fff;
}

.wsw-step-label {
    font-size: 11px;
    color: #aaa;
    margin-top: 5px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.wsw-step.active .wsw-step-label { color: #10b981; }
.wsw-step.done .wsw-step-label   { color: #4CAF50; }

/* ---- Step Panels ----------------------------------------- */
.wsw-panel {
    display: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 28px 28px 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    animation: wsw-fade-in 0.3s ease;
}

.wsw-panel.active { display: block; }

@keyframes wsw-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wsw-panel-title {
    margin: 0 0 4px 0;
    font-size: 1.15em;
    font-weight: 700;
    color: #1a1a1a;
}

.wsw-panel-sub {
    margin: 0 0 22px 0;
    color: #666;
    font-size: 0.9em;
}

/* ---- Step Navigation Buttons ----------------------------- */
.wsw-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 10px;
}

.wsw-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.wsw-btn-back { background: #f0f0f0; color: #555; }
.wsw-btn-back:hover { background: #e0e0e0; }

.wsw-btn-next {
    background: linear-gradient(135deg, #10b981, #0d9488);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.wsw-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16,185,129,0.4);
}

.wsw-btn-generate {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: #fff;
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
    padding: 12px 28px;
    font-size: 15px;
}
.wsw-btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(76,175,80,0.4);
}

.wsw-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* ---- Step 1: Worksheet Type Grid ------------------------- */
.wsw-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}

@media (max-width: 900px) { .wsw-type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .wsw-type-grid { grid-template-columns: repeat(2, 1fr); } }

.wsw-type-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wsw-type-card:hover {
    border-color: #10b981;
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.15);
}

.wsw-type-card.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

.wsw-type-icon { font-size: 1.6em; line-height: 1; }

.wsw-type-name {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.wsw-type-desc {
    font-size: 10px;
    color: #888;
    line-height: 1.3;
    display: none;
}

/* ---- Step 2: Input Source Cards -------------------------- */
.wsw-input-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 600px) { .wsw-input-cards { grid-template-columns: 1fr; } }

.wsw-input-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.wsw-input-card:hover {
    border-color: #10b981;
    background: #f0fdf4;
    transform: translateY(-2px);
}

.wsw-input-card.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

.wsw-input-card-icon { font-size: 1.8em; }
.wsw-input-card-title { font-size: 13px; font-weight: 700; color: #333; }
.wsw-input-card-desc  { font-size: 11px; color: #888; }

/* ---- Input sub-forms ------------------------------------- */
.wsw-input-form { display: none; }
.wsw-input-form.active { display: block; }

.wsw-form-group { margin-bottom: 14px; }

.wsw-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wsw-label-hint {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.wsw-spec-align-wrapper {
    background: #f8fffe;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 4px;
}

/* ---- Step 3: Review Grid --------------------------------- */
.wsw-review-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}

@media (max-width: 600px) { .wsw-review-grid { grid-template-columns: 1fr; } }

.wsw-review-item {
    background: #f8f8f8;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 12px 16px;
}

.wsw-review-item-label {
    font-size: 10px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.wsw-review-item-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Question count control ------------------------------ */
.wsw-q-count-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.wsw-q-count-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 2px solid #10b981;
    background: #fff;
    color: #10b981;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.wsw-q-count-btn:hover { background: #10b981; color: #fff; }

.wsw-q-count-display {
    font-size: 22px;
    font-weight: 800;
    color: #10b981;
    min-width: 32px;
    text-align: center;
}

/* ---- Difficulty radio pills ------------------------------ */
.wsw-diff-options {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.wsw-diff-option { display: flex; align-items: center; }
.wsw-diff-option input[type="radio"] { display: none; }

.wsw-diff-pill {
    padding: 7px 18px;
    border-radius: 20px;
    border: 2px solid #e0e0e0;
    background: #fafafa;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.wsw-diff-option input[type="radio"]:checked + .wsw-diff-pill {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}

/* ---- Options section label / divider --------------------- */
.wsw-options-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 18px 0 8px 0;
}

.wsw-options-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0 0;
    color: #ccc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wsw-options-divider::before,
.wsw-options-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ececec;
}

.wsw-options-divider span { color: #bbb; white-space: nowrap; }

/* ---- Differentiation chips ------------------------------- */
.wsw-diff-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.wsw-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    background: #fafafa;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.wsw-chip:hover { border-color: #10b981; color: #065f46; }
.wsw-chip.active {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}

.wsw-chip input[type="checkbox"] { display: none; }

/* ---- Step 4: Loading / Generating ------------------------ */
.wsw-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px;
    text-align: center;
}

.wsw-generating-icon {
    font-size: 3em;
    margin-bottom: 16px;
    animation: wsw-pulse 1.8s ease-in-out infinite;
}

@keyframes wsw-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.12); opacity: 0.85; }
}

.wsw-generating-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.wsw-generating-sub {
    font-size: 0.88em;
    color: #777;
    margin: 0 0 24px 0;
    max-width: 420px;
}

.wsw-progress-bar-outer {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 100px;
    overflow: hidden;
}

.wsw-progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #0d9488);
    border-radius: 100px;
    transition: width 0.4s ease;
}

/* ---- Export bar ------------------------------------------ */
.wsw-export-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0 0 0;
    margin-top: 24px;
    border-top: 1px solid #ececec;
}

.wsw-export-title {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wsw-export-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.wsw-restart-btn {
    padding: 9px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.wsw-restart-btn:hover { background: #f0f0f0; border-color: #ccc; }

/* ---- Error message --------------------------------------- */
.wsw-error-msg {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 16px 20px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

/* ---- Step error inline ----------------------------------- */
.wsw-step-error {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    color: #b91c1c;
    font-size: 13px;
    margin-top: 12px;
}

/* ---- Worksheet output area — A4-style page preview ------- */
#wsw-output-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #e8e8e8;
    padding: 28px 16px;
    border-radius: 10px;
    margin-bottom: 4px;
}

#eai_tt_ws_output {
    width: 100%;
    max-width: 680px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.10);
    padding: 40px 48px 48px;
    font-family: 'Georgia', serif;
    font-size: 13.5px;
    line-height: 1.65;
    color: #1a1a1a;
    height: auto !important;
    min-height: 0 !important;
}

/* Output header */
.eai-ws-output-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.eai-ws-output-title {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    font-family: 'Georgia', serif;
}

.eai-ws-output-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #555;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 8px;
    white-space: nowrap;
    margin-top: 3px;
    font-family: sans-serif;
}

/* Theory box */
.eai-ws-theory-box {
    background: #fafafa;
    border-left: 3px solid #10b981;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
}

.eai-ws-section-title {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: sans-serif;
}

.eai-ws-theory-text {
    font-size: 0.92em;
    line-height: 1.7;
    color: #333;
}

/* Word bank */
.eai-ws-word-bank {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.9em;
    font-family: sans-serif;
}

.eai-ws-wb-item {
    display: inline-block;
    background: #fff;
    border: 1px solid #86efac;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 2px 3px;
    font-weight: 600;
    color: #166534;
}

/* Question blocks */
.eai-ws-questions {
    margin-top: 4px;
}

.eai-ws-question-block {
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.eai-ws-question-text {
    margin: 0 0 12px 0;
    line-height: 1.6;
    font-size: 0.97em;
}

.eai-ws-q-num {
    font-weight: 700;
    margin-right: 4px;
}

.eai-ws-marks-badge {
    font-size: 0.82em;
    color: #666;
    font-style: italic;
    font-family: sans-serif;
}

.eai-ws-starter {
    font-size: 0.85em;
    margin: -4px 0 8px 0;
    padding: 5px 10px;
    background: #eff6ff;
    border-left: 3px solid #60a5fa;
    border-radius: 0 4px 4px 0;
    color: #1e40af;
    font-family: sans-serif;
}

.eai-ws-starter-label {
    font-weight: 700;
    margin-right: 5px;
    font-style: normal;
}

.eai-ws-hint {
    font-size: 0.85em;
    color: #555;
    font-style: italic;
    margin: 0 0 8px 0;
    font-family: sans-serif;
}

/* Answer lines — properly spaced like a real worksheet */
.eai-ws-answer-lines {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.eai-ws-answer-line {
    height: 32px;
    border-bottom: 1px solid #aaa;
    width: 100%;
}

/* Multiple choice */
.eai-ws-mc-list {
    list-style: none;
    margin: 4px 0 8px 0;
    padding: 0;
}

.eai-ws-mc-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.93em;
}

.eai-ws-mc-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid #555;
    border-radius: 50%;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
    font-family: sans-serif;
}

.eai-ws-justify-prompt {
    font-size: 0.85em;
    color: #555;
    margin: 6px 0 4px 0;
    font-family: sans-serif;
}

/* True / False */
.eai-ws-tf-boxes {
    display: flex;
    gap: 14px;
    margin: 8px 0;
}

.eai-ws-tf-box {
    border: 2px solid #555;
    border-radius: 6px;
    padding: 6px 20px;
    font-weight: 700;
    font-size: 0.9em;
    font-family: sans-serif;
}

/* Sequencing */
.eai-ws-seq-list {
    list-style: none;
    margin: 6px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eai-ws-seq-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.93em;
}

.eai-ws-seq-num-box {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 1.5px solid #555;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Matching */
.eai-ws-match-table {
    display: flex;
    gap: 10px;
    margin: 6px 0;
    font-size: 0.9em;
    font-family: sans-serif;
}

.eai-ws-match-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eai-ws-match-join { flex: 0 0 60px; }

.eai-ws-match-item {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fafafa;
}

.eai-ws-match-answer-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.eai-ws-match-answer-box {
    width: 100%;
    text-align: center;
    color: #888;
    padding: 5px 0;
    border-bottom: 1px solid #ccc;
}

.eai-ws-match-letter {
    font-weight: 700;
    margin-right: 4px;
}

/* Creative writing scaffold */
.eai-ws-scaffold-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 0.88em;
    font-family: sans-serif;
    line-height: 1.6;
}

/* Challenge box */
.eai-ws-challenge-box {
    background: #fefce8;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 16px 18px;
    margin-top: 24px;
}

.eai-ws-challenge-title {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #92400e;
    font-family: sans-serif;
}

.eai-ws-challenge-text {
    font-size: 0.92em;
    margin: 0 0 8px 0;
    line-height: 1.6;
}

.eai-ws-editable {
    border-radius: 4px;
    cursor: text;
    transition: background 0.15s ease, outline-color 0.15s ease;
}

.eai-ws-editable:hover {
    background: rgba(37, 99, 235, 0.08);
    outline: 1px dashed rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.eai-ws-editable.is-editing {
    background: #fff;
    outline: 2px solid rgba(37, 99, 235, 0.55);
    outline-offset: 3px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* ===== WORKSHEET WIZARD TOOL SPECIFIC STYLES ===== */

/* Template Type Visual Indicators */
.modern-template-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
}

.modern-template-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
}

.modern-template-details {
  flex: 1;
}

.modern-template-title {
  font-weight: 600;
  color: var(--primary-700);
  margin: 0 0 var(--space-1) 0;
}

.modern-template-description {
  font-size: var(--text-sm);
  color: var(--primary-600);
  margin: 0;
  line-height: 1.4;
}

/* Difficulty Level Visuals */
.modern-difficulty-visual {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.modern-difficulty-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.modern-difficulty-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.modern-difficulty-fill.beginner {
  width: 25%;
  background: linear-gradient(90deg, var(--success-400), var(--success-500));
}

.modern-difficulty-fill.intermediate {
  width: 50%;
  background: linear-gradient(90deg, var(--warning-400), var(--warning-500));
}

.modern-difficulty-fill.advanced {
  width: 75%;
  background: linear-gradient(90deg, var(--error-400), var(--error-500));
}

.modern-difficulty-fill.mixed {
  width: 100%;
  background: linear-gradient(90deg, var(--success-400), var(--warning-400), var(--error-400), var(--primary-400));
}

.modern-difficulty-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--gray-600);
  min-width: 80px;
  text-align: right;
}

/* Question Type Grid */
.modern-question-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.modern-question-type-card {
  padding: var(--space-3);
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.modern-question-type-card:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.modern-question-type-card.selected {
  border-color: var(--primary-500);
  background: var(--primary-100);
}

.modern-question-type-icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.modern-question-type-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
}

/* Answer Format Options */
.modern-answer-format-options {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.modern-answer-format-option {
  flex: 1;
  padding: var(--space-4);
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.modern-answer-format-option:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
}

.modern-answer-format-option.selected {
  border-color: var(--primary-500);
  background: var(--primary-100);
}

.modern-answer-format-icon {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.modern-answer-format-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
}

/* Special Instructions Enhancement */
.modern-special-instructions {
  position: relative;
}

.modern-special-instructions .modern-form-textarea {
  padding-left: var(--space-12);
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10Z' stroke='%23f59e0b' stroke-width='2'/%3E%3Cpath d='M10 6V10L13 13' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: var(--space-4) var(--space-4);
  background-size: 20px;
}

/* Worksheet Preview */
.modern-worksheet-preview {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-top: var(--space-6);
  box-shadow: var(--shadow-md);
}

.modern-worksheet-header {
  text-align: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-200);
}

.modern-worksheet-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 var(--space-2) 0;
}

.modern-worksheet-subtitle {
  font-size: var(--text-base);
  color: var(--gray-600);
  margin: 0;
}

.modern-worksheet-questions {
  margin-bottom: var(--space-6);
}

.modern-worksheet-question {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary-400);
}

.modern-question-number {
  font-weight: 600;
  color: var(--primary-600);
  margin-bottom: var(--space-2);
}

.modern-question-text {
  color: var(--gray-700);
  line-height: 1.5;
}

.modern-worksheet-footer {
  text-align: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* Template Specific Styles */

/* Standard Worksheet */
.modern-standard-preview {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

/* Fill in the Blanks */
.modern-fill-blank-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left-color: var(--warning-400);
}

.modern-blank-space {
  display: inline-block;
  min-width: 80px;
  height: 2px;
  background: var(--gray-400);
  margin: 0 var(--space-1);
  vertical-align: middle;
}

/* Multiple Choice */
.modern-multiple-choice-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-left-color: var(--primary-400);
}

.modern-choice-option {
  display: block;
  margin: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
}

.modern-choice-option::before {
  content: '○';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gray-600);
}

/* Exam Style */
.modern-exam-style-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-left-color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.modern-points-indicator {
  float: right;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}

/* Matching Exercise */
.modern-matching-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-left-color: var(--success-400);
}

.modern-matching-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.modern-matching-column {
  padding: var(--space-3);
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--success-200);
}

/* Word Search */
.modern-word-search-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border-left-color: var(--error-400);
}

.modern-word-search-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin: var(--space-4) 0;
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
}

.modern-word-search-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--gray-700);
}

/* Crossword Puzzle */
.modern-crossword-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #f5f3ff, #e9d5ff);
  border-left-color: var(--purple-400);
}

.modern-crossword-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  margin: var(--space-4) 0;
  background: var(--gray-300);
  padding: 1px;
  border-radius: var(--radius-lg);
}

.modern-crossword-cell {
  aspect-ratio: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-700);
}

.modern-crossword-cell.black {
  background: var(--gray-800);
}

/* Reading Comprehension */
.modern-comprehension-preview .modern-worksheet-question {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left-color: var(--blue-400);
}

.modern-reading-passage {
  background: white;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--blue-200);
  margin-bottom: var(--space-4);
  line-height: 1.6;
  color: var(--gray-700);
}

/* Loading States */
.modern-worksheet-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  color: var(--gray-500);
}

.modern-worksheet-loading .modern-spinner {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
  border-width: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modern-question-types-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modern-answer-format-options {
    flex-direction: column;
  }
  
  .modern-matching-columns {
    grid-template-columns: 1fr;
  }
  
  .modern-word-search-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .modern-crossword-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Animation Enhancements */
@keyframes worksheetGenerate {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.modern-worksheet-preview {
  animation: worksheetGenerate 0.5s ease-out;
}

/* Focus States */
.modern-question-type-card:focus-visible,
.modern-answer-format-option:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Error States */
.modern-worksheet-preview.error {
  border-color: var(--error-400);
  background: var(--error-50);
}

.modern-worksheet-preview.error .modern-worksheet-header {
  border-bottom-color: var(--error-300);
}

/* Success States */
.modern-worksheet-preview.success {
  border-color: var(--success-400);
  background: var(--success-50);
}

.modern-worksheet-preview.success .modern-worksheet-header {
  border-bottom-color: var(--success-300);
}
