/* ==========================================================
   🎨 IServ-kompatibles & voll responsives Design
========================================================== */

/* Basis */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #f5f5f5;
  color: #1a1a1a;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   🔵 HEADER – vollständig responsive, IServ-Style
---------------------------------------------------------- */
.site-header {
  width: 100%;
  background-color: #0055a5;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  flex-wrap: wrap;
  gap: 10px;
  box-sizing: border-box;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 42px;
  width: auto;
}

.school-name {
  font-size: 20px;
  font-weight: 600;
  color: white;
}

/* Hallo + Logout Bereich */
.logout-container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.welcome-text {
  font-weight: 500;
  white-space: nowrap;
}

.logout-btn {
  background-color: white;
  color: #0055a5;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.2s;
  white-space: nowrap;
  border: none;
}

.logout-btn:hover {
  background-color: #e5e5e5;
}

/* MOBILE HEADER FIX */
@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .logout-container {
    justify-content: center;
    margin-left: 0;
  }
}

/* -----------------------------------------------
   📊 Tabellen-Zentrierung (HEAD + BODY)
----------------------------------------------- */

table th,
table td {
  text-align: center !important;   /* Inhalt mittig */
  vertical-align: middle;          /* auch vertikal sauber */
}


/* ----------------------------------------------------------
   📄 Inhalte
---------------------------------------------------------- */
main {
  padding: 20px;
}

h1, h2, h3 {
  color: #0055a5;
  text-align: center;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ----------------------------------------------------------
   🧾 Formularbox – responsive
---------------------------------------------------------- */
.form-box {
  max-width: 500px;
  width: 90%;
  margin: 0 auto 40px auto;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-box label {
  color: #333;
  font-weight: 600;
}

.form-box input,
.form-box textarea,
.form-box select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #b9c6d2;
  background: #fff;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
}

.form-box input:focus,
.form-box select:focus,
.form-box textarea:focus {
  border-color: #0055a5;
  outline: none;
}

.readonly-field {
  background-color: #f0f0f0;
  border: 1px solid #b9c6d2;
  padding: 10px;
  border-radius: 6px;
}

/* ----------------------------------------------------------
   🔘 Buttons
---------------------------------------------------------- */
.btn,
.big-btn {
  background-color: #0055a5;
  color: white !important;
  font-weight: 600;
  border-radius: 6px;
  padding: 12px 20px;
  text-decoration: none;
  text-align: center;
  transition: 0.2s;
  cursor: pointer;
  border: none;
  width: 100%;
  box-sizing: border-box;
}

.btn:hover,
.big-btn:hover {
  background-color: #003f7a;
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.button-container .btn {
  max-width: 200px;
}

/* ----------------------------------------------------------
   📊 Tabellen – IServ Style & responsive
---------------------------------------------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin: 0 auto 30px auto;
  min-width: 600px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

th {
  background-color: #0055a5;
  color: white;
  padding: 12px;
  font-weight: 600;
}

td {
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* ----------------------------------------------------------
   ⚠️ Fehlermeldungen
---------------------------------------------------------- */
.fehler {
  color: #b00020;
  font-weight: bold;
  text-align: center;
}

.notification-box {
  background-color: #e0efff;
  border-left: 4px solid #0055a5;
  padding: 10px 15px;
  border-radius: 8px;
  color: #003f7a;
  margin-bottom: 20px;
}

/* Statusfarben für Tabellenzeilen */
.status-table .status-vor_ort {
  background-color: #f8f9fa;
}

.status-table .status-benachrichtigt {
  background-color: #fff3cd;
}

.status-table .status-zurueckgeschickt {
  background-color: #d4edda;
}

/* Legend-Badges */
.legend {
  margin: 20px auto;
  max-width: 900px;
  font-size: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: #333;
}

.legend-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid #d6d6d6;
  background-color: #f0f0f0;
}

.legend-badge.status-vor_ort {
  background-color: #f8f9fa;
}

.legend-badge.status-benachrichtigt {
  background-color: #fff3cd;
}

.legend-badge.status-zurueckgeschickt {
  background-color: #d4edda;
}


/* ----------------------------------------------------------
   📱 Zusätzliche mobile Optimierungen
---------------------------------------------------------- */
@media (max-width: 900px) {
  h1 {
    font-size: 24px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 22px;
  }

  .form-box {
    width: 95%;
  }

  table {
    min-width: 550px;
  }
}

@media (max-width: 400px) {
  .logo {
    height: 36px;
  }

  .school-name {
    font-size: 18px;
  }

  h1 {
    font-size: 20px;
  }
}

/* BADGE (oben unter dem Titel) */
.update-badge {
    background-color: #d9534f;   /* rot */
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    margin: 10px auto;
    text-align: center;
}

/* TOAST BENACHRICHTIGUNG */
.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #0055a5;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    font-weight: 600;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
}

/* Karte der Lernnischen */

.map-container {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.map-bg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Positionen der Räume (Hotspots) */
.room-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
}

/* Overlay-Kästchen auf der Karte */
.room-overlay {
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 140px;
  text-align: center;
  border: 2px solid #0055a5;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

.room-overlay .room-name {
  font-weight: bold;
  margin-bottom: 4px;
}

.room-overlay .room-places {
  font-size: 14px;
  margin-bottom: 6px;
}

/* Ausgebucht */
.room-overlay.room-full {
  border-color: #ff4d4d;
  background-color: rgba(80, 0, 0, 0.8);
}

.room-full-text {
  font-weight: bold;
  color: #ff9999;
}

/* 🔙 Zurück-Button mitten auf dem Lernnischen-Bild */
.back-button-overlay {
  position: absolute;
  top: 48%;              /* vertikal mittig */
  left: 52%;             /* horizontal mittig */
  transform: translate(-50%, -50%);  /* genaue Zentrierung */
  z-index: 20;           /* über dem Bild, über allen Overlays */
}
