/**
 * V-Quiz MS frontend.css
 * Microsoft 認定試験画面（Pearson VUE）を意識したシンプル / 落ち着いた配色
 */

.vqms-card {
    background: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 10px;
    padding: 28px 28px 24px;
    margin: 24px 0;
    color: #333;
    font-size: 15px;
    line-height: 1.7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.vqms-card-title {
    font-size: 19px;
    font-weight: 600;
    color: #0078D4;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0078D4;
}

.vqms-instructions {
    background: #f3f6fa;
    border-left: 4px solid #0078D4;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 18px;
}

.vqms-instructions p {
    margin: 0 0 6px 0;
}

.vqms-note {
    font-size: 13px;
    color: #666;
}

/* ============ HOTSPOT 表 ============ */
.vqms-hotspot-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.vqms-hotspot-table th {
    background: #0078D4;
    color: #ffffff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    border: 1px solid #0067b8;
}

.vqms-hotspot-table th.vqms-col-yn {
    width: 80px;
    text-align: center;
}

.vqms-hotspot-table td {
    border: 1px solid #dde1e6;
    padding: 12px 14px;
    background: #ffffff;
    vertical-align: middle;
}

.vqms-hotspot-table tr.vqms-row-correct td { background: #f0f9f1; }
.vqms-hotspot-table tr.vqms-row-wrong   td { background: #fdf3f4; }

.vqms-stmt-en {
    color: #222;
    font-weight: 500;
}

.vqms-stmt-jp {
    color: #5f6b76;
    font-size: 13px;
    margin-top: 4px;
}

.vqms-explain {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fffaf0;
    border-left: 3px solid #ff8c00;
    font-size: 13px;
    color: #5a4500;
    border-radius: 3px;
}
.vqms-explain[hidden] { display: none; }

.vqms-yn-cell {
    text-align: center;
    cursor: pointer;
}

/* ラジオボタン円表現 */
.vqms-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
}

.vqms-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.vqms-radio-circle {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #888;
    border-radius: 50%;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
}

.vqms-radio:hover .vqms-radio-circle { border-color: #0078D4; }

.vqms-radio input[type="radio"]:checked + .vqms-radio-circle {
    border-color: #0078D4;
    background: radial-gradient(circle, #0078D4 50%, #ffffff 55%);
}

.vqms-radio input[type="radio"]:focus + .vqms-radio-circle {
    outline: 2px solid #0078D4;
    outline-offset: 2px;
}

/* ============ Yes/No 単問 ============ */
.vqms-intro {
    background: #fffaf0;
    border-left: 4px solid #ff8c00;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #5a4500;
}

.vqms-box {
    background: #f8f9fa;
    border: 1px solid #e1e5ea;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.vqms-box-solution { background: #eff6fc; border-color: #c5dcef; }

.vqms-box-label {
    font-size: 12px;
    color: #0078D4;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.vqms-box-body {
    color: #333;
    white-space: pre-wrap;
}

.vqms-question {
    /* v1.9.2: font-weight 600 → 400 に修正 (VARONTO 報告: 問題文太字で読みにくい)。
       問題文は本文として読むものなので通常のウェイトに統一。
       選択肢のレター (A./B./C./D.) は .vqms-choice-letter で 600 維持、
       カード タイトル (試験コード) は .vqms-card-title で 600 維持、
       構造マーカー 【正解: X】の理由 は <h4> で適度に強調 (.vqms-explain-block h4)。 */
    font-size: 16px;
    font-weight: 400;
    margin: 18px 0 12px;
    color: #222;
}

.vqms-yesno-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.vqms-choice {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    cursor: pointer;
    background: #ffffff;
    transition: background 0.15s, border-color 0.15s;
}

.vqms-choice:hover { background: #f3f6fa; border-color: #0078D4; }

.vqms-choice input[type="radio"] {
    margin-right: 12px;
    accent-color: #0078D4;
}

.vqms-choice-letter {
    font-weight: 600;
    margin-right: 8px;
    color: #0078D4;
    min-width: 24px;
}

.vqms-choice.vqms-choice-correct { background: #f0f9f1; border-color: #28a745; }
.vqms-choice.vqms-choice-wrong   { background: #fdf3f4; border-color: #dc3545; }

/* ============ 操作ボタン ============ */
.vqms-controls {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.vqms-btn {
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vqms-btn-grade {
    background: #0078D4;
    color: #ffffff;
    border-color: #0067b8;
}
.vqms-btn-grade:hover { background: #005a9e; }
.vqms-btn-grade:disabled {
    background: #c5c9cd;
    border-color: #c5c9cd;
    cursor: not-allowed;
}

.vqms-btn-reset {
    background: #ffffff;
    color: #0078D4;
    border-color: #0078D4;
}
.vqms-btn-reset:hover { background: #f3f6fa; }

/* v1.6.0: ディスカッション ボタン (V-Quiz Lite と統一感) */
.vqms-btn-discuss {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ee7800;
    color: #ffffff;
    border-color: #ee7800;
    text-decoration: none;
}
.vqms-btn-discuss:hover {
    background: #d56b00;
    color: #ffffff;
    text-decoration: none;
}
.vqms-discuss-count {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.9em;
    line-height: 1.4;
}

/* ============ 結果表示 ============ */
.vqms-result {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e1e5ea;
}

.vqms-score {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.vqms-score-pass  { color: #1a7e2a; }
.vqms-score-fail  { color: #b6313c; }

.vqms-result-detail {
    font-size: 14px;
    color: #444;
}

.vqms-explain-block h4 {
    margin: 14px 0 6px;
    font-size: 15px;
    color: #0078D4;
}

.vqms-support-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}
.vqms-support-table th { background: #f3f6fa; color: #333; text-align: left; padding: 8px 10px; border: 1px solid #dde1e6; }
.vqms-support-table td { padding: 8px 10px; border: 1px solid #dde1e6; }

/* ============ DnD 共通 ============ */
.vqms-dnd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #c5cdd6;
    border-radius: 6px;
    margin: 6px 0;
    cursor: grab;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.vqms-dnd-item:hover { background: #f3f6fa; border-color: #0078D4; }
.vqms-dnd-item:active { cursor: grabbing; }
.vqms-dnd-grip { color: #888; font-weight: 700; cursor: grab; user-select: none; }
.vqms-dnd-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #0078D4;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.vqms-dnd-ghost   { opacity: 0.4; background: #DEECF9 !important; }
.vqms-dnd-chosen  { box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3); }
.vqms-dnd-item-correct { background: #f0f9f1 !important; border-color: #28a745 !important; }
.vqms-dnd-item-wrong   { background: #fdf3f4 !important; border-color: #dc3545 !important; }

/* ----- DnD マッチング ----- */
.vqms-dnd-match {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    margin: 16px 0;
}
.vqms-dnd-pool {
    background: #f8f9fa;
    border: 1px solid #dde1e6;
    border-radius: 8px;
    padding: 12px;
    min-height: 200px;
}
.vqms-dnd-pool-label {
    font-size: 12px;
    color: #0078D4;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.vqms-dnd-pool-list { list-style: none; margin: 0; padding: 0; min-height: 100px; }
.vqms-dnd-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.vqms-dnd-target {
    border: 2px dashed #c5cdd6;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    min-height: 120px;
    transition: border-color 0.15s, background 0.15s;
}
.vqms-dnd-target:hover { border-color: #0078D4; background: #f3f6fa; }
.vqms-dnd-target-label {
    font-size: 13px;
    color: #0078D4;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5ea;
}
.vqms-dnd-target-list { list-style: none; margin: 0; padding: 0; min-height: 60px; }

/* ----- DnD 順序付け ----- */
.vqms-dnd-order { list-style: none; margin: 16px 0; padding: 0; counter-reset: vqms-order; }
.vqms-dnd-order .vqms-dnd-item { padding: 12px 16px; }

/* ----- HOTSPOT ドロップダウン ----- */
.vqms-hotspot-dropdown {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.vqms-hotspot-dropdown th {
    background: #0078D4;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    border: 1px solid #0067b8;
}
.vqms-hotspot-dropdown td {
    border: 1px solid #dde1e6;
    padding: 12px 14px;
    vertical-align: middle;
}
.vqms-hotspot-dropdown tr.vqms-row-correct td { background: #f0f9f1; }
.vqms-hotspot-dropdown tr.vqms-row-wrong   td { background: #fdf3f4; }
.vqms-dropdown-cell { width: 240px; }
.vqms-dropdown {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c5cdd6;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}
.vqms-dropdown:focus { outline: 2px solid #0078D4; outline-offset: 1px; border-color: #0078D4; }
.vqms-dropdown option:disabled { color: #b0b6bd; background: #f3f4f6; text-decoration: line-through; }

/* ============ 単一選択 / 複数選択 ============ */
.vqms-sc-choices,
.vqms-mc-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}
.vqms-sc-choices .vqms-choice input[type="radio"],
.vqms-mc-choices .vqms-choice input[type="checkbox"] {
    margin-right: 12px;
    accent-color: #0078D4;
}
.vqms-mc-instructions {
    font-size: 13px;
    color: #0078D4;
    font-weight: 600;
    margin: -6px 0 12px;
}

/* ============ レスポンシブ ============ */
@media (max-width: 640px) {
    .vqms-dnd-match { grid-template-columns: 1fr; }
    .vqms-dnd-targets { grid-template-columns: 1fr; }
    .vqms-dropdown-cell { width: 160px; }
}
@media (max-width: 640px) {
    .vqms-card { padding: 18px; }
    .vqms-card-title { font-size: 17px; }
    .vqms-hotspot-table { font-size: 13px; }
    .vqms-hotspot-table th, .vqms-hotspot-table td { padding: 8px; }
    .vqms-hotspot-table th.vqms-col-yn { width: 56px; }
}

/* ===== v1.7.0: 問題画像 ===== */
.vqms-q-image {
    margin: 14px 0 18px;
    text-align: center;
}
.vqms-q-image-link {
    display: inline-block;
    text-decoration: none;
}
.vqms-q-image img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    cursor: zoom-in;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s;
}
.vqms-q-image:hover img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.vqms-q-image-cap {
    font-size: 12px;
    color: #475569;
    margin-top: 8px;
    line-height: 1.5;
}
.vqms-q-image-caption {
    display: block;
    color: #334155;
    margin-bottom: 2px;
}
.vqms-q-image-credit a {
    color: #0078D4;
    text-decoration: underline;
}
.vqms-q-image-credit a:hover {
    color: #005a9e;
}
@media (max-width: 700px) {
    .vqms-q-image img { max-width: 100%; }
}

/* ===== v1.8.1: 解説 Markdown shim (テーブル / リスト / コード) ===== */
.vqms-explain-body,
.vqms-explain {
    line-height: 1.7;
}
.vqms-explain-body strong,
.vqms-explain strong { color: #1f2937; }

.vqms-md-list {
    margin: 8px 0 12px 0;
    padding-left: 22px;
    list-style: disc;
}
.vqms-md-list li {
    margin: 2px 0;
}
.vqms-md-table {
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
    width: auto;
    max-width: 100%;
    background: #ffffff;
}
.vqms-md-table th,
.vqms-md-table td {
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}
.vqms-md-table thead th {
    background: #f3f4f6;
    font-weight: 700;
    color: #1f2937;
}
.vqms-md-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}
.vqms-explain-body code,
.vqms-explain code {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.92em;
}
@media (max-width: 700px) {
    .vqms-md-table { font-size: 12px; }
    .vqms-md-table th, .vqms-md-table td { padding: 4px 6px; }
}
