/* =========================
   main.css – Basis-Styles
   ========================= */

/* ----------- Reset ----------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --------- Grundlayout --------- */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

/* Wrapper für Sidebar + Content */
#app {
  display: flex;
  min-height: 100vh;
}





/* Label oben, Wert darunter (in eigenen Zeilen) */
.sidebar p strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 900;
  color: #442c8b;
}

/* Wert-Text in separatem Block */
.sidebar p span {
  display: block;      /* macht den Wert block-level, damit darunter steht */
  font-weight: 600;
  color: #301e6f;
  font-size: 1.1rem;
}

/* Jeder Paragraph mit Abstand unten */
.sidebar .profile-text p {
  margin-bottom: 18px;
  font-size: 1rem;
  line-height: 1.4;
  color: #6549d5;
  font-weight: 600;
  border-left: 4px solid #6549d5;
  padding-left: 12px;
}

/* Label fett, eigene Zeile */
.sidebar .profile-text p strong {
  display: block;
  font-weight: 900;
  font-size: 1.1rem;
  color: #442c8b;
  margin-bottom: 6px;
}

/* kleiner, dezenter Untertext */
.sidebar .profile-text p .small-label {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: #a0a0c5;  /* dezentes Grau-Blau */
  margin-bottom: 6px;
  padding-left: 0;
  border: none;
}

/* Wert (z.B. Kreditkartennummer) normal groß */
.sidebar .profile-text p span:not(.small-label) {
  font-weight: 700;
  font-size: 1.15rem;
  color: #301e6f;
  display: block;
}

/* --------- Hauptbereich mit Navigation oben --------- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin: 20px;
  margin-left: 10px;
  box-sizing: border-box;
  margin: 20px 0 20px 280px;

}

/* --------- Horizontale Navigation (oben) --------- */
.tabs-nav {
  position: sticky;
 /* top: 30px; /* Abstand zum oberen Rand, ggf. anpassen */
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: #fff;
  margin: 0px 0 0px 0px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(83, 51, 181, 0.12);
  margin-bottom: 30px;
  flex-wrap: wrap;
  width: 100%;
}

.tabs-nav .tab-btn {
  background: #ece7fa;
  color: #6549d5;
  font-weight: 600;
  border: none;
  border-radius: 20px;
  padding: 10px 26px;
  font-size: 1.05em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  
}

.tabs-nav .tab-btn.active,
.tabs-nav .tab-btn:hover {
  background: #6549d5;
  color: white;
}

#logout-btn {
  margin-left: auto;
  background: #ff5959;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 26px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease;
}

#logout-btn:hover {
  background: #d64545;
}

/* --------- Content Bereich --------- */
.content {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(83, 51, 181, 0.12);
  padding: 30px 40px;
  min-height: 70vh;
  overflow-y: auto;
}

/* --------- Navigation (für Tabs im Content falls gebraucht) --------- */
nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 16px 10px 16px;
  background: #fff;
  border-bottom: 1.5px solid #e0dcf5;
  box-shadow: 0 1px 6px #a782e214;
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .tab-btn {
  background: #ece7fa;
  color: #6549d5;
  font-weight: 600;
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 10px 30px;
  font-size: 1.08em;
  cursor: pointer;
  margin-right: 2px;
  transition: background .18s, color .18s;
}

nav .tab-btn.active,
nav .tab-btn:hover {
  background: #bb9cf7;
  color: #fff;
}

nav #logout-link {
  margin-left: auto;
  color: #999;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 18px;
  border-radius: 8px;
  background: #f5f7fa;
  transition: background 0.15s, color 0.15s;
}

nav #logout-link:hover {
  background: #ffe4e4;
  color: #d23;
}

/* --------- Standard-Headings --------- */
h1, h2, h3 {
  color: #6549d5;
  font-family: inherit;
  margin-bottom: 1em;
  line-height: 1.15;
  font-weight: 700;
}
h1 {
  font-size: 2.1em;
text-align: center;
}
h2 {
  font-size: 1.4em;
}
h3 {
  font-size: 1.15em;
}
p {
  margin-bottom: 1em;
}
a {
  color: #6848e7;
  text-decoration: underline;
  transition: color .18s;
}
a:hover, a:focus {
  color: #402c8b;
}

/* --------- Formulare/Inputs --------- */
input, select, textarea, button {
  font-family: inherit;
  font-size: 1em;
}
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"], textarea {
  border: 1.3px solid #e2d7fa;
  border-radius: 8px;
  padding: 10px 13px;
  background: #f7f7fc;
  transition: border 0.2s, background 0.2s;
  margin-bottom: 1em;
}
input:focus, textarea:focus {
  border-color: #a782e2;
  background: #fff;
  outline: none;
}
button, .btn {
  display: inline-block;
  background: #6549d5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 26px;
  font-weight: bold;
  font-size: 1.07em;
  cursor: pointer;
  box-shadow: 0 1px 4px #a782e218;
  transition: background 0.21s, color 0.18s;
}
button:hover, .btn:hover {
  background: #4a33aa;
  color: #fff;
}

/* --------- Utility-Klassen --------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.m-0 { margin: 0 !important; }
.mb-2 { margin-bottom: 0.5em !important; }
.mb-4 { margin-bottom: 2em !important; }
.mt-2 { margin-top: 0.5em !important; }
.mt-4 { margin-top: 2em !important; }
.p-0 { padding: 0 !important; }
.px-2 { padding-left: 1em !important; padding-right: 1em !important; }

/* --------- Fehlermeldungen / Hinweise --------- */
.alert, .message, .error, .success {
  display: block;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: bold;
  margin-bottom: 1em;
  font-size: 1em;
}
.error, .alert-error { background: #ffdfe2; color: #be223a; }
.success, .alert-success { background: #e3ffd7; color: #1b8631; }
.info, .alert-info { background: #e8e8fe; color: #4a33aa; }

/* --------- Loader/Spinner (Optional) --------- */
.loader,
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #ececec;
  border-radius: 50%;
  border-top: 3px solid #6848e7;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin {
  100% { transform: rotate(360deg);}
}

/* --------- Responsive --------- */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    margin: 10px 0;
    padding: 10px 0;
  }
  .profile-pic {
    width: 60px;
  }
  .main-content {
    margin: 10px 20px 20px 20px;
  }
  .tabs-nav {
    margin-bottom: 20px;
  }
}

/* Optional: kleine Card-Styles, falls oft verwendet */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px #bbb1fa20;
  padding: 2em;
  margin-bottom: 2em;
}

/* --------- Sidebar + Content toggling --------- */
body.logged-out #app .sidebar {
  display: none !important;
}

body.logged-out #app .main-content {
  margin: 0;
  width: 100vw;
  height: 100vh;
  box-shadow: none;
  border-radius: 0;
  padding: 40px;
}

/* ========================= Ende main.css ========================= */


.top-overlay {
	display: none; /* Standardmäßig versteckt */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 78px;       /* exakt die Höhe deines Tabs-Menüs */
  background: #f5f7fa;   /* gleiche Farbe wie Hintergrund des Menüs */
  z-index: 20;        /* höher als Content, niedriger als ein Modal! */
  pointer-events: none; /* Overlay ist "durchklickbar" */
}

/* Klasse für sichtbares Overlay */
.top-overlay.visible {
  display: block !important;
}


/* main.css */

/* ... (Ihr gesamter bisheriger CSS-Code bis zum Responsive-Teil bleibt gleich) ... */


/* =========================
   Responsive Anpassungen
   ========================= */

/* Wir verwenden 768px als gängigen Breakpoint für Tablets und Smartphones */
@media (max-width: 768px) {

  /* Das #app-Layout so anpassen, dass es den ganzen Bildschirm einnimmt */
  #app {
    flex-direction: column; /* Stellt sicher, dass Navi oben und Content unten ist */
  }

  /* Der .main-content-Bereich (falls doch vorhanden) soll keine festen Ränder mehr haben */
  .main-content {
    margin: 10px; /* Kleiner, gleichmäßiger Rand auf allen Seiten */
    padding: 0;
  }

  /* Das obere Tab-Menü anpassen */
  .tabs-nav {
    padding: 12px; /* Weniger Innenabstand */
    margin-bottom: 15px; /* Weniger Abstand zum Inhalt */
    /* flex-wrap: wrap; ist schon vorhanden und korrekt, die Buttons werden bei Bedarf umgebrochen */
  }

  /* Buttons im Tab-Menü leicht verkleinern */
  .tabs-nav .tab-btn, #logout-btn {
    padding: 8px 18px;
    font-size: 0.95em;
  }

  /* Den Inhaltsbereich anpassen */
  .content {
    padding: 20px 15px; /* Deutlich weniger horizontalen Abstand */
    min-height: auto; /* Höhe an Inhalt anpassen lassen */
  }

  /* Überschriften für kleinere Bildschirme verkleinern */
  h1 {
    font-size: 1.8em;
  }
  h2 {
    font-size: 1.3em;
  }

  /* Die Login-Karte anpassen, damit sie nicht die Bildschirmränder berührt */
  .login-card {
    width: 90%;
    max-width: 450px; /* Maximale Breite festlegen */
  }
}

/* Den alten, ungenutzten @media-Block können Sie entfernen oder durch den oberen ersetzen */
/*
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  .sidebar { ... }
  .profile-pic { ... }
  .main-content { ... }
  .tabs-nav { ... }
}
*/


/* =================================== */
/* ## Styling für den Ladebildschirm ## */
/* =================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none; /* Wird per JS auf 'flex' gesetzt */
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #333;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-content .spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #673ab7;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1.2s linear infinite;
}

.loading-content h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #673ab7;
}

.loading-content p {
    font-size: 1rem;
    margin: 0;
    color: #555;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
