.toldy-generator-container {
    width: 100%;
    max-width: none;
}

.toldy-app {
    width: 100%;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;

    background: var(--bg);
    color: var(--text);

    min-height: 100vh;

    width: 100%;
}

/* ================= THEMES ================= */

:root {
--bg: #111;
--text: #eee;
--hover-text: #111;
--card: #1e1e1e;
--accent: #2a2a2a;
--shadow: rgba(0,0,0,.18);
}

body.light {
--bg: #ffffff;
--text: #111111;
--hover-text: #eee;
--card: #f3f3f3;
--accent: #e9e9e9;
--shadow: rgba(0,0,0,.12);
}

/* ================= TOP BAR ================= */

.topbar-right {
position: fixed;
top: 10px;
right: 10px;
display: flex;
gap: 10px;
align-items: center;
}

.iconButton {
background: var(--card);
border: none;
padding: 6px 10px;
cursor: pointer;
color: var(--text);
border-radius: 6px;
}

.smallIcon {
width: 20px;
height: 20px;
}

.mediumIcon {
width: 40px;
height: 40px;
}

/* ================= LANGUAGE DROPDOWN ================= */

.langDropdown {
position: relative;
}

.langButton {
display: flex;
align-items: center;
gap: 6px;
background: var(--card);
border: none;
padding: 6px 10px;
cursor: pointer;
color: var(--text);
border-radius: 6px;
}

.langFlag {
    width: 24px;
    height: 16px;
    object-fit: cover;
}

.langMenu {
position: absolute;
top: 40px;
right: 0;
background: var(--card);
border-radius: 8px;
overflow: hidden;
min-width: 180px;
z-index: 10;
}

.langItem {
display: flex;
align-items: center;
gap: 8px;
padding: 8px;
cursor: pointer;
}

.langItem:hover {
    background: var(--accent);
    color: var(--hover-text);
}

/* ================= LAYOUT ================= */

.pageWrapper {
    min-height: calc(100vh - 60px);

    display: grid;
    place-items: center;

    padding: 80px 20px 20px 20px;
    box-sizing: border-box;
}

.mainContent {
    width: min(1000px, 100%);
    margin: 0;
}

.row {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.fieldBlock {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ================= LISTS ================= */

#listSelect {
    
    width: 100%;
    height:100%;
    box-sizing: border-box;
    padding: 10px;
    border-radius: 6px;
}

.listsContainer {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.listHeader {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    height: 60px;
}

.listHeader label {
    align-self: flex-end;
    font-size: 30px;
}

.listActions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    justify-self: end;
}

.listColumn {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;

}

.selectedLists {
    /*min-height: 120px;*/
    height:100%;
    padding: 10px;
    background: var(--card);
    border-radius: 6px;
}

.activeItem {
    display: flex;
    justify-content: space-between;
    padding: 4px;
    margin: 3px 0;
    background: var(--card);
}

/*List deleted (toasted :P) -> restore*/
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
}

.toast button {
    background: #3a7afe;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* ============ LIST-EDITOR =============== */
.listEditor {
    margin-top: 20px;
    background: var(--card);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editorHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editorBody {
    display: flex;
    gap: 15px;
}

.searchResults,
.selectedVocab {
    flex: 1;
    min-height: 200px;
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 6px;
    overflow-y: auto;
    cursor: pointer;
}


.selectedVocabContainer {
    flex: 1;
    min-width: 0;
}

#searchResults div:hover {
    background: #f2f2f2;
    cursor: pointer;
    color: var(--hover-text);
}

.searchItem {
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
}

.searchItem:hover {
    background: var(--accent);
}

.markedForRemoval {
    /*background: #ffd9d9;
    border-radius: 4px;*/

    background: #f2f2f2;
    cursor: pointer;
    color: var(--hover-text);
}

/*
search voc list
*/

.vocabWord, .vocabMeta {
    font-family: "Noto Sans KR", "Noto Sans", sans-serif;
}

.searchResultContent,
.selectedVocContent{
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
}

.vocabInfoButton{
    width:20px;
    height:20px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;
    /*border:1px solid rgba(255,255,255,.25);*/
    border:1px solid var(--accent);

    font-size:15px;
    font-weight:700;
    font-family:Arial, sans-serif;

    cursor:pointer;
    user-select:none;

    color:var(--text);
    opacity:.55;
    background:transparent;

    /*transition:all .15s ease;*/
    transition:
        opacity .15s ease,
        background-color .15s ease,
        border-color .15s ease;
}

.vocabInfoButton:hover{
    color:white;
    border-color:rgba(255,255,255,.7);
    background:rgba(255,255,255,.08);
}
/*
end search voc list
*/

/*
vocab info popup
*/
.vocabInfoPopup{
    position:absolute;
    min-width:260px;
    max-width:320px;

    background:var(--card);
    color: var(--text);
    border:1px solid var(--accent);
    border-radius:10px;

    padding:12px 14px;

    /*box-shadow:0 8px 24px rgba(0,0,0,.18);*/
    box-shadow:0 8px 24px var(--shadow);

    z-index:5000;
}

.vocabInfoPopup.hidden{
    display:none;
}

.vocabInfoTitle{
    font-size:22px;
    font-weight:bold;
}

.vocabInfoTranslation{
    color: var(--text);
    margin-top:2px;
    margin-bottom:10px;
}

.vocabInfoRow{
    display:flex;
    justify-content:space-between;
    margin:4px 0;
}

.vocabInfoLabel{
    color:var(--text);
    opacity: 0.7;
}

.vocabInfoValue{
    font-weight:bold;
}
/*---- mastery: ----*/
.masteryBox{
    text-align:center;
    margin-bottom:12px;
}

.masteryCircle{
    width:64px;
    height:64px;
    margin:0 auto 6px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--accent);
    color:var(--text);
    font-size:28px;
    font-weight:700;
}

.masteryLabel{
    font-size:13px;
    opacity:.7;
    margin-bottom:10px;
}

.masteryProgress{
    width:100%;
}

.masteryProgressBar{
    width:100%;
    height:10px;
    background:var(--accent);
    border-radius:10px;
    overflow:hidden;
    box-shadow:inset 0 1px 3px rgba(0,0,0,.25);
}

.masteryProgressFill{
    height:100%;
    background:#3b82f6;
    border-radius:10px;
    box-shadow:
        inset 0 1px 3px rgba(255,255,255,.3),
        0 0 8px rgba(59,130,246,.45);
    transition:
        width .3s ease;
}

.masteryPoints{
    font-size:12px;
    opacity:.7;
    margin-top:5px;
}

/*
end vocab info popup
*/

.editorTopBar {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}
.leftPanelHeader {
    flex: 1;
    display: flex;
    align-items: center;
}

.leftPanelHeader input {
    width: 70%;
    max-width: 300px;
}

#editConceptBtn, #fromEditorSearchEditConceptBtn {
    margin-left: auto;
}

.rightPanelHeader {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* =========================
   ADMIN VISIBILITY
   ========================= */
.hidden {
    display: none;
}

.adminOnly.hidden {
    display: none;
}

/* =========================
   LAYOUT SPLIT
   ========================= */
.editorBodySplit {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

/* =========================
   PANELS
   ========================= */
.leftPanel,
.rightPanel {
    flex: 1;
    border: 1px solid #333;
    padding: 10px;
    min-height: 220px;
    overflow-y: auto;
}

.leftPanelHeader {
    display: flex;
    align-items: center;
    gap: 6px;
}

.leftPanelHeader input {
    flex: 1;
}

.languageSections input.addWordInput {
    width: 100%;
    margin-top: 4px;
    margin-bottom:20px;
}

.activeWordEditor {
    margin-bottom:10px;
}

.wordNavigator
{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top: 10px;
    margin-bottom:10px;
}

.wordNavBtn
{
    width:32px;
    height:32px;
    flex-shrink:0;
}

.wordCollection
{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    flex:1;
    align-items:center;
}

/* =========================
         WORD CHIPS
   =========================
*/

.wordChip {
    background: #222;
    color: #fff;
    border:1px solid #666;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    gap: 6px;
    align-items: center;
    cursor:pointer;
}

.wordChip.active
{
    font-weight:bold;
    background: #575757;
}

.wordChip button {
    background: transparent;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
}

/* =========================
      FILLED INPUTS CHECK
   =========================
*/

.validField
{
    border: 2px solid #63c06b;
    box-shadow: 0 0 6px rgba(90,190,90,.25);
}

.invalidField
{
    border-color:#d45b5b;
}

input.requiredField
{
    border-color:#d49d3b;
}

.invalidChip
{
    border: 1px solid #d49d3b;
    /*background: #b69b66;*/
}


.sentencePreview {
    border: 1px solid #818181;
    border-radius: 8px;
    padding: 3px;
    margin-top: 5px;
    margin-bottom: 5px;
}

#sentencePreview
{
    opacity: 1;
    transition: opacity 0.5s ease;
}

#sentencePreview.fadeOut
{
    opacity: 0;
}

/* =========================
     LIVE SENTENCE PREVIEW
   ========================= */

#deLanguageBlockHead {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#deLanguageBlockHeadLeft {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
    gap: 10px; 
}

#deLanguageBlockHeadRight {
    text-align: left;
    flex: 2;
}

#enLanguageBlockHead {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#enLanguageBlockHeadLeft {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
    gap: 10px; 
}

#enLanguageBlockHeadRight {
    text-align: left;
    flex: 2;
}

#krLanguageBlockHead {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#krLanguageBlockHeadLeft {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
    gap: 10px; 
}

#krLanguageBlockHeadRight {
    text-align: left;
    flex: 2;
}

/* =========================
   LANGUAGE BLOCKS
   ========================= */
.languageBlock {
    border-top: 1px solid #444;
    margin-top: 20px;
    padding-top: 20px;
}

.languageBlock h3 {
    margin-bottom: 8px;
}

.langHeader {
    display: flex;
    align-items: center;
    gap: 8px; /* Abstand zwischen Flagge und Text */
    margin: 0;
}

.langHeader h3 {
    margin: 0;
    transform: translateY(+2px);
}

.langFlag {
    width: 35px;   /* nach Bedarf */
    height: auto;
}



.deLanguageBlock .wordHeaderBlock {
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.deLanguageBlock .nounBlock {
    border: 1px solid #818181;
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.deLanguageBlock .verbBlock {
    border: 1px solid #818181;
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.deLanguageBlock .adjectiveBlock {
    border: 1px solid #818181;
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* inputs */
.languageSections input {
    display: block;
    margin-bottom: 6px;
    width: 100%;
    max-width: 200px
}


.miniLabel {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 1px;
    display: block;
}

/* Word + label grouping */
.fieldGroup {
    margin-bottom: 10px;
}

/* rows for sg/pl */
.rowSplit {
    display: flex;
    gap: 10px;
    padding-top: 0px;
    margin-top: 0px;
    margin-bottom: 10px;
    line-height: 1;
}

.rowSplit > div {
    flex: 1;
}


.valueLabel {
    padding: 3px 3px;
    border: 1px solid #333;
    background: #111;
    min-height: 15px;
    font-size: 13px;
    max-width: 200px
    
}


/* =========================
   SEARCH RESULTS
   ========================= */

.searchRow {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.searchColumn {
    flex: 1;
}

/* concept editor - search results */
#conceptSearchResults,
#groupSearchResults {
    flex: 1;
    min-height: 200px;
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 6px;
    overflow-y: auto;
    cursor: pointer;
}



/* simple selectable items */
.resultItem {
    padding: 4px;
    cursor: pointer;
}

.resultItem:hover {
    background: #222;
}

/* =========================
   SEARCH RESULTS - wordInput
   ========================= */

.wordSearchPopup {
    position: fixed;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    overflow: hidden;
    z-index: 1000;
}


.wordSearchItem {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--accent);
}


.wordSearchItem:last-child {
    border-bottom: none;
}


.wordSearchItem:hover {
    background: var(--accent);
}


.wordSearchWord {
    font-weight: bold;
    font-size: 14px;
}


.wordSearchLabel {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}


.wordSearchConcepts {
    font-size: 13px;
    opacity: 0.9;
}


.wordSearchItem.newWord {
    font-style: italic;
    opacity: 0.8;
}

   /*
.wordSearchPopup {

    position: fixed;

    z-index: 1000;

    background: #fff;

    border: 1px solid #bdbdbd;

    border-radius: 8px;

    box-shadow: 0 4px 12px rgba(0,0,0,.15);

    overflow: hidden;
}

.wordSearchItem {

    padding: 10px;

    cursor: pointer;

    border-bottom: 1px solid #ececec;
}

.wordSearchItem:hover {

    background: #f4f4f4;
}

.wordSearchWord {

    font-weight: bold;
}

.wordSearchConcepts {

    font-size: .85em;

    color: #666;

    margin-top: 4px;
}

.wordSearchItem.newWord {

    font-weight: bold;
}*/

/* =========================
   SELECTED LISTS
   ========================= */
#selectedConceptWords,
#selectedGroups {
    margin-top: 10px;
    padding: 5px;
    border: 1px solid #222;
    min-height: 40px;
}

/* =========================
   BUTTON AREA
   ========================= */

.buttonRow {
display: flex;
gap: 20px;
margin-top: 25px;
align-items: left;
justify-content: flex-end;
}

button {
background: var(--card);
border: none;
padding: 8px 12px;
cursor: pointer;
color: var(--text);
border-radius: 6px;
}

button.primary {
background: #3a7afe;
color: white;
}

button.secondary {
background: #3a7afe;
color: white;
}

.headerButtons {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ================= OVERLAY ================= */

.overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.85);
display: flex;
justify-content: center;
align-items: center;
}

.hidden {
display: none;
}

/* SETTINGS OVERLAY */
.settingsBox {
    background: var(--card);
    padding: 20px;
    width: 700px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.tenseMatrix {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tenseRow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tenseCell {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
    cursor: pointer;
}
/*
.tenseCell input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;

    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 5px;

    display: grid;
    place-content: center;

    cursor: pointer;
    background: white;
}

.tenseCell input[type="checkbox"]:checked {
    background: #4a90e2;
    border-color: #4a90e2;
}

.tenseCell input[type="checkbox"]:checked::before {
    content: "";
    width: 10px;
    height: 10px;

    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 18%, 80% 0, 43% 62%);
    background: white;
}*/

.tenseCell {
    position: relative;
    display: flex;
    gap: 10px;

    padding: 10px;
    border-radius: 10px;

    cursor: pointer;

    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);

    transition: 0.15s ease;
}

/* checkbox verstecken */
.tenseCell input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* SELECTED STATE */
.tenseCell:has(input:checked) {
    border-color: rgba(70, 160, 120, 0.45);
    background: rgba(70, 160, 120, 0.14);
}

/* kleiner visueller Marker */
.tenseCell:has(input:checked)::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 8px;

    font-size: 12px;
    opacity: 0.5;
}

/* UNSELECTED hover */
.tenseCell:hover {
    background: rgba(0,0,0,0.05);
}

.tenseText {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.koreanHint {
    font-size: 12px;
    opacity: 0.6;
}
/* ================= TEST BOX ================= */
.testBox {
    background: var(--card);
    padding: 20px;
    width: 480px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* prevent layout jump */
.promptArea {
min-height: 80px;
}

/* ================= STATS ================= */

.statsArea {
display: flex;
justify-content: space-between;
font-size: 12px;
opacity: 0.85;
}

.statBlock {
display: flex;
align-items: center;
gap: 6px;
}

/* ================= INPUT ================= */

#testInput {
width: 100%;
box-sizing: border-box;
font-size: 16px;
padding: 10px;
}

/* ================= RESULT ================= */

.resultGrid {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rowLine {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.label {
    min-width: 140px;
    opacity: 0.7;
}

.value {
    flex: 1;
}

.testNote {
font-size: 13px;
opacity: 0.8;
margin-top: 4px;
}

.correctPart {
    color: #4caf50;
    font-weight: bold;
}

.wrongPart {
    color: #ff5252;
    font-weight: bold;
    /*text-decoration: line-through;*/
}

.missingPart {
    color: #d98c00;
    text-decoration: underline;
}

/* ================ DIALOGS ================ */
.confirmDialog {
    position: absolute;
    background: var(--card);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    min-width: 160px;
}

.confirmActions {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.dialog {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 9999;
}

.hidden {
    display: none;
}


/* ================ STATUS ================= */

.statusBar {
    margin-top: 12px;
    min-height: 24px;
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 10px;
}