body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
}

.intro-text {
    text-align: center;
    color: #555;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    padding: 15px 25px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: bold;
}

.tab-button.disabled {
    color: #aaa;
    cursor: not-allowed;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box; /* Wichtig für korrekte Breite */
}

.vocab-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.vocab-table th, .vocab-table td {
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

.vocab-table th {
    border-bottom: 2px solid #eee;
    color: #555;
}

.vocab-table input {
    width: 98%;
}

.btn-add-row {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.vocab-block {
    background: #fff;
    border-radius: 10px;
}

.vocab-block-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.vocab-block-title-input {
    width: 160px;
    max-width: 100%;
    font-size: 12px;
    padding: 8px 10px;
    font-weight: normal;
}

.vocab-block-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4b5563;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    height: fit-content;
}

.vocab-block-title-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}

.vocab-block-title-label {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

.vocab-block-inline-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: normal;
}

.vocab-block-table {
    border: 1px solid #eef2f7;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.vocab-block-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 80px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #f1f5f9;
}

.vocab-block.has-vocab-images .vocab-block-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 80px 40px;
}

.vocab-block-row--head {
    background: #f8fafc;
    border-top: none;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.vocab-block-cell {
    display: flex;
    align-items: center;
}

.vocab-block-question-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
}

.vocab-block.has-vocab-images .vocab-block-question-wrap {
    grid-template-columns: auto auto minmax(0, 1fr);
}

.vocab-block-image-preview {
    display: none;
    min-width: 42px;
    min-height: 32px;
}

.vocab-block.has-vocab-images .vocab-block-image-preview {
    display: block;
}

.vocab-block-points-cell input {
    width: 100%;
}

.vocab-block-action-cell {
    justify-content: center;
}

.vocab-block-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vocab-block-meta-footer {
    margin-left: auto;
}

.vocab-block-bulk-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    background: #f8fafc;
}

.vocab-block-bulk-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
}

.vocab-block-bulk-toggle-smart {
    border-color: #a7c7d7;
    background: #f8fdff;
    color: #334155;
}

.vocab-block-smart-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #1fb6c9;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 3px 8px rgba(31, 182, 201, 0.25);
}

.vocab-block-swap-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
}

.vocab-block-bulk-label-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.vocab-block-bulk-panel label {
    display: inline-flex;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 0;
}

.vocab-bulk-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #111827;
    cursor: help;
    line-height: 1;
}

.vocab-bulk-help:focus {
    outline: 2px solid #111827;
    outline-offset: 2px;
    border-radius: 999px;
}

.vocab-bulk-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: min(390px, 78vw);
    z-index: 30;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 500;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
}

.vocab-bulk-tooltip strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
}

.vocab-bulk-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #111827;
}

.vocab-bulk-help:hover .vocab-bulk-tooltip,
.vocab-bulk-help:focus .vocab-bulk-tooltip {
    display: block;
}

.vocab-quizlet-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 5px 0 8px !important;
    padding: 7px 10px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a !important;
    font-weight: 700;
    cursor: pointer;
}

.vocab-quizlet-toggle input {
    margin: 0;
    accent-color: #1fb6c9;
}

.vocab-quizlet-workflow {
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 8px;
}

.vocab-quizlet-search-input {
    flex: 1 1 260px;
    min-width: 180px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
    background: #fff;
}

.vocab-quizlet-after-hint {
    margin: 0 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

.vocab-block-bulk-input {
    width: 100%;
    min-height: 110px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
}

.vocab-block-bulk-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.quizlet-workflow-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.56);
    align-items: flex-start;
    justify-content: center;
    padding: 112px 22px 22px;
}

.quizlet-workflow-content {
    width: min(1120px, 96vw);
    height: min(760px, calc(100vh - 142px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quizlet-workflow-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.quizlet-workflow-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: #111827;
}

.quizlet-workflow-header p {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.35;
}

.quizlet-workflow-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.quizlet-workflow-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px;
}

.quizlet-open-link {
    text-decoration: none;
}

.quizlet-workflow-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #f8fafc;
}

@media (max-width: 720px) {
    .vocab-block-row {
        grid-template-columns: 1fr;
    }
    .vocab-block-row--head {
        display: none;
    }
    .vocab-block-points-cell,
    .vocab-block-action-cell {
        justify-content: flex-start;
    }
    .vocab-block-question-wrap {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .vocab-block.has-vocab-images .vocab-block-question-wrap {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .quizlet-workflow-modal {
        padding: 84px 10px 10px;
    }

    .quizlet-workflow-content {
        width: 100%;
        height: calc(100vh - 104px);
    }
}

.btn-submit {
    padding: 12px 25px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #28a745;
    color: white;
    display: block;
    width: 100%;
    margin-top: 20px;
}
 @keyframes slideUp {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}
.login-lightbox-body .btn-secondary {
    background: #6c757d;
    color: white;
    border-radius: 5px;
    transition: all 0.3s;
}

.login-lightbox-body .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}
.dropdown-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 5px;
    margin: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

.dropdown-menu-item:hover {
    background: #f0f8ff;
    color: #007bff;
    transform: translateX(3px);
}

.dropdown-menu-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.dropdown-menu-item.logout-btn {
    color: #dc3545;
    margin-top: 10px;
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.dropdown-menu-item.logout-btn:hover {
    background: #ffe5e5;
    color: #c82333;
}

.login-lightbox-body .btn-secondary i {
    margin-right: 8px;
}
.account-box {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    max-width: 350px;
    transition: all 0.3s ease;
}

.account-box:hover {
    background: #f0f8ff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.account-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-box-header i.fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 14px;
    color: #6c757d;
    margin-left: 10px;
}

.account-box.expanded .account-box-header i.fa-chevron-down {
    transform: rotate(180deg);
}

.account-status {
    display: flex;
    align-items: center;
    flex: 1;
}

.account-status i.fa-user-check {
    font-size: 18px;
    color: #007bff;
    margin-right: 8px;
}

.account-status-text {
    flex: 1;
}

.account-status-label {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
}

.account-status-email {
    font-weight: bold;
    font-size: 12px;
    color: #333;
    line-height: 1.2;
}

.account-links {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
    animation: slideDown 0.3s ease;
}

.account-box.expanded .account-links {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.account-link:hover {
    background: #f0f8ff;
    color: #007bff;
    transform: translateX(2px);
}

.account-link i {
    width: 18px;
    margin-right: 10px;
    font-size: 14px;
}

.account-link-badge {
    margin-left: auto;
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.account-link.logout-link {
    color: #dc3545;
    border-top: 1px solid #dee2e6;
    margin-top: 4px;
    padding-top: 12px;
}

.account-link.logout-link:hover {
    background: #ffe5e5;
}

/* Für nicht eingeloggte User */
.account-box.not-logged-in {
    padding: 10px 15px;
}

.account-box.not-logged-in:hover {
    background: #f0f8ff;
}

    /* Testbeschreibung Editor Styles */
    .test-description-container {
        margin: 20px 0;
    }
    
    .editor-toolbar {
        display: flex;
        gap: 5px;
        margin-bottom: -1px;
        padding: 8px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 5px 5px 0 0;
    }
    
    .editor-btn {
        padding: 6px 10px;
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        color: #495057;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        height: 32px;
    }
    
    .editor-btn:hover {
        background: #e9ecef;
        border-color: #adb5bd;
    }
    
    .editor-btn:active {
        background: #dee2e6;
    }
    
    .editor-btn.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .editor-btn i {
        font-size: 14px;
    }
    
    .test-description-editor {
        width: calc(100% - 22px);
        min-height: 60px;
        max-height: 200px;
        padding: 10px;
        border: 1px solid #dee2e6;
        border-radius: 0 0 5px 5px;
        resize: vertical;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
        line-height: 1.5;
        overflow-y: auto;
        background: #fff;
    }
    
    .test-description-editor:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    }
    
    .test-description-editor ul,
    .test-description-editor ol {
        margin: 10px 0;
        padding-left: 30px;
    }
    
    .test-description-editor li {
        margin: 5px 0;
    }
    
    .format-hint {
        font-size: 12px;
        color: #6c757d;
        margin-top: 5px;
    }
    
    .test-description-editor .placeholder {
        color: #6c757d;
        font-style: italic;
        pointer-events: none;
        user-select: none;
    }

    /* Collapsible Test Description */
    .test-description-toggle {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        padding: 10px 15px;
        border-radius: 5px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
        transition: all 0.3s;
    }
    .test-description-toggle:hover {
        background: #e9ecef;
    }
    .test-description-toggle i {
        transition: transform 0.3s;
    }
    .test-description-toggle.active i.fa-chevron-down {
        transform: rotate(180deg);
    }
    .test-description-wrapper {
        display: none;
        animation: slideDown 0.3s ease;
    }
    .test-description-wrapper.active {
        display: block;
    }

    /* Links in Testbeschreibung */
    .test-description-editor a {
        color: #007bff;
        text-decoration: underline;
        cursor: pointer;
    }
    .test-description-editor a:hover {
        color: #0056b3;
    }

    /* KI-Import Styles */
    .ki-import-modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.5);
    }
    .ki-import-content {
        background-color: #fefefe;
        margin: 2% auto;
        padding: 30px;
        border: 1px solid #888;
        width: 90%;
        max-width: 900px;
        border-radius: 12px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .ki-import-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #007bff;
        padding-bottom: 15px;
    }
    .ki-import-header h2 {
        margin: 0;
        color: #333;
    }
    .ki-close {
        color: #aaa;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
    }
    .ki-close:hover {
        color: #000;
    }
    .ki-form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    .ki-form-group {
        margin-bottom: 15px;
    }
    .ki-form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
        color: #495057;
    }
    .ki-form-group input,
    .ki-form-group select,
    .ki-form-group textarea {
        width: 100%;
        padding: 8px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
    }
    .ki-form-group.full-width {
        grid-column: 1 / -1;
    }
    .ki-question-types {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 5px;
    }
    .ki-question-type {
        display: flex;
        align-items: center;
    }
    .ki-question-type input {
        width: auto;
        margin-right: 5px;
    }
    .ki-section-plan {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 12px;
    }
    .ki-section-plan-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        font-size: 13px;
        color: #495057;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 8px 10px;
    }
    .ki-section-rows {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }
    .ki-section-row {
        display: flex;
        gap: 10px;
        align-items: center;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 8px 10px;
    }
    .ki-section-row input[type="text"] {
        flex: 1;
    }
    .ki-section-row input[type="number"] {
        width: 100px;
    }
    .ki-prompt-box {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 20px;
        margin: 20px 0;
    }
    .ki-prompt-text {
        background: white;
        border: 1px solid #007bff;
        border-radius: 4px;
        padding: 15px;
        margin: 10px 0;
        font-family: monospace;
        font-size: 14px;
        line-height: 1.5;
        white-space: pre-wrap;
        user-select: all;
    }
    .ki-copy-btn {
        background: #007bff;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
    .ki-copy-btn:hover {
        background: #0056b3;
    }
    .ki-import-section {
        margin-top: 30px;
        border-top: 2px solid #dee2e6;
        padding-top: 20px;
    }
    .ki-preview-container {
        margin-top: 20px;
        max-height: 400px;
        overflow-y: auto;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 15px;
        background: #f8f9fa;
    }
    .ki-preview-question {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 5px;
        padding: 15px;
        margin-bottom: 10px;
    }
    .ki-preview-question input[type="checkbox"] {
        margin-right: 10px;
    }
    
    /* Starter Card */
    .starter-card {
        border: 1px dashed #cbd5e0;
        border-radius: 12px;
        padding: 20px;
        background: #f8fafc;
        margin: 10px 0 20px;
    }
    .starter-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }
    .starter-card-header h3 {
        margin: 0;
        font-size: 18px;
        color: #2d3748;
    }
    .starter-card-header p {
        margin: 4px 0 0;
        color: #64748b;
        font-size: 13px;
    }
    .starter-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: #e0e7ff;
        color: #4338ca;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }
    .starter-card-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
    }

    /* Gap Insert Modal */
    .gap-insert-modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.55);
    }
    .gap-insert-content {
        background: #ffffff;
        margin: 6% auto;
        padding: 24px;
        border: 1px solid #e2e8f0;
        width: 90%;
        max-width: 520px;
        border-radius: 14px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    }
    .gap-insert-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }
    .gap-insert-header h3 {
        margin: 0;
        font-size: 18px;
        color: #2d3748;
    }
    .gap-insert-close {
        color: #94a3b8;
        font-size: 26px;
        font-weight: bold;
        cursor: pointer;
    }
    .gap-insert-close:hover {
        color: #1f2937;
    }
    .gap-insert-error {
        background: #fff1f2;
        border: 1px solid #fecdd3;
        color: #be123c;
        border-radius: 8px;
        padding: 8px 10px;
        margin-bottom: 10px;
        font-size: 12px;
    }
    .gap-insert-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }
    .gap-insert-tab {
        flex: 1;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #475569;
        padding: 8px 10px;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }
    .gap-insert-tab.active {
        background: #e0e7ff;
        border-color: #818cf8;
        color: #312e81;
    }
    .gap-insert-body label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        color: #334155;
    }
    .gap-insert-body input {
        width: 100%;
        padding: 10px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
    .gap-insert-body small {
        display: block;
        margin-top: 6px;
        color: #64748b;
        font-size: 12px;
    }
    .gap-insert-options {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 10px;
    }
    .gap-insert-option-row {
        display: grid;
        grid-template-columns: 92px 1fr auto;
        gap: 8px;
        align-items: center;
    }
    .gap-option-correct {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 700;
        color: #4a5568;
        background: #edf2f7;
        border-radius: 6px;
        padding: 6px 8px;
        text-align: center;
        cursor: pointer;
        margin: 0;
        min-height: 38px;
    }
    .gap-option-correct input[type="radio"] {
        width: 14px;
        height: 14px;
        padding: 0;
        margin: 0;
        accent-color: #667eea;
    }
    .gap-option-correct:has(input[type="radio"]:checked) {
        background: #dcfce7;
        color: #166534;
    }
    .gap-insert-footer {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 16px;
    }
    .ki-preview-question h4 {
        margin: 0 0 10px 0;
        color: #333;
    }
    
    /* Icons für Fragetypen */
    .question-type-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        margin-right: 8px;
        font-size: 14px;
    }
    
    .icon-mc { background: #28a745; color: white; }
    .icon-short { background: #17a2b8; color: white; }
    .icon-long { background: #6c757d; color: white; }
    .icon-gap { background: #ffc107; color: white; }
    .icon-number { background: #dc3545; color: white; }
    .icon-order { background: #6f42c1; color: white; }
    .icon-matching { background: #0f766e; color: white; }
    .icon-section { background: #343a40; color: white; }
    
    /* Drag and Drop Styles */
    .sortable-ghost {
        opacity: 0.4;
        background: #c8ebfb;
    }
    
    .drag-handle {
        cursor: move;
        color: #6c757d;
        margin-right: 10px;
        padding: 5px;
    }
    
    .drag-handle:hover {
        color: #333;
    }
    
    /* Lückentext Styles */
    .gap-text-editor {
        width: 100%;
        min-height: 150px;
        padding: 15px;
        border: 1px solid #dee2e6;
        border-radius: 5px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        font-size: 16px;
        line-height: 1.6;
        white-space: pre-wrap;
        resize: vertical;
        background: #fff;
    }
    
    .gap-text-editor:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    }
    
    /* Tabellen-Styles für Lückentext */
    .gap-table-container {
        margin: 10px 0;
        overflow-x: auto;
    }
    
    .gap-table {
        width: 100%;
        border-collapse: collapse;
        margin: 10px 0;
    }
    
    .gap-table td, .gap-table th {
        border: 1px solid #dee2e6;
        padding: 10px;
        min-width: 100px;
        position: relative;
    }
    
    .gap-table th {
        background: #f8f9fa;
        font-weight: bold;
    }
    
    .gap-table input {
        width: 100%;
        border: none;
        padding: 5px;
        font-family: inherit;
        font-size: inherit;
    }

    .gap-table-cell-editor {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 32px;
        align-items: center;
        gap: 6px;
        background: #ffffff;
        border: 1px solid #d8dee6;
        border-radius: 6px;
        padding: 2px 4px 2px 6px;
    }

    .gap-table-cell-editor:focus-within {
        border-color: #86b7fe;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.16);
    }

    .gap-table-cell-editor input {
        background: transparent;
        min-width: 0;
    }

    .gap-cell-edit-btn {
        width: 28px;
        height: 28px;
        border: 1px solid #d8dee6;
        border-radius: 6px;
        background: #f8fafc;
        color: #475569;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .gap-cell-edit-btn:hover {
        background: #eef2ff;
        border-color: #818cf8;
        color: #3730a3;
    }
    
    .gap-table .gap-placeholder {
        background: #fffbf0;
        border: 1px dashed #ffc107;
        border-radius: 3px;
        padding: 2px 5px;
        display: inline-block;
        min-width: 80px;
    }
    
    .gap-table .action-column,
    .gap-table .action-cell {
        width: 40px;
        text-align: center;
        background: #f8f9fa;
    }
    
    .gap-table .btn-remove-option {
        background: #dc3545;
        color: white;
        border: none;
        padding: 4px 8px;
        border-radius: 3px;
        cursor: pointer;
        font-size: 12px;
    }
    
    .gap-table .btn-remove-option:hover {
        background: #c82333;
    }
    
    .gap-table .column-action-cell {
        background: #f8f9fa;
        text-align: center;
        padding: 4px;
        border-bottom: 2px solid #dee2e6;
    }
    
    .gap-table .btn-column-delete {
        background: #dc3545;
        color: white;
        border: none;
        padding: 2px 6px;
        border-radius: 3px;
        cursor: pointer;
        font-size: 11px;
        opacity: 0.8;
    }
    
    .gap-table .btn-column-delete:hover {
        opacity: 1;
        background: #c82333;
    }
    
    .gap-placeholder-btn {
        background: #28a745;
        color: white;
        border: none;
        padding: 5px 15px;
        border-radius: 4px;
        cursor: pointer;
        margin-top: 10px;
    }
    
    .gap-info {
        background: #e7f3ff;
        padding: 10px;
        border-radius: 5px;
        margin-top: 10px;
        font-size: 14px;
    }
    
    /* Zahl-Fragetyp Styles */
    .number-tolerance-settings {
        display: flex;
        gap: 20px;
        align-items: center;
        margin-top: 10px;
    }
    
    .tolerance-mode {
        display: block;
        margin-top: 10px;
    }
    
    /* Ordnen-Fragetyp Styles */
    .order-items-list {
        margin-top: 15px;
    }
    
    .order-item {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 10px 0;
        padding: 10px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 5px;
    }

    .matching-editor {
        display: grid;
        gap: 18px;
    }

    .matching-editor-title-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .matching-editor-title-row label {
        margin: 0;
    }

    .matching-info-hover {
        position: relative;
        color: #64748b;
        cursor: help;
        display: inline-flex;
        align-items: center;
    }

    .matching-info-tooltip {
        display: none;
        position: absolute;
        left: 50%;
        bottom: calc(100% + 8px);
        transform: translateX(-50%);
        width: min(320px, 70vw);
        background: #0f172a;
        color: #ffffff;
        border-radius: 8px;
        padding: 9px 10px;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.35;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
        z-index: 50;
    }

    .matching-info-hover:hover .matching-info-tooltip,
    .matching-info-hover:focus .matching-info-tooltip,
    .matching-info-hover:focus-within .matching-info-tooltip {
        display: block;
    }

    .matching-category-blocks {
        display: grid;
        gap: 12px;
        margin-top: 10px;
    }

    .matching-category-block {
        padding: 12px;
        background: #f8fafc;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
    }

    .matching-category-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        margin-bottom: 10px;
    }

    .matching-items-list {
        display: grid;
        gap: 8px;
        margin-bottom: 10px;
        margin-left: 18px;
        padding-left: 14px;
        border-left: 3px solid #dbeafe;
    }

    .matching-item-row {
        display: grid;
        grid-template-columns: minmax(160px, 1fr) auto auto auto;
        gap: 8px;
        align-items: center;
        padding: 8px;
        background: #ffffff;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
    }

    .matching-category-header input,
    .matching-item-row input[type="text"] {
        width: 100%;
    }

    .matching-image-button {
        width: 38px;
        height: 38px;
        border: 1px solid #d1d9e6;
        border-radius: 8px;
        background: #ffffff;
        color: #475569;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .matching-image-button.active {
        background: #ecfdf5;
        border-color: #22c55e;
        color: #15803d;
    }

    .matching-item-image-thumb {
        display: inline-flex;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: zoom-in;
    }

    .matching-item-image-thumb:focus-visible {
        outline: 3px solid rgba(59, 130, 246, 0.35);
        outline-offset: 2px;
        border-radius: 8px;
    }

    .matching-item-image-preview img {
        width: 42px;
        height: 32px;
        border-radius: 6px;
        object-fit: cover;
        border: 1px solid #dbe3ef;
        display: block;
    }

    @media (max-width: 760px) {
        .matching-item-row {
            grid-template-columns: minmax(0, 1fr) auto auto auto;
        }

        .matching-items-list {
            margin-left: 6px;
            padding-left: 10px;
        }

    }
    
    .order-item .drag-handle {
        cursor: move;
    }
    
    .order-item input {
        flex: 1;
    }
    
    
    .order-item .btn-remove {
        background: #dc3545;
        color: white;
        border: none;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* Abschnittstitel Styles */
    .section-title-block {
        background: #f5f5f5;
        color: #000;
        padding: 15px 20px;
        border-radius: 8px;
        margin: 20px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-left: 5px solid #666;
    }
    
    .section-title-input {
        background: transparent;
        border: none;
        border-bottom: 2px solid #999;
        color: #000;
        padding: 8px 12px;
        border-radius: 0;
        flex: 1;
        margin: 0 10px;
        font-size: 20px;
        font-weight: bold;
    }
    
    .section-title-input::placeholder {
        color: #999;
        font-weight: normal;
    }
    
    .section-title-input:focus {
        outline: none;
        border-bottom-color: #007bff;
    }
    
    /* Fragen-Navigation Buttons */
    .question-nav-buttons {
        display: flex;
        gap: 5px;
        margin-left: auto;
    }
    
    .btn-move {
        background: #6c757d;
        color: white;
        border: none;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }
    
    .btn-move:hover {
        background: #5a6268;
    }
    
    .btn-move:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    /* Verbessertes Question Block Layout */
    .question-block {
        margin: 20px 0;
        padding: 20px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: #f8f9fa;
        position: relative;
    }
    
    .question-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }
    
.question-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}

.question-title.vocab-block-header {
    flex-wrap: wrap;
    gap: 10px;
}

.vocab-block-label {
    white-space: nowrap;
}
    
    /* Existing styles from original file */
    .image-preview {
        margin-top: 10px;
        cursor: pointer;
    }
    .image-preview img {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border-radius: 5px;
        border: 2px solid #dee2e6;
    }
    .image-preview img:hover {
        border-color: #007bff;
    }
    .lightbox {
        display: none;
        position: fixed;
        z-index: 9999;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.9);
    }
    .lightbox-content {
        margin: auto;
        display: block;
        max-width: 90%;
        max-height: 90%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .lightbox-close {
        position: absolute;
        top: 20px;
        right: 40px;
        color: white;
        font-size: 40px;
        font-weight: bold;
        cursor: pointer;
    }
    .lightbox-close:hover {
        color: #ccc;
    }
    .btn-modern-add {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 25px;
        cursor: pointer;
        font-size: 16px;
        margin: 10px 0;
        transition: all 0.3s;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
    .btn-modern-add:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    }
    .btn-modern-add i {
        font-size: 18px;
    }
    /* Dropdown Menu Styles */
    #add-menu {
        min-width: 400px;
    }
    #add-menu .question-types-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 15px;
    }
    @media (min-width: 768px) {
        #add-menu {
            min-width: 500px;
        }
        #add-menu .question-types-grid {
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
    }
    #add-menu h4 {
        margin: 0 0 15px 0;
        font-size: 16px;
        font-weight: 600;
    }
    #add-menu .question-type-btn {
        width: 100%;
        margin: 0;
        padding: 10px 12px;
        justify-content: flex-start;
        font-size: 14px;
        font-weight: 500;
    }
    #add-menu .question-type-btn:hover {
        background-color: #f0f0f0;
        transform: translateX(2px);
    }
    #add-menu hr {
        margin: 15px 0 10px 0;
    }
    .account-box {
        position: fixed;
        top: 20px;
        right: 20px;
        background: white;
        border: 2px solid #007bff;
        border-radius: 8px;
        padding: 10px 15px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    .account-box:hover {
        background: #f0f8ff;
    }
    
    .account-dropdown {
        position: fixed;
        top: 70px;
        right: 20px;
        width: 300px;
        background: white;
        border: 2px solid #007bff;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        display: none;
        z-index: 999;
    }
    .account-dropdown.active {
        display: block;
    }
    .account-dropdown input {
        width: 100%;
        padding: 10px;
        margin: 5px 0;
        border: 1px solid #ddd;
        border-radius: 5px;
        box-sizing: border-box;
    }
    .account-dropdown button {
        width: 100%;
        margin: 5px 0;
    }
    .remember-me {
        margin: 10px 0;
        display: flex;
        align-items: center;
    }
    .remember-me input {
        width: auto;
        margin-right: 8px;
    }
    .container {
        margin-top: 80px;
    }
    .delete-row-btn {
        background: none;
        border: none;
        color: #dc3545;
        cursor: pointer;
        font-size: 1.2em;
    }
    .student-mode-selector {
        margin: 20px 0;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    .mode-option {
        padding: 10px 15px;
        margin: 5px 0;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s;
    }
    .mode-option.active {
        border-color: #007bff;
        background: #e7f3ff;
    }
    .mode-option h4 {
        margin: 0 0 5px 0;
        font-size: 16px;
    }
    .mode-option p {
        margin: 0;
        font-size: 14px;
    }
    /* Lerngruppen-Option für nicht-eingeloggte Nutzer */
.mode-option-disabled {
    background: #f8f9fa;
    cursor: default;
}

.mode-option-disabled:hover {
    border-color: #dee2e6;
    background: #f8f9fa;
}
.login-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.login-lightbox-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-lightbox-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-lightbox-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.login-lightbox-close:hover {
    color: #333;
}

.login-lightbox-info {
    padding: 15px 20px;
}

.info-box {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    align-items: flex-start;
}

.info-box.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.info-box i {
    font-size: 24px;
    margin-top: 2px;
}

.login-lightbox-body {
    padding: 20px;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    cursor: pointer;
    border-radius: 5px;
}

.login-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
}

.login-tab-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.restore-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.btn-login-prompt {
    margin-top: 10px;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-login-prompt:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-login-prompt i {
    font-size: 14px;
}
    .student-list-input {
        display: none;
        margin-top: 20px;
    }
    .student-list-input.active {
        display: block;
    }
    .test-settings {
        margin: 20px 0;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    .checkbox-group {
        margin: 10px 0;
    }
    .checkbox-group label {
        display: flex;
        align-items: center;
        margin: 5px 0;
        cursor: pointer;
    }
    .checkbox-group input[type="checkbox"] {
        margin-right: 8px;
        margin-top: 0;
        flex-shrink: 0;
    }
    .bulk-input-container {
        display: none;
        margin: 15px 0;
        padding: 15px;
        background: #f0f0f0;
        border-radius: 5px;
    }
    .bulk-input-container.active {
        display: block;
    }
    .bulk-input-container textarea {
        width: 100%;
        box-sizing: border-box;
    }
    .random-settings {
        margin: 15px 0;
        padding: 15px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 5px;
    }
    .random-subset-options {
        display: none;
        margin-left: 25px;
        margin-top: 10px;
    }
    .random-subset-options.active {
        display: block;
    }
    .random-subset-count-row {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .inline-number-input {
        width: 80px;
        display: inline-block;
        margin: 0 5px;
    }
    .random-subset-select {
        min-width: 112px;
    }
    .time-limit-presets {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 0 0 0 8px;
        vertical-align: middle;
    }
    .time-limit-preset-button {
        border: 1px solid #cfd8e3;
        background: #fff;
        color: #25313f;
        border-radius: 999px;
        padding: 4px 9px;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
        cursor: pointer;
    }
    .time-limit-preset-button:hover {
        border-color: #007bff;
        color: #007bff;
        background: #f4f9ff;
    }
    .email-option-simple {
        display: none;
        margin-top: 10px;
        padding: 10px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 5px;
    }
    .email-option-simple.active {
        display: block;
    }
    .btn-secondary {
        padding: 8px 15px;
        background-color: #6c757d;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        margin: 5px 0;
    }
    .btn-secondary:hover {
        background-color: #5a6268;
    }
    .btn-primary {
        padding: 10px 20px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }
    .btn-primary:hover {
        background-color: #0056b3;
    }
    .btn-submit {
        padding: 15px 30px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 30px;
        font-size: 18px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        display: block;
        margin: 30px auto;
    }
    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    }
    .btn-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }
    .lockout-container {
        display: inline-block;
    }
    .link-with-buttons {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }
    .link-with-buttons input {
        flex: 1;
    }
    .link-with-buttons button {
        padding: 8px 15px;
    }

    /* Modernes Styling für Erfolgsbereich nach Testerstellung */
    #result-container.result-card {
        margin-top: 24px;
        padding: 28px;
        border: 1px solid #dbe4ff;
        border-radius: 18px;
        background: linear-gradient(160deg, #ffffff 0%, #f5f8ff 100%);
        box-shadow: 0 14px 32px rgba(22, 37, 84, 0.08);
    }
    #result-container.result-card h2 {
        margin-top: 0;
        margin-bottom: 8px;
        font-size: 30px;
        color: #1c2f54;
    }
    #result-container.result-card > p {
        margin-top: 0;
        color: #54627f;
    }
    #result-container .form-group {
        margin: 18px 0;
    }
    #result-container .form-group label {
        color: #2b3d63;
    }
    #result-container .link-with-buttons {
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
    }
    #result-container .link-with-buttons input {
        min-width: 220px;
        flex: 1 1 280px;
        border: 1px solid #ccd7f1;
        border-radius: 12px;
        padding: 11px 12px;
        box-shadow: inset 0 1px 1px rgba(19, 31, 68, 0.05);
    }
    #result-container .btn-primary,
    #result-container .btn-secondary {
        margin: 0;
        padding: 10px 14px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-weight: 600;
        transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    }
    #result-container .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
    }
    #result-container .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 7px 18px rgba(102, 126, 234, 0.42);
    }
    #result-container .btn-secondary {
        background: #fff;
        color: #2f4063;
        border: 1px solid #d1dbf2;
    }
    #result-container .btn-secondary:hover {
        transform: translateY(-1px);
        background: #f6f9ff;
        border-color: #bccaf0;
    }
    #result-container .result-status-box {
        margin-top: 20px;
        padding: 18px;
        border-radius: 14px;
        border: 1px solid transparent;
    }
    #result-container .result-status-success {
        background: #ecfdf3;
        border-color: #b7efcb;
    }
    #result-container .result-status-warning {
        background: #fff8dd;
        border-color: #ffe08a;
    }
    #result-container .result-nav-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 15px;
    }
    #result-container #folder-select {
        border: 1px solid #ccd7f1;
        border-radius: 10px;
        padding: 10px;
    }

    @media (max-width: 768px) {
        #result-container.result-card {
            padding: 20px;
        }
        #result-container .link-with-buttons input {
            flex-basis: 100%;
        }
        #result-container .btn-primary,
        #result-container .btn-secondary {
            width: 100%;
        }
    }
    .modal {
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
    }
    .modal-content {
        background-color: #fefefe;
        margin: 5% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 400px;
        max-width: 90%;
        border-radius: 8px;
        text-align: center;
    }
    .question-type-selector {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }
    .question-type-btn {
        padding: 8px 15px;
        border: 1px solid #dee2e6;
        background: white;
        border-radius: 5px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }
    .question-type-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        line-height: 1.2;
    }
    .question-type-text small {
        color: #6b7280;
        font-size: 11px;
        font-weight: 400;
    }
    .question-type-btn.active .question-type-text small {
        color: rgba(255,255,255,0.85);
    }
    .question-type-btn.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    .question-type-btn i {
        font-size: 14px;
    }
    .mc-options {
        margin-top: 15px;
    }
    .mc-option {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 10px 0;
    }
    .mc-option input[type="checkbox"] {
        width: auto;
    }
    .mc-option input[type="text"] {
        flex: 1;
    }
    .btn-remove-option {
        background: #dc3545;
        color: white;
        border: none;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }
    .btn-remove-option:hover {
        background: #c82333;
    }
    .btn-add-mc-option {
        background: #28a745;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        margin-top: 10px;
    }
    .btn-add-mc-option:hover {
        background: #218838;
    }
    .tabs {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
        border-bottom: 2px solid #dee2e6;
    }
    .tab-button {
        padding: 15px 25px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        font-size: 16px;
        transition: all 0.3s;
    }
    .tab-button:hover {
        background: #f8f9fa;
    }
    .tab-button.active {
        color: #007bff;
        border-bottom-color: #007bff;
        font-weight: bold;
    }
    .tab-content {
        display: none;
    }
    .tab-content.active {
        display: block;
    }
    .btn-image-toggle {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 5px 10px;
        cursor: pointer;
        transition: all 0.3s;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 34px;
        line-height: 1.2;
    }
    .btn-image-toggle:hover {
        background: #e9ecef;
    }
    .btn-image-toggle.active {
        background: #007bff;
        color: white;
    }
    .image-url-container {
        margin-top: 10px;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 5px;
        animation: slideDown 0.3s ease;
    }
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    .vocab-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
    }
    .vocab-table th {
        background-color: #f8f9fa;
        padding: 10px;
        text-align: left;
        border: 1px solid #dee2e6;
    }
    .vocab-table td {
        padding: 8px;
        border: 1px solid #dee2e6;
    }
    .vocab-table input {
        width: 100%;
        padding: 5px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
    }
    .btn-add-row {
        margin-top: 10px;
        padding: 8px 15px;
        background-color: #28a745;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
    .btn-add-row:hover {
        background-color: #218838;
    }
    .form-group {
        margin: 20px 0;
    }
    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
    }
  /* Spezielle Styles für Checkboxen in form-group */
.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: bold; /* GEÄNDERT: jetzt bold statt normal */
}
/* NEUE STYLE für Lockout-Container Label */
.lockout-container label {
    font-weight: bold;
}
    .form-group label input[type="checkbox"] {
        width: auto;
        margin-right: 8px;
        margin-top: 0;
    }
    .form-group input, .form-group textarea, .form-group select {
        width: 100%;
        padding: 10px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        box-sizing: border-box;
    }
    
    /* Kriterien-Editor Styles */
.criteria-editor-container {
    margin-top: 15px;
    padding: 15px;
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
}

.criteria-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.criteria-editor-header label {
    font-weight: bold;
    color: #0066cc;
}

.criteria-optional-badge {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.criteria-editor {
    min-height: 120px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
    line-height: 1.6;
    resize: vertical;
}

.criteria-editor:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.criteria-toolbar {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px 5px 0 0;
    margin-bottom: -1px;
}
 
/* Image Preview Container */
.image-preview {
    margin-top: 10px;
    position: relative;
}

.image-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-preview img:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.image-preview small {
    font-style: italic;
    color: #6c757d;
}

/* Links in Testbeschreibung */
.test-description-editor a {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}

.test-description-editor a:hover {
    color: #0056b3;
}
/* Erläuterungsfeld Container */
.explanation-container {
    margin-top: 15px;
    padding: 15px;
    background: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

.explanation-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #856404;
}

.explanation-container .test-description-editor {
    background: white;
}

.answer-feedback-container {
    background: #eef8f2;
    border-color: #8fd5aa;
}

.answer-feedback-container label {
    color: #166534;
}

.section-title-block .explanation-container {
    background: #f8fafc;
    border-color: #d8e0ea;
}

.section-title-block .explanation-container label {
    color: #4a5568;
}

/* Button-Styles für Erläuterung und Upload */
.btn-explanation-toggle,
.btn-feedback-toggle,
.btn-upload-image,
.btn-image-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-explanation-toggle:hover,
.btn-feedback-toggle:hover,
.btn-upload-image:hover,
.btn-image-toggle:hover {
    background: #e9ecef;
}

.btn-explanation-toggle.active {
    background: #856404;
    color: white;
    border-color: #856404;
}

.btn-feedback-toggle.active {
    background: #166534;
    color: white;
    border-color: #166534;
}

.btn-upload-image {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-upload-image:hover {
    background: #218838;
}

.btn-upload-image:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-upload-image i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Button Container Flexbox */
.form-group > div[style*="flex"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
/* Speicher-Button für Aufgaben */
.btn-save-questions {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    margin: 30px auto;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-save-questions:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-save-questions:active {
    transform: translateY(0);
}

.btn-save-questions:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-save-questions i {
    font-size: 18px;
}

.btn-save-questions::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-save-questions:hover::before {
    width: 300px;
    height: 300px;
}

/* Alert Warning */
.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning strong {
    font-weight: bold;
}

.alert-warning i {
    font-size: 20px;
}

/* Dropdown Menu Position */
.dropdown {
    position: relative;
    display: inline-block;
}

#add-menu {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 100;
    margin-top: 5px;
    display: none;
    padding: 15px;
}

#add-menu.show {
    display: block;
}
/* Microsoft SSO Button Styling */
.btn-microsoft {
    background: #ffffff;
    color: #5e5e5e;
    padding: 14px 20px;
    text-decoration: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid #8c8c8c;
    cursor: pointer;
    width: auto;
    margin: 0 auto 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-microsoft:hover {
    background: #f3f3f3;
    border-color: #8c8c8c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-microsoft:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-microsoft span {
    white-space: nowrap;
}

/* SSO Section */
.sso-section {
    margin-bottom: 20px;
    text-align: center;
}

.login-lightbox .sso-section {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.login-lightbox .btn-microsoft,
.login-lightbox .btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 12px 18px;
    background: #ffffff;
    border: 1px solid #d7dde6;
    border-radius: 8px;
    color: #2f3744;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    box-sizing: border-box;
    margin: 0;
    line-height: 1.2;
}

.login-lightbox .btn-microsoft span,
.login-lightbox .btn-google span {
    white-space: nowrap;
}

.login-lightbox .btn-microsoft:hover,
.login-lightbox .btn-google:hover {
    background: #f8f9fa;
    border-color: #aab4c2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

/* SSO Hint Text */
.sso-hint {
    font-size: 12px;
    color: #6c757d;
    margin: 8px 20px 15px;
    line-height: 1.4;
    text-align: center;
}

.login-lightbox .sso-hint {
    margin: 2px 24px 0;
    font-size: 13px;
}

/* Divider zwischen SSO und normalem Login */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #6c757d;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.divider span {
    padding: 0 15px;
    font-size: 14px;
    color: #6c757d;
}

/* Login Lightbox Base Styles */
.login-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.login-lightbox-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-lightbox-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-lightbox-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.login-lightbox-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
}

.login-lightbox-close:hover {
    color: #333;
}

.login-lightbox-info {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
}

.info-box.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.info-box i {
    font-size: 20px;
    margin-top: 2px;
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
}

.info-box p {
    margin: 0;
    font-size: 14px;
}

.login-lightbox-body {
    padding: 20px;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.login-tab {
    flex: 1;
    padding: 12px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    color: #495057;
}

.login-tab:hover {
    background: #e9ecef;
}

.login-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
}

.login-tab-content input[type="email"],
.login-tab-content input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.login-tab-content input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.login-lightbox-body .btn-primary {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-lightbox-body .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.login-lightbox-body .btn-primary:active {
    transform: translateY(0);
}

.login-lightbox-body .btn-secondary {
    background: #6c757d;
    color: white;
    border-radius: 6px;
    transition: all 0.3s;
    text-align: center;
}

.login-lightbox-body .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.login-lightbox-body .btn-secondary i {
    margin-right: 8px;
}

/* Responsive Design */
@media (max-width: 500px) {
    .login-lightbox-content {
        width: 95%;
        margin: 10px;
    }
    
    .login-lightbox-header h2 {
        font-size: 18px;
    }
    
    .login-lightbox .btn-microsoft,
    .login-lightbox .btn-google {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }
    
    .sso-hint {
        font-size: 11px;
        margin: 8px 10px 15px;
    }
}
/* Neuer Style für den Bild-Upload Dropdown */
.image-upload-dropdown {
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.drop-zone:hover {
    border-color: #007bff;
    background: #f1f8ff;
}

.drop-zone.dragover {
    border-color: #28a745;
    background: #e8f5e9;
    transform: scale(1.02);
}

.drop-zone i {
    font-size: 32px;
    color: #6c757d;
    margin-bottom: 10px;
}

.drop-zone p {
    margin: 0;
    color: #495057;
    font-weight: 500;
}

.drop-zone small {
    color: #888;
}

.shared-image-picker-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.shared-image-picker-modal.open {
    display: block;
}

.shared-image-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.shared-image-picker-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    overflow: auto;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
    padding: 16px;
}

.shared-image-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.shared-image-picker-current {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 12px;
}

.shared-image-picker-current-thumb {
    width: 64px;
    height: 48px;
    border: 0;
    padding: 0;
    border-radius: 7px;
    overflow: hidden;
    background: #e2e8f0;
    cursor: zoom-in;
}

.shared-image-picker-current-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shared-image-picker-current-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.shared-image-picker-current-meta span {
    color: #64748b;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-image-picker-remove {
    color: #b91c1c;
}

.shared-image-picker-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.shared-image-picker-close:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
    transform: scale(1.04);
}

.shared-image-picker-close:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.shared-image-picker-section {
    border-top: 1px solid #edf2f7;
    padding-top: 12px;
    margin-top: 12px;
}

.shared-image-picker-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #334155;
}

.shared-image-picker-unsplash {
    margin-left: 18px;
    padding-left: 14px;
    border-left: 3px solid #e2e8f0;
}

.image-credit {
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.image-credit a {
    color: #475569;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.shared-image-picker-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.shared-image-picker-url-row input {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    padding: 8px 11px;
    line-height: 1.35;
    box-sizing: border-box;
}

.shared-image-picker-status {
    margin-top: 8px;
    color: #64748b;
    font-size: 0.9rem;
}

.shared-image-picker-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 22px;
    text-align: center;
    background: #f8fafc;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.shared-image-picker-dropzone:hover,
.shared-image-picker-dropzone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.shared-image-picker-dropzone.dragover {
    transform: scale(1.01);
}

.shared-image-picker-dropzone i {
    font-size: 30px;
    color: #64748b;
    margin-bottom: 8px;
}

.shared-image-picker-dropzone p {
    margin: 0;
    color: #334155;
    font-weight: 700;
}

.shared-image-picker-dropzone small {
    color: #64748b;
}

.shared-image-picker-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.shared-image-picker-result {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 6px;
    text-align: left;
    cursor: pointer;
}

.shared-image-picker-result img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 5px;
}

.shared-image-picker-result span {
    display: block;
    color: #475569;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insert-after-question-wrapper {
    position: relative;
    display: inline-flex;
}

.insert-after-question-menu {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 2500;
    width: 260px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.insert-after-question-menu.open {
    display: grid;
    gap: 4px;
}

.insert-after-question-menu button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
}

.insert-after-question-menu button:hover,
.insert-after-question-menu button:focus-visible {
    background: #eef2ff;
    color: #4338ca;
    outline: none;
}

.insert-after-question-menu i {
    width: 18px;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Question Overview Panel */
.question-editor-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.question-overview-panel {
    width: 280px;
    position: sticky;
    top: 110px;
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 12px;
    transition: width 0.2s ease, box-shadow 0.2s ease;
}

.question-editor-main {
    flex: 1;
    min-width: 0;
}

.overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.overview-title {
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.overview-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.overview-collapse-btn {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.overview-collapse-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.overview-add-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    font-size: 0.78rem;
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.overview-add-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1e3a8a;
}

.overview-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.overview-empty {
    padding: 12px;
    border: 1px dashed #e5e7eb;
    border-radius: 10px;
    color: #6b7280;
    font-size: 0.85rem;
    text-align: center;
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    background: #f9fafb;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.overview-item.selected {
    background: #e0e7ff;
    border-color: #c7d2fe;
}

.overview-item.section.selected {
    background: #e5e7eb;
    border-color: #cbd5f5;
}

.overview-item:hover {
    background: #eef2ff;
}

.overview-item.section {
    background: #f3f4f6;
    font-weight: 600;
}

.overview-item.active {
    background: #e0e7ff;
    border-color: #c7d2fe;
}

.overview-item.section.active {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.overview-item.selected.active {
    background: #c7d2fe;
    border-color: #a5b4fc;
}

.overview-item.question.indent {
    margin-left: 14px;
    border-left: 2px solid #e5e7eb;
    padding-left: 10px;
}

.overview-drag {
    color: #9ca3af;
    cursor: grab;
}

.overview-pos {
    min-width: 20px;
    font-weight: 600;
    color: #6b7280;
}

.overview-icon {
    width: 20px;
    display: inline-flex;
    justify-content: center;
    color: #6b7280;
}

.overview-title-text {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-meta {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.overview-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.78rem;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overview-focus {
    outline: 2px solid #a5b4fc;
    outline-offset: 2px;
    transition: outline 0.2s ease;
}

.question-overview-panel.collapsed {
    width: 54px;
    padding: 10px 6px;
}

.question-overview-panel.collapsed .overview-title,
.question-overview-panel.collapsed .overview-actions .overview-add-btn,
.question-overview-panel.collapsed .overview-list,
.question-overview-panel.collapsed .overview-footer {
    display: none;
}

.question-overview-panel.collapsed .overview-header {
    justify-content: center;
}

.overview-confirm {
    position: fixed;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
    font-size: 0.85rem;
    color: #1f2937;
}

.overview-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

.overview-confirm-btn {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.overview-confirm-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1e3a8a;
}

.overview-confirm-btn.danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.overview-confirm-btn.danger:hover {
    background: #fecaca;
}

@media (max-width: 1200px) {
    .question-editor-layout {
        flex-direction: column;
    }

    .question-overview-panel {
        width: 100%;
        position: static;
    }
}
