:root {
  --blue: #506ba0;
  --bluelight: color-mix(in srgb, #506ba0, white 90%);
}


html, body {
	height: 100%;
  margin: 0;
  padding: 0;
	font-family: Arial, Helvetica, sans-serif;
	background-color: var(--bluelight);
	overflow: hidden;
}

/* ---  LAYOUT der Seite starten ------------------- */

.page {
	height: 100%;
	display: grid;
	grid-template-columns: 280px 1fr;
	grid-template-rows: auto minmax(0, 1fr) auto;
	grid-template-areas:
	    "header header"
	    "navigation content"
	    "footer footer";
	/*column-gap: 10px; */
}

#AfgModal {
  position: fixed;
  z-index: 1;
  left: 200px;
  top: 10px;
  width: 80%;
  height: 90vh;
	border-radius: 15px;
	z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
	display: flex;
	  flex-direction: column;

	  overflow: hidden;   
  /*transition: opacity 0.3s ease, visibility 0.3s ease;*/
}

/* Sichtbarer Zustand */
#AfgModal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
	background-color: #9fb7e0;
}

#AfgModalContent {
	position: relative;
	flex: 1;
  width: 100%;
	margin-right:20px;
  padding: 5px 10px;
  border-radius: 8px;
	z-index: 3;
	min-height: 0;
	overflow-y: auto;
	
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

#closeModal {
    position: absolute;
    top: 5px;
    right: 15px;
    width: 25px;
    height: 25px;
    background-color: red;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
		z-index: 4;
}


/* HEADER */
.header {
	grid-area: header;
	height: 60px;
	margin: 0;
	background: #506ba0;
	padding-left: 20px;
	color: white;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.logo {
	display: flex;
	align-items: center;
	font-size: 14px;
}

.headline {
	font-size: 24px;
	padding-left: 30px;	
}

.login a {
	color: white;
	text-decoration: none;
}

#inhalt {
	font-size: 20px;
	color: #222;
	margin-left: 1px;
	padding-bottom: 6px;
}

.navigation {
	grid-area: navigation;
	margin: 0;
	border-right: 1px solid #e5e7ef;
	padding-right: 15px;
	padding-top: 0px;
	padding-left: 5px;
	overflow-x: auto;
	overflow-y: auto;
	min-width: 0;
}

.navigation-inner {
	padding-top: 35px;
}

/* --- padding: top right bottom left --- */
.inhalte {
	grid-area: content;
	box-sizing: border-box;
	overflow-y: auto;
	min-height: 0;
	line-height: 1.55;
}

.inhalte-inner {
		padding: 20px 35px 20px 10px;
    max-width: 70ch;
    margin: 0 auto;
		
}

.inhalte-inner ul,
.inhalte-inner ol,
.inhalte-inner table,
.inhalte-inner pre,
.inhalte-inner .example {
    max-width: none;
}

.inhalte-inner ol {
    margin-left: 1.5em;
}

.inhalte-inner li {
    margin-bottom: 0.4em;
}

.lit {
	margin: 0px;
  padding-left: 30px;
	text-indent: -30px;
}

/* FOOTER */
.footer{
	height: 33px;
	grid-area: footer;
	background: #506ba0;
	color: #EEE;
  display: flex;
  justify-content: space-between;
  align-items: center;
	padding-left: 25px;
	padding-right: 25px;
	margin: 0;
  font-size: 0.9rem;
}

.footer * {
  margin-top: 0;
  margin-bottom: 0;
}

/* Links */
.footer-left a{
  color: #EEE;
  text-decoration: none;
}

.footer-left a:hover{
  color: #FFF;
}

/* Rechts */
.footer-right a{
  color: #EEE;
  text-decoration: none;
}

.footer-right a:hover{
  color: #FFF;
}

/* Responsive */
@media (max-width:700px){
  .footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

}

sub {
    font-size: 0.7em;
    vertical-align: baseline;
    position: relative;
    bottom: -0.3em; 
		margin-right: 0.15em;
}

/* ---  LAYOUT der Seite ist fertig ------------------- */


/* ---------- Baumstruktur: Navigations-Menü ---------- */
.tree-node {
    position:relative;
    padding-left: 6px;
}

.tree-node.active > .tree-label {
    background: #506ba0;
		color: #FFF;
    border-radius:4px;
    font-weight:600;
}

.tree-node.active > .tree-label .tree-title {
  background: #506ba0;
	color: #FFF;
}


/* vertikale Linie */
.tree-node::before {
    content:"";
    position:absolute;

    left:0;
    top:-6px;
    bottom:-6px;

    width:1px;
    background:#e0e0e0;
}


/* letzter Eintrag beendet die Linie */

.tree-node:last-child::before {
    bottom:50%;
}


/* ---------- Untermenü ---------- */
.tree-children{
    margin-left:4px;
    padding-left:4px;
    max-height:0;
    overflow:hidden;
    transition:max-height 0.6s ease;
}

.navigation > .tree-node:first-child > .tree-label::before {
    left:-5px;
}

.navigation > .tree-node:first-child::before {
    top:16px;
}


/* geöffnetes Menü */
.tree-node.open > .tree-children{
    max-height:2000px;
}


/* ---------- Menüeintrag ---------- */
.tree-label{
    position:relative;
    padding:6px 0 6px 16px;
    cursor:pointer;
}


/* horizontale Verbindungslinie */
.tree-label::before{
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    width: 12px;
    height: 1px;

    background:#e0e0e0;
}


/* Hover-Effekt */
.tree-label:hover {
    background: #eef2ff;
    border-radius: 4px;
}


/* ---------- Pfeil ---------- */
.tree-arrow {
    font-size: 11px;
    color: #777;
    display: inline-block;
    width: 12px;
    transition: transform 0.2s ease;
}


/* Pfeil drehen */
.tree-node.open > .tree-label .tree-arrow {
    transform: rotate(180deg);
}

.tree-node.active > .tree-label .tree-arrow {
    color: #FFF;
}

/* =========================
   Login Fenster
   ========================= */
.login-wrapper {
    display:flex;
    justify-content:center;
    align-items:flex-start;
    padding-top:80px;
    height:100%;
}

.login-box {
    width:320px;
    padding:30px;
    background:#ffffff;
    border-radius:8px;
    box-shadow:0 4px 12px rgba(0,0,0,0.12);
}

.login-box h2 {
    margin-top:0;
    margin-bottom:20px;
}

.login-field {
    margin-bottom:16px;
}

.login-field label {
    display:block;
    font-size:14px;
    margin-bottom:4px;
}

.login-field input {
    width:100%;
    padding:8px;
    border:1px solid #ccc;
    border-radius:4px;
}

.login-actions {
    margin-top:20px;
}

.login-actions button {
    width:100%;
    padding:10px;
    border:none;
    background:#506ba0;
    color:white;
    border-radius:4px;
    cursor:pointer;
}

.login-actions button:hover {
    background:#3f5584;
}

.login-cancel{
    display:block;
    text-align:center;
    margin-top:10px;
    padding:8px;
    background:#e5e7eb;
    color:#333;
    border-radius:4px;
    text-decoration:none;
}

.login-cancel:hover{
    background:#d1d5db;
}

/* --- Concepts-Darstellung ------------------- */
.concept-buttons {
    margin-top:20px;
    display:flex;
    gap:10px;
}

.concept-buttons button {
    padding:8px 14px;
    border:none;
    border-radius:4px;
    background:#506ba0;
    color:white;
    cursor:pointer;
}

.concept-buttons button:hover {
    background:#3f5584;
}


/*--- START: Tooltip ---*/
@keyframes tooltipFadeIn {
  from {opacity: 0}
  to {opacity: 1}
}

.tooltip-popup {
    position: fixed;
    z-index: 10000;
    background: #444;
		color: #FFF;
    border: 1px solid #bbb;
    padding: 10px;
    max-width: 420px;
    max-height: 70vh;
    overflow-y: auto;
		border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    line-height: 1.45;
    font-size: 0.95rem;
    pointer-events: auto;
		animation: tooltipFadeIn 1s;
}
/*--- ENDE: Tooltip ---*/



/*--- START: ol-Nummerierung ---*/

/* --- linguistische Beispielnummerierung --- */
.inhalte {
    counter-reset: beispiel;
}

.inhalte ol {
    list-style: none;
    padding-left: 2.5em;
}

/* Ebene 1: (1) */

.inhalte ol {
    counter-reset: ex;
}

.inhalte ol > li {
    counter-increment: beispiel;
    position: relative;
}

.inhalte ol > li::before {
    content: "(" counter(beispiel) ") ";
    position: absolute;
    left: -2.5em;
}

/* Ebene 2: a. */

.inhalte ol > li > ol {
    counter-reset: subex;
}

.inhalte ol > li > ol > li {
    counter-increment: subex;
    position: relative;
}

.inhalte ol > li > ol > li::before {
    content: counter(subex, lower-alpha) ". ";
    position: absolute;
    left: -2em;
}


/* Ebene 3: i. */

.inhalte ol > li > ol > li > ol {
    counter-reset: subsubex;
}

.inhalte ol > li > ol > li > ol > li {
    counter-increment: subsubex;
    position: relative;
}

.inhalte ol > li > ol > li > ol > li::before {
    content: counter(subsubex, lower-roman) ". ";
    position: absolute;
    left: -2em;
}

.inhalte li {
    display: block;
}

.inhalte li:has(.rechts) {
    display: flex;
    align-items: baseline;
}

.inhalte .satz {
    flex: 1;
}

.inhalte .rechts {
    white-space: nowrap;
    margin-left: 1em;
}

/* --- Beispiel:
<li>
<span class="satz">Gestern hat Scholz mit Biden gesprochen.</span>
<span class="rechts">(Deklarativsatz)</span>
</li>
 --- */
/* --- Ende --- */
/*--- ENDE: ol-Nummerierung ---*/


/* --- START: Darstellung der Übungsaufgaben --- */
.uebung {
	border: solid 1px #506ba0;
	border-radius: 8px;
	padding: 10px;
	margin-bottom: 5px;
	background: #FFF;
}

.uebung:hover {
	border: solid 1px #506ba0;
	background: #506ba0;
	color: #FFF
}

/* --- ENDE: Darstellung der Übungsaufgaben --- */

/* --- START: Suchfeld --- */
#searchBox{
  position:relative;
	display: inline-block;
  max-width:260px;
  width:100%;
	padding-right: 20px;
}

#conceptSearch{
  width:100%;
  box-sizing:border-box;
}

.searchResults {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.searchResults:empty{
  display:none;
}

.searchItem {
	padding: 6px 10px;
	cursor: pointer;
	color: #222;
  font-size: 0.9rem;
	font-weight: normal;
}

.searchItem:hover {
    background: #f0f0f0;
}

.searchItem.active{
  background:#dfe8ff;
  outline:1px solid #9fb4ff;
}

.searchHighlight{
  font-weight:bold;
  color:#2a4fb0;
}
/* --- ENDE: Suchfeld --- */

