/* ============================================
   KlarText 🌲🌲 – B2 német felkészítő
   ============================================ */

/* ===== Alapok ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f5f6fa;
  color: #2b2b2b;
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

/* ===== Fejléc / logó ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 3px solid;
  border-image: linear-gradient(to right, #1a1a1a 33%, #DD0000 33% 66%, #FFCE00 66%) 1;
  margin-bottom: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-fak {
  font-size: 2.2rem;
  line-height: 1;
}

h1 {
  font-size: 1.6rem;
  color: #1a1a1a;
  letter-spacing: 1px;
}

.alcim {
  font-size: 0.8rem;
  color: #999;
}

.fejlec-jobb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.streak {
  background: #fff3e0;
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
}

.telepit-gomb {
  background: #FFCE00;
  color: #1a1a1a;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.telepit-gomb:hover { filter: brightness(0.95); }
.telepit-gomb:active { filter: brightness(0.88); }

.offline-jelzes {
  background: #e6f4ea;
  border: 1px solid #2e7d32;
  color: #1b5e20;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ===== Figyelmeztetés ===== */
.figyelmeztetes {
  background: #fff8e1;
  border: 1px solid #f0c36d;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== Fülváltó ===== */
.modvalto {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.mod-gomb {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.95rem;
  border: 2px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

.mod-gomb:hover { background: #eceff3; }

.mod-gomb.aktiv {
  background: #1a1a1a;
  color: #fff;
}

.mod-gomb.aktiv:hover { background: #1a1a1a; }

/* ===== Szűrők ===== */
.tema-gombok {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.tema-gomb {
  padding: 8px 14px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
}

.tema-gomb:hover {
  background: #f2f2f2;
  border-color: #1a1a1a;
}

.tema-gomb.aktiv {
  background: #DD0000;
  color: #fff;
  border-color: #DD0000;
}

.tema-gomb.aktiv:hover {
  background: #DD0000;
  border-color: #DD0000;
}

#kereso {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* Találatszám a kártyalista fölött */
.talalat-szam {
  font-size: 0.8rem;
  color: #999;
  text-align: right;
  margin-bottom: 6px;
}

/* ===== Kártyák (Témakörök fül) ===== */
.kartya {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.kartya-fejlec {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.nemet {
  font-size: 1.15rem;
  font-weight: bold;
  color: #1a1a1a;
}

.magyar { margin-top: 4px; }

.kiejtes {
  margin-top: 4px;
  font-style: italic;
  color: #888;
  font-size: 0.9rem;
}

.hang-gombok {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.hang-gomb {
  border: none;
  background: #eceff3;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1rem;
  cursor: pointer;
}

.hang-gomb:active { background: #d5d9e0; }

.nyelvtan-nyito {
  margin-top: 10px;
  background: none;
  border: none;
  color: #DD0000;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  display: block;
}

.nyelvtan {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fdf3f3;
  border-left: 3px solid #DD0000;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Alcsoport-címke a kártyákon */
.altema-cimke {
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

/* Példamondat a kártyákon */
.pelda {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f4f4f6;
  border-left: 3px solid #1a1a1a;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #444;
}

.pelda .hang-gomb {
  padding: 6px 10px;
  min-width: 32px;
  min-height: 32px;
  font-size: 0.85rem;
  margin-left: 4px;
  vertical-align: middle;
}

.pelda-magyar {
  color: #888;
  font-size: 0.85rem;
  margin-top: 3px;
}

/* Többsoros szövegek (pl. dialógusok) sortörésének megőrzése */
.nemet, .gy-nemet, .magyar {
  white-space: pre-line;
}

.gy-pelda {
  margin-top: 14px;
  padding: 8px 10px;
  background: #f4f4f6;
  border-left: 3px solid #1a1a1a;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #444;
  text-align: left;
}

.gy-pelda .hang-gomb {
  padding: 6px 10px;
  min-width: 32px;
  min-height: 32px;
  font-size: 0.85rem;
  margin-left: 4px;
  vertical-align: middle;
}

/* ===== Nyelvtan fül ===== */
.nyelvtan-kartya {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
}

.nyelvtan-fejlec {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.nyelvtan-cim {
  font-size: 1.1rem;
  font-weight: bold;
  color: #1a1a1a;
}

.nyelvtan-nyil {
  color: #DD0000;
  font-size: 0.9rem;
}

.nyelvtan-tartalom {
  padding: 0 16px 16px;
}

.nyelvtan-osszefoglalo {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.nyelvtan-osszefoglalo table {
  border-collapse: collapse;
  margin: 8px 0;
  width: 100%;
}

.nyelvtan-osszefoglalo th,
.nyelvtan-osszefoglalo td {
  border: 1px solid #ddd;
  padding: 6px 10px;
  font-size: 0.9rem;
  text-align: left;
}

.nyelvtan-osszefoglalo th {
  background: #eceff3;
  color: #1a1a1a;
}

.peldak-cim {
  font-size: 0.8rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.pelda-sor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
}

.pelda-szoveg { flex: 1; }

.pelda-szoveg .pelda-nemet {
  font-weight: 600;
  color: #1a1a1a;
}

.pelda-szoveg .pelda-magyar {
  color: #777;
  font-size: 0.9rem;
}

/* ===== Gyakorló feladatok fül ===== */
.gyakorlo-valaszto {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.gyakorlo-valaszto label {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
}

#gy-tema-valaszto {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  color: #2b2b2b;
  cursor: pointer;
}

.gyakorlo-statusz {
  text-align: center;
  margin-bottom: 10px;
  color: #888;
  font-size: 0.9rem;
}

.gyakorlo-kartya {
  background: #fff;
  border-radius: 16px;
  padding: 28px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}

.gy-tema {
  font-size: 0.8rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.gy-magyar {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.gy-nemet {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.gy-kiejtes {
  font-style: italic;
  color: #888;
  margin-bottom: 12px;
}

.gy-nyelvtan {
  margin-top: 16px;
  padding: 10px 12px;
  background: #fdf3f3;
  border-left: 3px solid #DD0000;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  text-align: left;
  line-height: 1.5;
}

#gyakorlo-mod .hang-gombok { justify-content: center; }

.felfed-gomb {
  margin-top: 20px;
  padding: 14px 28px;
  font-size: 1.05rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.felfed-gomb:hover, .ertekelo-gomb:hover { filter: brightness(1.08); }

.ertekeles {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.ertekelo-gomb {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

.tudtam { background: #f5e9b8; color: #6b5400; }
.nemtudtam { background: #fbdcde; color: #b0121b; }

/* ===== Nyelvtan fül – interaktív leckék ===== */
.nyelvtan-cim-blokk {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.nyelvtan-alcim {
  font-size: 0.82rem;
  font-weight: normal;
  color: #888;
  font-style: italic;
}

.nyelvtan-szekcio-cim {
  font-size: 0.95rem;
  font-weight: bold;
  color: #1a1a1a;
  margin: 18px 0 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid #eceff3;
}
.nyelvtan-tartalom > .nyelvtan-szekcio-cim:first-child { margin-top: 4px; }

/* Nyelvi logika: a magyar és a német szemlélet ütköztetése */
.nyelvi-logika {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.logika-blokk {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.logika-blokk p { margin-top: 4px; }

.logika-cimke {
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logika-magyar {
  background: #fdf3f3;
  border-left: 4px solid #DD0000;
}
.logika-magyar .logika-cimke { color: #DD0000; }

.logika-nemet {
  background: #fdf8e3;
  border-left: 4px solid #b38f00;
}
.logika-nemet .logika-cimke { color: #b38f00; }

/* Ragozási / összefoglaló táblázat a szabálykártyákon */
.szabaly-tabla-gorgeto {
  overflow-x: auto;
  margin: 8px 0;
}

.szabaly-tabla {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  background: #fff;
}

.szabaly-tabla th,
.szabaly-tabla td {
  border: 1px solid #dfe2e8;
  padding: 7px 10px;
  text-align: left;
  white-space: nowrap;
}

.szabaly-tabla th {
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
}

.szabaly-tabla tbody tr:nth-child(even) { background: #f4f4f6; }

/* Szabálykártyák */
.szabaly {
  background: #f7f7f9;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.szabaly-cim {
  font-weight: bold;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.szabaly-magyarazat {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 8px 0;
}

/* Képlet (LaTeX-stílusú) */
.keplet {
  font-family: "Cambria Math", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
  margin: 8px 0;
  overflow-x: auto;
  white-space: nowrap;
}
.keplet sub { font-size: 0.7em; }
.keplet sup { font-size: 0.7em; }
.keplet-valaszto { color: #b3b3b3; padding: 0 8px; }

.szabaly-tipp {
  background: #fff8e1;
  border-left: 4px solid #FFCE00;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 8px;
}

/* Példamondat kontextusa */
.pelda-kontextus {
  color: #666;
  font-size: 0.85rem;
  margin-top: 4px;
  line-height: 1.5;
}

/* Tipikus hibák */
.hiba {
  background: #fff;
  border: 1px solid #f0dcdc;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.hiba-rossz {
  color: #b0121b;
  text-decoration: line-through;
  font-weight: 600;
}

.hiba-jo {
  color: #2e7d32;
  font-weight: 600;
  margin-top: 4px;
}

.hiba-magyar {
  font-size: 0.88rem;
  color: #555;
  margin-top: 6px;
}

.hiba-miert {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-top: 6px;
  color: #333;
}

/* Kvíz */
.kviz-kerdes {
  background: #f7f7f9;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.kviz-szoveg {
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
}

.kviz-opciok {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kviz-opcio {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #ccced6;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}

.kviz-opcio:hover { background: #f0f0f3; }

.kviz-kerdes.megvalaszolt .kviz-opcio { cursor: default; }

.kviz-opcio.helyes {
  background: #d9f2e3;
  border-color: #2e7d32;
  color: #1b5e20;
  font-weight: 600;
}

.kviz-opcio.helytelen {
  background: #fbdcde;
  border-color: #b0121b;
  color: #b0121b;
}

.kviz-visszajelzes {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e1;
  border-left: 4px solid #FFCE00;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ===== Vissza a tetejére gomb ===== */
.fel-gomb {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 100;
}

.fel-gomb:hover { filter: brightness(1.4); }

/* ===== Egyéb ===== */
.rejtett { display: none !important; }

footer {
  text-align: center;
  color: #aaa;
  font-size: 0.85rem;
  margin: 24px 0 12px;
}

footer a { color: #1a1a1a; }
