/* -------- Global -------- */
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f6f8;
  color: #333;
  text-align: center;
  margin: 20px;
}

h2 {
  margin-bottom: 10px;
  color: #222;
  font-weight: 900;
}



/* -------- Login -------- */
.login-box {
  max-width: 320px;
  margin: 0px auto;            /* Abstand nach oben + mittig */
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);

  display: flex;                /* Inhalt schön ausrichten */
  flex-direction: column;
  align-items: center;          /* alles in der Mitte */
}

.login-box input,
.login-box button {
  display: block;
  width: 90%;                   /* nicht ganz breit, schöner mittig */
  max-width: 250px;             /* Eingabefelder begrenzen */
  margin: 5px auto;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #bbb;
  border-radius: 8px;
  text-align: center;           /* Text im Feld mittig */
}

.login-box input:focus {
  border-color: #1976d2;
  outline: none;
  box-shadow: 0 0 0 2px rgba(25,118,210,0.2);
}

.login-box button {
  background: #1976d2;
  color: white;
  border: none;
  font-weight: bold;
  transition: background 0.2s;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box button:hover {
  background: #145ea8;
}


/* -------- Monatsnavigation -------- */
.month-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  gap: 10px;
}

.month-nav button {
  width: 45px;
  height: 45px;
  font-size: 20px;
  font-weight: bold;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
}

.month-nav button:hover {
  background: #f0f0f0;
}

#monthLabel {
  font-size: 22px;
  font-weight: bold;
  min-width: 180px;
}

/* -------- Kalender -------- */
#calendar-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* 7 Spalten */
  gap: 6px;
}

/* Wochentage */
#weekdays {
  display: contents;
}

#weekdays div {
  text-align: center;
  font-weight: bold;
  padding: 8px 0;
  background-color: #e0e0e0;
  border-radius: 6px;
  min-height: 20px;
}

/* Kalender-Tage */
#calendar {
  display: contents;
}

/* -------- Kalender-Tage -------- */
.day {
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 5px;
  background-color: #c8e6c9; /* Default grün = frei */
  cursor: pointer;
  transition: transform 0.1s;
  box-sizing: border-box;

  /* Einheitliche Größe */
  width: 100%;
  aspect-ratio: 1 / 2;  /* Quadrat */
  min-height: 120px;
}

.day-number {
  font-weight: bold;
  margin-bottom: 4px;
  text-align: center;
}

/* Namenfeld */
.day .names {
  display: flex;
  flex-direction: column;
  align-items: flex-start;  /* alle Namen linksbündig */
  justify-content: flex-start;
  line-height: 1.4em;
  max-height: calc(1.4em * 8);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  font-size: 12px;
  width: 100%;      /* volle Breite des Tagesfelds */
  box-sizing: border-box;
}

/* Scrollbar Styling */
.day .names::-webkit-scrollbar {
  width: 6px;
}

.day .names::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 3px;
}

.day .names::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}



/* -------- Mobile Liste statt Grid -------- */
@media (max-width: 600px) {
  #calendar-container {
    display: flex;
    flex-direction: column; /* statt grid → untereinander */
    gap: 10px;
  }
  
  .weekday-short { display: inline-block; }
  #weekdays { display: none; }   /* keine leere Kopfzeile am Handy */
  .day.empty { display: none; }  /* keine leeren Platzhalter vor Monatsanfang */



  .day {
    display: flex;
    flex-direction: row;        /* Wochentag links, Inhalt rechts */
    align-items: flex-start;
    justify-content: flex-start;
    padding: 10px;
    height: auto;
    aspect-ratio: auto;         /* keine Quadrate mehr */
    font-size: 14px;
  }

  .day-number {
    font-weight: bold;
    margin-right: 12px;
    min-width: 35px;            /* Platz für das Datum */
    text-align: right;
  }

  .day .names {
    flex-grow: 1;
    max-height: none;           /* alle Namen sichtbar */
    overflow-y: visible;        /* kein Scrollen im Handy-Layout */
    font-size: 13px;
    border: none;
    background: transparent;
    padding: 0;
  }
  
  #calendar-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #weekdays {
    display: none; /* Kopfzeile weg */
  }

  .day.empty {
    display: none; /* keine Lücken */
  }
}


/* -------- Button Bar -------- */
.button-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

/* Passwort ändern Button */
.changePasswordBtn {
  grid-column: 1 / 4;      /* nimmt Spalte 1,2,3 ein */
  justify-self: start;     
  background-color: #1976d2;
  color: #fff;
  border: none;
  padding: 10px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
  width: 100%;             /* füllt die 3 Spalten komplett aus */
}

.changePasswordBtn:hover {
  background-color: #145ea8;
}

/* Logout Button */
.logoutBtn {
  grid-column: 5 / 8;      /* 3 Spalten rechts */
  justify-self: end;
  background-color: #f44336;
  color: #fff;
  border: none;
  padding: 10px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
  width: 100%;
  position: relative;       /* wichtig für Klickbarkeit */
  z-index: 1;        
}

.logoutBtn:hover {
  background-color: #d32f2f;
}

#changePasswordModal {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
#changePasswordModal .modal-content {
    background:#fff;
    padding:20px;
    border-radius:12px;
    width:300px;
    display:flex;
    flex-direction:column;
    align-items:center;
}
#changePasswordModal input {
    width: 90%;
    margin:5px 0;
    padding:10px;
    border-radius:6px;
    border:1px solid #bbb;
    text-align:center;
}


.day.past {
    background-color: #e0e0e0 !important; /* hellgrau */
    color: #888;                          /* Textfarbe grau */
    cursor: default;
}

.day.past .names {
    background: #f0f0f0;                  /* graues Feld für Namen */
    border-color: #ccc;
}

.modal {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 280px;
  text-align: center;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  gap: 8px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#morningBtn { background-color: #1976d2; color:#fff; }
#afternoonBtn { background-color: #ff9800; color:#fff; }
#cancelBtn { background-color: #f44336; color:#fff; }

/* Wochentage ausblenden */
#weekdays {
  display: none !important;
}

.login-image {
    margin-top: 20px;        /* Abstand nach oben */
    display: flex;
    justify-content: center; /* Bild zentrieren */
}

.login-image img {
    max-width: 100%;         /* Bild skaliert auf Box-Breite */
    height: auto;            /* Höhe proportional */
    border-radius: 8px;      /* optional: abgerundete Ecken */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* optional: Schatten */
}


.slot-label {
  text-decoration: underline;
  font-weight: 500; /* leicht hervorheben */
}

.footer {
  margin-top: 20px;
  padding: 5px;
  background: #f0f0f0;
  color: #555;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid #ddd;
}

