:root {
    --preview-primary: #004d99;
    --preview-accent: #e6e6fa;
    --preview-background: rgba(0, 0, 0, 0.45);
    --preview-surface: #ffffff;
    --preview-text: #333333;
    --preview-border: #d0d7de;
    --preview-hover: #f0f8ff;
    --preview-tag-single: #ffebcc;
    --preview-tag-single-text: #e67e22;
    --preview-tag-other: #d1f7d1;
    --preview-tag-other-text: #27ae60;
}

.preview-overlay {
    position: fixed;
    inset: 0;
    background: var(--preview-background);
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 20px;
    z-index: 999;
}

.preview-overlay.is-visible {
    display: flex;
}

.preview-dialog {
    background: var(--preview-surface);
    color: var(--preview-text);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 1080px;
    width: 100%;
    padding: 24px 28px;
    position: relative;
    animation: preview-fade-in 0.25s ease-out;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.preview-title {
    font-size: 1.6em;
    color: var(--preview-primary);
    margin: 0;
}

.preview-close {
    background: transparent;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    color: var(--preview-primary);
}

.preview-description {
    margin: 0 0 20px;
    color: #555555;
}

.preview-content {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding-right: 8px;
}

.preview-section {
    border: 1px solid var(--preview-border);
    border-radius: 6px;
    margin-bottom: 24px;
    overflow: hidden;
}

.preview-section-title {
    background: var(--preview-primary);
    color: #ffffff;
    padding: 12px 16px;
    font-size: 1.1em;
    font-weight: 600;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--preview-border);
    vertical-align: top;
    font-size: 0.95em;
}

.preview-table th {
    background: var(--preview-accent);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.75em;
    letter-spacing: 0.04em;
    color: #444444;
}

.preview-table tr:nth-child(even) td {
    background: #fafafa;
}

.preview-table tr:hover td {
    background: var(--preview-hover);
}

.preview-id {
    font-weight: 600;
    color: #2c3e50;
    width: 18%;
    word-break: break-word;
}

.preview-points {
    font-weight: 600;
    text-align: center;
    width: 8%;
    color: #c0392b;
}

.preview-points.zero {
    color: #95a5a6;
}

.preview-type {
    width: 12%;
}

.preview-type-tag {
    display: inline-block;
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.preview-type-tag.singlechoice {
    background: var(--preview-tag-single);
    color: var(--preview-tag-single-text);
}

.preview-type-tag.symptom,
.preview-type-tag.simple,
.preview-type-tag.textarea {
    background: var(--preview-tag-other);
    color: var(--preview-tag-other-text);
}

.preview-options {
    background: #f7faff;
    border-left: 4px solid var(--preview-primary);
    margin: 0;
    padding: 10px 18px 14px 24px;
}

.preview-options p {
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--preview-primary);
}

.preview-options ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.preview-options li {
    margin-bottom: 4px;
    font-size: 0.92em;
}

.preview-option-id {
    font-family: "Segoe UI Mono", "Roboto Mono", monospace;
    font-size: 0.85em;
    color: #555555;
    margin-right: 6px;
}

.preview-option-points {
    font-weight: 600;
    color: #16a085;
    margin-left: 6px;
}

.preview-empty {
    margin: 20px 0;
    font-style: italic;
    color: #7f8c8d;
}


@media (max-width: 768px) {
    .preview-dialog {
        padding: 20px;
    }

    .preview-content {
        max-height: calc(100vh - 140px);
    }

    .preview-table th,
    .preview-table td {
        font-size: 0.85em;
        padding: 8px 12px;
    }

    .preview-toggle {
        width: 100%;
        margin-top: 12px;
    }
}

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