/* Grundlayout */
html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f4f4;
  color: #333;
}

.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Ergänzen/ändern: */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, footer {
  background-color: #1e1e2f;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer {
  font-size: 0.9em;
}

/* Benutzer-Menü */
#user-menu {
  position: relative;
  display: inline-block;
}

#user-menu button {
  background-color: #2e2e4d;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
}

#user-menu-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 180px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 100;
  border-radius: 4px;
  overflow: hidden;
}

#user-menu-content a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s ease;
}

#user-menu-content a:hover {
  background-color: #f0f0f0;
}

/* WICHTIG: nur das hier zum Öffnen – keine .open, kein @media */
#user-menu:hover #user-menu-content {
  display: block;
}

header .app-title {
  display: flex;
  align-items: center;
}

header .home-link {
  text-decoration: none;
  color: inherit;
}

header .home-link:hover,
header .home-link:focus-visible {
  text-decoration: underline;
  cursor: pointer;
}


.usermessage {
  background: #e9f5ff;
  border: 1px solid #7ab8ff;
  color: #0b3d91;
  padding: 15px;
  margin: 10px 0;
  border-radius: 5px;
}

.usermessage button {
  margin-left: 10px;
  padding: 5px 10px;
}

/* Container für den Hauptinhalt */
main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;      /* wichtig für Flex + 100%-Height-Kinder */
  padding: 0;         /* kein Außenabstand */
  justify-content: flex-start;
  align-items: stretch;
}

/* Nachrichten-Stile */
.message {
  padding: 10px;
  margin: 10px 0;
  border-radius: 4px;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Formulare im Userpanel */
#userpanel form {
  display: flex;
  flex-direction: column;
  gap: 6px; /* vorher 10px: kleinere Zeilenabstände */
}

#userpanel input[type="text"],
#userpanel input[type="password"],
#userpanel input[type="email"],
#userpanel input[type="tel"],
#userpanel select {
  padding: 5px 6px;          /* vorher 8px: kompakter */
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.95em;         /* etwas kleiner */
}

#userpanel button[type="submit"],
#userpanel button[type="button"] {
  padding: 6px 10px;         /* leicht reduziert */
  border-radius: 4px;
  border: none;
  background-color: #2e2e4d;
  color: white;
  cursor: pointer;
  font-size: 0.95em;
}

#userpanel button[type="button"] {
  background-color: #6c757d;
}

#userpanel button:hover {
  opacity: 0.9;
}

/* Erfolgsmeldungsbereich oben */
#server-messages {
  padding: 10px 20px;
}

/* Links im Header rechts (z. B. Impressum/Datenschutz) */
.header-links a {
  color: white;
  margin-left: 10px;
  text-decoration: none;
}

.header-links a:hover {
  text-decoration: underline;
}

/* Layout für App-Bereich (zwischen Kopf- und Fußzeile) */
#app-layout {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Container, in dem das iframe sitzt */
#app-container {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;   /* Basis für Userpanel-Overlay */
}

/* Das eigentliche iframe mit intro/content */
#app-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Userpanel als zentriertes Overlay über dem Inhalt */
#userpanel {
  position: fixed;                /* relativ zum Viewport */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;

  display: none;
  background: #ffffff;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.35);

  /* Breite: etwas schmäler & flexibel */
  width: 90vw;                    /* nutzt 90% der Fensterbreite */
  max-width: 600px;               /* Deckel: nicht zu breit */
  min-width: 320px;               /* auf sehr kleinen Screens noch nutzbar */

  /* Höhe begrenzen → kein Strecken mehr */
  max-height: 55vh;               /* niedriger als zuvor */
  overflow-y: auto;               /* Inhalt scrollt im Panel */

  text-align: left;
  box-sizing: border-box;
}
/* Header rechts: User-Menü + Sprachauswahl */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Wrapper für die Sprachauswahl */
.lang-select-wrapper {
  display: flex;
  align-items: center;
}

/* Kompakte, gut sichtbare Select-Box */
.lang-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Fokus sichtbar machen */
.lang-select:focus {
  outline: 2px solid #2e2e4d;
  outline-offset: 1px;
}

/* Screenreader-only Label (für Barrierefreiheit) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-nav {
  margin-left: 1rem;
  display: flex;
  align-items: center;
}

.header-nav .home-link {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

.header-nav .home-link:hover,
.header-nav .home-link:focus-visible {
  background: rgba(255,255,255,0.15);
}
