/* De werkplaats van de moleculentekenaar (templates/moleculen/werkplaats.html).
 *
 * De tekeningen zelf dragen hun stijl ín de SVG (render.js), zodat een export
 * er buiten de app hetzelfde uitziet; hier staat alleen de schil eromheen:
 * het invoerveld met suggesties, de drie weergavekaarten, de opties, het
 * opslaanformulier en de bibliotheek in de zijbalk.
 */

.mol-werkplaats { display: flex; flex-direction: column; gap: var(--ruimte-4); }
.mol-invoerkaart { display: flex; flex-direction: column; gap: var(--ruimte-2); }
.mol-invoerveld { position: relative; }
.mol-invoer { font-size: var(--tekst-l); }

.mol-suggesties {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
    margin: 0; padding: var(--ruimte-1) 0; list-style: none;
    background: var(--kleur-oppervlak); border: 1px solid var(--kleur-rand); border-radius: var(--rond);
    box-shadow: var(--schaduw-2); max-height: 20rem; overflow: auto;
}
.mol-suggesties li {
    display: flex; align-items: baseline; gap: var(--ruimte-3);
    padding: var(--ruimte-2) var(--ruimte-3); cursor: pointer;
}
.mol-suggesties li:hover, .mol-suggesties li[aria-selected="true"] { background: var(--kleur-primair-zacht); }
.mol-suggesties__formule { font-size: var(--tekst-s); color: var(--kleur-tekst-zacht); }
.mol-suggesties__groep { margin-left: auto; font-size: var(--tekst-xs); color: var(--kleur-tekst-dof); white-space: nowrap; }

.mol-fout { margin: 0; font-size: var(--tekst-s); color: var(--kleur-fout); }
.mol-info { margin: 0; font-size: var(--tekst-s); color: var(--kleur-tekst-zacht); }
.mol-info strong { color: var(--kleur-tekst); }

.mol-weergaven { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ruimte-4); }
@media (max-width: 60rem) { .mol-weergaven { grid-template-columns: 1fr; } }
.mol-weergave { display: flex; flex-direction: column; gap: var(--ruimte-3); min-width: 0; }
/* Het 3D-vak krijgt de hele rij: groot voor het digibord. Een reactie is een
   brede rij, dus dan krijgen alle drie de kaarten de volle breedte. */
.mol-weergave--3d, .mol-weergaven--reactie .mol-weergave { grid-column: 1 / -1; }
.mol-weergave__kop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ruimte-2); }
.mol-weergave__titel { margin: 0; font-size: var(--tekst-m); font-weight: 600; }
.mol-knoppen { display: flex; flex-wrap: wrap; gap: var(--ruimte-1); }
.mol-knoppen .btn--gelukt { border-color: var(--kleur-goed); color: var(--kleur-goed); }
.mol-knoppen .btn--mislukt { border-color: var(--kleur-fout); color: var(--kleur-fout); }
.mol-knoppen .btn[aria-pressed="true"] { background: var(--kleur-primair-zacht); border-color: var(--kleur-primair); }

.mol-tekening {
    display: flex; align-items: center; justify-content: center; min-height: 14rem;
    padding: var(--ruimte-3); overflow: auto;
    background: var(--kleur-oppervlak-laag); border: 1px solid var(--kleur-rand); border-radius: var(--rond);
}
.mol-tekening svg { max-width: 100%; height: auto; max-height: 22rem; }
/* De modellen krijgen een vaste hoogte en vullen die: het kader om de tekening
   is rotatie-onafhankelijk (render.js, `kader: 'vast'`), dus tijdens het
   draaien verandert er niets aan de maat en verspringt de pagina niet. */
.mol-tekening--model { height: 22rem; }
.mol-tekening--model svg, .mol-tekening--3d svg { height: 100%; width: auto; max-width: 100%; max-height: 100%; }
.mol-tekening--3d { height: 30rem; cursor: grab; touch-action: none; user-select: none; }
.mol-tekening--3d:active { cursor: grabbing; }
.mol-tekening--structuur[data-klikbaar] text, .mol-tekening--structuur[data-klikbaar] rect.vak { cursor: pointer; }
.mol-tekening__leeg { font-size: var(--tekst-s); color: var(--kleur-tekst-dof); }

.mol-opties, .mol-masker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ruimte-2) var(--ruimte-4); font-size: var(--tekst-s); }
.mol-optie { display: inline-flex; align-items: center; gap: var(--ruimte-2); max-width: 100%; }
.mol-optie select { min-width: 0; }
.mol-optie > span { color: var(--kleur-tekst-zacht); }
.mol-optie--vink { cursor: pointer; }
.form-input--klein { padding: 0.2rem 0.5rem; font-size: var(--tekst-s); width: auto; max-width: 100%; }

.mol-formulier { display: flex; flex-direction: column; gap: var(--ruimte-3); }
.mol-formulier__rij { display: grid; grid-template-columns: 2fr 1.5fr 1fr; gap: var(--ruimte-3); }
@media (max-width: 48rem) { .mol-formulier__rij { grid-template-columns: 1fr; } }

.mol-geopend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ruimte-3); }
.mol-geopend__regel { margin: 0; font-size: var(--tekst-s); color: var(--kleur-tekst-zacht); }

/* De zijbalk: de bibliotheek per groep. */
.mol-groep { border-top: 1px solid var(--kleur-oppervlak-hoog); }
.mol-groep__kop {
    display: flex; align-items: center; gap: var(--ruimte-2);
    padding: var(--ruimte-2) 0; cursor: pointer; font-size: var(--tekst-s); font-weight: 600;
}
.mol-groep__aantal { margin-left: auto; font-weight: 400; color: var(--kleur-tekst-dof); }
.mol-groep[open] .mol-groep__kop { color: var(--kleur-primair); }
.mol-lijst { display: flex; flex-direction: column; gap: 0; margin: 0 0 var(--ruimte-2); padding: 0; list-style: none; }
.mol-lijst__item { display: flex; align-items: center; gap: var(--ruimte-1); border-radius: var(--rond-klein); }
.mol-lijst__item:hover { background: var(--kleur-oppervlak-laag); }
.mol-lijst__item--actief { background: var(--kleur-primair-zacht); }
.mol-lijst__link { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--ruimte-2); padding: var(--ruimte-1) var(--ruimte-1); color: inherit; text-decoration: none; font-size: var(--tekst-s); }
.mol-lijst__link:hover { text-decoration: none; }
.mol-lijst__formule { color: var(--kleur-tekst-zacht); }
.mol-lijst__triviaal { width: 100%; font-size: var(--tekst-xs); color: var(--kleur-tekst-dof); }

/* De balans van een reactie in de inforegel. */
.mol-info__ok { font-weight: 600; color: var(--kleur-goed); }
.mol-info__mis { font-weight: 600; color: var(--kleur-fout); }
