/* =============================================================================
   NMR practice — shared styles for the four NMR skill pages
   (proton-nmr-signals, carbon-nmr-signals, equivalent-protons, splitting-patterns).
   Shared generic styles (buttons, .answer-lead, .score-container-local,
   .common-questions, .next-ready, .disabled, .link-button) come from main.css.
   ============================================================================= */

/* --- Sub-nav strip (injected by nmr-practice.js into #nmr-subnav) --- */
.nmr-subnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    margin: 0.25em auto 0.75em;
    font-size: 0.85rem;
}

.nmr-subnav-label {
    color: #666;
    font-weight: 600;
}

/* Plain text links — deliberately NOT pill-shaped, so the page nav can't be
   mistaken for the difficulty filter pills below. */
.nmr-subnav-link {
    color: #6153cc;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nmr-subnav-link:hover {
    color: #4a3fa3;
}

.nmr-subnav-current {
    color: #222;
    font-weight: 700;
}

.nmr-subnav-sep {
    color: #999;
}

/* Count pages put the compound name inside the question text; the standalone
   name line still feeds bookmarks, so hide it without emptying it. */
.visually-hidden-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- Filter pill rows (difficulty only) --- */
.filter-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-bottom: 1rem;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.pill-row-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    margin-right: 4px;
}

.filter-pill {
    padding: 5px 14px;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    background: #fff;
    color: #555;
    transition: all 0.15s;
}

.filter-pill:hover {
    border-color: #6153cc;
    color: #6153cc;
}

.filter-pill.active {
    background: #6153cc;
    border-color: #6153cc;
    color: #fff;
}

/* --- Compound name / prompt --- */
#compound-name {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    font-weight: 600;
    margin: 0.25em 0;
    min-height: 1.2em;
}

#prompt-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    margin: 0.5em auto;
    text-align: center;
    max-width: 620px;
}

/* --- Molecule display area --- */
#molecule-area {
    position: relative;
    width: 450px;
    height: 350px;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    margin: 1em auto;
    user-select: none;
    flex-shrink: 0;
}

#mol-container {
    width: 100%;
    height: 100%;
}

#mol-container svg {
    width: 100%;
    height: 100%;
}

#selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* --- Atom hit targets (click_equivalent) --- */
.atom-hit-target {
    fill: transparent;
    stroke: none;
    pointer-events: all;
    cursor: pointer;
}

/* hover-capable devices only: on touch, :hover sticks to the last-tapped
   atom until the next tap, leaving a ghost shade after deselection */
@media (hover: hover) {
    .atom-hit-target:hover {
        fill: rgba(97, 83, 204, 0.12);
    }
}

.selected-atom,
.probe-atom {
    pointer-events: none;
}

/* --- Legend row (group color-coding on reveal) --- */
#legend-row,
.legend-row {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0.5em auto 0.75em;
    max-width: 620px;
}

#legend-row.visible,
.legend-row.visible {
    display: flex;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 14px;
    background: #f4f4f6;
    border: 1px solid #e0e0e6;
    font-size: 0.82rem;
    color: #333;
    font-weight: 600;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Controls --- */
#guess-controls {
    margin: 1em 0;
    text-align: center;
}

#primary-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#numeric-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#numeric-label {
    font-weight: 600;
    color: #444;
}

#answer-input {
    width: 90px;
    padding: 8px 10px;
    font-size: 1.05rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
}

#answer-input:focus {
    outline: none;
    border-color: #6153cc;
}

#check-btn {
    background-color: #2a9d8f;
    min-width: 120px;
}

/* --- Multiple-choice buttons (splitting) --- */
#choice-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.choice-btn {
    padding: 8px 14px;
    min-width: 46px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.choice-btn:hover:not(:disabled) {
    border-color: #6153cc;
    color: #6153cc;
}

.choice-btn:disabled {
    cursor: default;
}

.choice-btn.choice-correct {
    background: #2a9d8f;
    border-color: #2a9d8f;
    color: #fff;
}

.choice-btn.choice-wrong {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}

#secondary-controls {
    margin-top: 0.75em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#skip-next-btn {
    background-color: #bbc8ca;
    min-width: 100px;
}

#skip-next-btn.next-ready {
    background-color: #333;
}

/* --- Feedback --- */
#feedback-message {
    min-height: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0.5em 0;
    text-align: center;
}

#feedback-message.correct {
    color: #2a9d8f;
}

#feedback-message.incorrect {
    color: #d32f2f;
}

/* --- Explanation / key notes --- */
#explanation-area {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
    margin: 1em auto;
    padding: 1em;
    max-width: 620px;
    background: #f8f8f8;
    border-radius: 8px;
}

#explanation-area.visible {
    display: flex;
}

.explanation-text {
    margin: 0;
    line-height: 1.5;
    color: #333;
    text-align: center;
}




/* --- Reveal link --- */
#reveal-link {
    display: block;
    text-align: center;
    margin: 0.25em 0;
    font-size: 0.9rem;
}

#reveal-link.disabled {
    pointer-events: none;
    opacity: 0.4;
}

/* --- Global stats --- */
#global-stats {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    margin-top: 0.4em;
}

/* --- Responsive --- */
@media (max-width: 500px) {
    #molecule-area {
        width: 100%;
        height: 300px;
    }

    #prompt-text {
        font-size: 1.05rem;
    }

    .pill-row-label {
        width: 100%;
        text-align: center;
        margin: 0;
    }
}

.key-note {
    background: #fff8ec;
    border: 1px solid #f0d9a8;
    border-radius: 6px;
    padding: 0.5em 0.9em;
    font-size: 0.92rem;
}
