/* ============================================================
   GP Quiz — Frontend Styles
   ============================================================ */

:root {
    --gp-navy:        #0C4A68;
    --gp-navy-dark:   #161A26;
    --gp-correct:     #58B3CC;
    --gp-incorrect:   #E40000;
    --gp-missed:      #059669;
    --gp-border:      #e5e7eb;
    --gp-bg:          #f9fafb;
    --gp-text:        #111827;
    --gp-muted:       #6b7280;
    --gp-radius:      10px;
}

.gp-quiz-container *,
.gp-results-container * { box-sizing: border-box; }

.gp-error {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--gp-radius);
    color: #664d03;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.gp-quiz-container {
    display: flex;
    min-height: 600px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    color: var(--gp-text);
}

/* ── Sidebar ── */
.gp-sidebar {
    width: 220px;
    min-width: 220px;
    background: #fff;
    border-right: 1px solid var(--gp-border);
    padding: 24px 0 20px;
    flex-shrink: 0;
}

.gp-sidebar-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--gp-navy);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 0 20px 18px;
    display: block;
}

.gp-sidebar-list { list-style: none; margin: 0; padding: 0; }

.gp-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    font-size: 13.5px;
    color: var(--gp-muted);
    cursor: default;
    transition: color .15s;
}

.gp-sidebar-item.is-active    { color: var(--gp-navy);      font-weight: 700; }
.gp-sidebar-item.is-correct   { color: var(--gp-correct);   font-weight: 600; }
.gp-sidebar-item.is-incorrect { color: var(--gp-incorrect); font-weight: 600; }

.gp-sidebar-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
    transition: background .2s;
}

.gp-sidebar-item.is-active    .gp-sidebar-dot { background: var(--gp-navy); }
.gp-sidebar-item.is-correct   .gp-sidebar-dot { background: var(--gp-correct); }
.gp-sidebar-item.is-incorrect .gp-sidebar-dot { background: var(--gp-incorrect); }

/* ── Main ── */
.gp-quiz-main { flex: 1; padding: 32px 0px; overflow-y: auto; }

.gp-quiz-title { font-size: 28px; font-weight: 800; color: var(--gp-navy); margin: 0 0 4px; line-height: 1.2; }
.gp-quiz-desc  { font-size: 16px; font-weight: 500; color: var(--gp-muted); margin: 0 0 20px; }


.gp-quiz-header{
    padding: 0px 40px;
}


/* ── Connecting dotted line between sidebar dots ── */
.gp-sidebar-item {
    position: relative;  /* add this — needed for the pseudo-element */
}

.gp-sidebar-dot {
    position: relative;
    z-index: 1;  /* add this — keeps dot visible above the line */
}

.gp-sidebar-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 25px;                  /* center of the dot: 20px left padding + 5.5px half-dot */
    top: calc(50% + 6px);       /* start just below the current dot's bottom edge */
    bottom: calc(-50% + 6px);   /* end just above the next dot's top edge */
    width: 0;
    border-left: 1.5px dashed #c9cdd3;
}

/* ============================================================
   PROGRESS BAR
   Single row: [Question X of Y]  [X% Completed ── bar ── X/Y]
   ============================================================ */

.gp-progress-wrap {
        border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    padding: 20px 40px;

 }

.gp-progress-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Left: "Question X of Y" label */
.gp-progress-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gp-text);
    white-space: nowrap;
    flex-shrink: 0;
    width: 30%;
}

/* Right: the full bar section */
.gp-progress-bar-section {
    flex: 1;
    max-width: 748px;
}

/* "X% Completed" on left, "X/Y" on right — above the track */
.gp-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.gp-progress-pct   { font-size: 12px; color: var(--gp-muted); }
.gp-progress-count { font-size: 12px; color: var(--gp-muted); font-weight: 500; }

/* Bar track */
.gp-progress-track {
    height: 5px;
    background: var(--gp-border);
    border-radius: 99px;
    overflow: hidden;
}

.gp-progress-bar {
    height: 100%;
    background: var(--gp-navy);
    border-radius: 99px;
    transition: width .4s ease;
    min-width: 0;
}

/* ============================================================
   QUESTION SLIDES
   ============================================================ */

.gp-question-slide           { display: none; }
.gp-question-slide.is-active { display: block; }

.gp-questions-area{
    margin-top: 20px;
    padding: 0px 40px;
}

/* ── Question card
   One bordered box wrapping question text + image + options
── */
.gp-question-card {
    border: 1.5px solid var(--gp-border);
border-radius: 10px 10px 0px 0px;
    overflow: hidden;
    background: #fff;
}

/* Question text — sits at top of card, no own border */
.gp-question-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.65;
    color: var(--gp-text);
    padding: 20px 24px;
    border-bottom: 1.5px solid var(--gp-border);
    background: #fff;
}

/* Question image — inside the card, between text and options */
.gp-question-image {
    border-bottom: 1.5px solid var(--gp-border);
}
.gp-question-image img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #f9f9f9;
}

/* Checkbox hint — inside card, above options */
.gp-checkbox-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--gp-muted);
    padding: 12px 24px 0;
    margin: 0;
}

.gp-select-counter {
    font-weight: 600;
    color: var(--gp-navy);
    font-size: 13px;
}

/* ── Options — rows inside the card ── */
.gp-options {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    margin: 0;
    gap: 0;
}

.gp-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    cursor: pointer;
    transition: background .15s;
    outline: none;
    background: #fff;
    /* border-bottom: 1px solid var(--gp-border); */
}

.gp-option:last-child  { border-bottom: none; }
.gp-option:hover       { background: var(--gp-bg); }
.gp-option:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: -2px; }

/* Disabled option (max checkbox selections reached) */
.gp-option.is-disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Selected before submit */
.gp-option.is-selected {
    background: #eef2f8;
}

/* Lock after submit */
.gp-question-slide.is-submitted .gp-option {
    cursor: default;
    pointer-events: none;
    background: #fff;
}

/* ─── Post-submit option states ─── */

.gp-option.is-incorrect .gp-option-text   { font-weight: 700; }
.gp-option.is-incorrect .gp-option-letter { background: var(--gp-navy); color: #fff; }

.gp-option.is-correct .gp-option-text     { font-weight: 700; }
.gp-option.is-correct .gp-option-letter   { background: var(--gp-correct); color: #fff; }

.gp-option.is-missed .gp-option-text      { font-weight: 600; color: var(--gp-correct); }
.gp-option.is-missed .gp-option-letter    {
    background: transparent;
    color: var(--gp-correct);
    border: 2px solid var(--gp-correct);
}

/* ── Letter circle ── */
.gp-option-letter {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #374151;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    border: 2px solid transparent;
}

.gp-option.is-selected .gp-option-letter  { background: var(--gp-navy); color: #fff; }

/* ── Option text ── */
.gp-option-text { flex: 1; font-size: 14.5px; line-height: 1.4; color: var(--gp-text); }

/* ── Right icon ── */
.gp-option-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    visibility: hidden;
}

.gp-question-slide.is-submitted .gp-option.is-incorrect .gp-option-icon { visibility: visible; background: var(--gp-incorrect); }
.gp-question-slide.is-submitted .gp-option.is-correct   .gp-option-icon { visibility: visible; background: var(--gp-correct); }
.gp-question-slide.is-submitted .gp-option.is-missed    .gp-option-icon { visibility: visible; background: var(--gp-correct); }

/* ── Action buttons ── */
.gp-question-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    /* margin: 0 0 20px; */

    padding: 20px;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0px 0px 10px 10px;
}

.gp-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px;
    border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; border: 2px solid transparent;
    transition: background .15s, opacity .15s;
    text-decoration: none; font-family: inherit; line-height: 1;
}

.gp-btn-primary { background: var(--gp-navy); color: #fff; border-color: var(--gp-navy); }
.gp-btn-primary:hover:not(:disabled) { background: var(--gp-navy-dark); border-color: var(--gp-navy-dark); }
.gp-btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.gp-btn-outline { background: transparent; color: var(--gp-navy); border-color: var(--gp-navy); }
.gp-btn-outline:hover { background: #eef2f8; }

/* Submit hint (checkbox only) */
.gp-submit-hint {
    font-size: 13px;
    color: var(--gp-muted);
    font-style: italic;
}

/* ── Feedback ── */
.gp-feedback { margin-top: 20px; }

.gp-feedback-result {
    display: flex; align-items: center;
    gap: 12px; font-size: 15px; font-weight: 700;
    margin: 0 0 16px;
}
.gp-feedback-result.is-correct   { color: var(--gp-correct); }
.gp-feedback-result.is-incorrect { color: var(--gp-incorrect); }

.gp-feedback-icon {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.gp-feedback-result.is-correct   .gp-feedback-icon { background: var(--gp-correct); }
.gp-feedback-result.is-incorrect .gp-feedback-icon { background: var(--gp-incorrect); }

/* ── Explanation — grey box ── */
.gp-explanation {
    /* background: var(--gp-bg); */
    /* border: 1.5px solid var(--gp-border);
    border-radius: var(--gp-radius); */
    padding: 16px 20px;
    margin: 0 0 20px;
}

.gp-explanation strong {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--gp-muted); margin: 0 0 8px;
}

.gp-explanation-text { font-size: 14px; line-height: 1.65; color: var(--gp-text); }
.gp-explanation-text p  { margin: 0 0 10px; }
.gp-explanation-text p:last-child { margin-bottom: 0; }
.gp-explanation-text ul,
.gp-explanation-text ol { padding-left: 20px; margin: 0 0 10px; }
.gp-explanation-text li { margin-bottom: 4px; }
.gp-explanation-text strong { font-weight: 700; }
.gp-explanation-text em     { font-style: italic; }
.gp-explanation-text a      { color: var(--gp-navy); }

/* ============================================================
   RESULTS PAGE
   ============================================================ */

.gp-results-container {
    max-width: 1024px; padding: 20px 0; color: var(--gp-text);
}

.gp-results-header { margin: 0 0 24px; }
.gp-results-header h2 { font-size: 26px; font-weight: 800; color: var(--gp-navy); margin: 0 0 6px; }
.gp-results-header p  { color: var(--gp-muted); font-size: 14px; margin: 0; }

.gp-results-body {
    display: flex; align-items: stretch; gap: 40px;
    background: #fff;
    border-radius: var(--gp-radius); margin: 0 0 20px;
}

.gp-score-chart {
    position: relative; flex-shrink: 0;
    padding: 90px 70px;
    border: 1px solid #C2C7D11A;
    border-radius: 12px;
    box-shadow: 0px 12px 40px 0px rgba(24, 28, 32, 0.04);
}

.gp-score-chart svg {
    width: 256px;
    height: 256px;
}

.gp-score-chart svg circle {
    stroke-width: 6 !important;
}

.gp-score-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
}

.gp-score-fraction {
    font-size: 48px;
    font-weight: 900;
    color: #00355F;
    line-height: 48px;
}

.gp-score-pct {
    font-size: 18px;
    color: #42474F;
    margin-top: 5px;
    font-weight: 600;
    line-height: 28px;
}

.gp-results-stats {
    flex: 1;
    display: flex; flex-direction: column;
    gap: 12px; justify-content: space-between;
}

.gp-stat-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    height: 130px;
    background: white;
    border: 1px solid #C2C7D11A;
    box-shadow: 0px 1px 2px 0px #0000000D;
    border-radius: 8px;
}

.gp-stat-icon {
    border-radius: 8px;
    width: 64px;
    height: 64px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.gp-stat-score     .gp-stat-icon { background: var(--gp-navy); }
.gp-stat-correct   .gp-stat-icon { background: #F0FDF4; color: #16A34A; }
.gp-stat-incorrect .gp-stat-icon { background: #FEF2F2; }
.gp-stat-time      .gp-stat-icon { background: #EFF6FF; }

.gp-stat-content { display: flex; flex-direction: column; gap: 3px; }
.gp-stat-label   { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gp-muted); }
.gp-stat-value   { font-size: 22px; font-weight: 800; color: var(--gp-navy); line-height: 1; }

.gp-results-footer { display: flex; gap: 12px; margin-top: 8px; }

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

@media (max-width: 768px) {
    .gp-quiz-container { flex-direction: column; }

    .gp-sidebar {
        width: 100%; min-width: unset;
        border-right: none; border-bottom: 1px solid var(--gp-border);
        padding: 14px 0 10px;
    }

    .gp-sidebar-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }

    .gp-sidebar-item {
        padding: 5px 10px; border-radius: 20px;
        border: 1px solid var(--gp-border); gap: 6px; font-size: 12px;
    }

    .gp-sidebar-item.is-active { border-color: var(--gp-navy); background: #eef2f8; }
    .gp-sidebar-label { display: none; }

    .gp-quiz-main  { padding: 20px 16px; }
    .gp-quiz-title { font-size: 22px; }

    /* Progress bar stacks on mobile */
    .gp-progress-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .gp-progress-bar-section { width: 100%; }

    .gp-option        { padding: 14px 16px; gap: 12px; }
    .gp-option-letter { width: 30px; height: 30px; font-size: 12px; }

    .gp-results-container { max-width: 100% !important; }
    .gp-results-body  { flex-direction: column; align-items: flex-start; gap: 24px; padding: 20px; }

    .gp-score-chart { padding: 40px; }
    .gp-score-chart svg { width: 200px; height: 200px; }
    .gp-score-fraction { font-size: 28px; }
    .gp-score-pct { font-size: 16px; }

    .gp-quiz-header,
    .gp-progress-wrap,
    .gp-questions-area{
        padding: 0px;
    }
}