* {
  font-family: sans-serif;
}

a {
  color: steelblue;
  font-weight: bold;
  text-decoration: none;
}

a:hover {
  color: navy;
}

h1, h2, h3 {
  text-align: center;
}

#wrapper {
  background-color: whitesmoke;
  border: 1px solid darkgrey;
  margin: 20px auto;
  min-width: 400px;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

#wrapper2 {
  background-color: whitesmoke;
  border: 1px solid darkgrey;
  margin: 0px auto;
  width: 80%;
  max-width: 100%;
  box-sizing: border-box;
}

#landingpage {
  text-align: center;
}

#landingpage h2 {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: #555;
}

#landingpage p {
  font-size: 1em;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: justify;
  color: #666;
}

#landingpage #buttons {
  text-align: center;
}

#landingpage ol {
  margin: 0px;
  padding: 0px 0px 0px 20px;
}

#landingpage li {
  margin: 10px 0px;
  padding: 0px 0px 0px 5px;
}

header {
  margin: 0px;
  padding: 5px;
  background-color: lightgrey;
}

#user {
  display: flex;
  list-style-type: none;
  margin: 0px;
  padding: 0px;
}

#user li:last-child {
  margin-left: auto;
}

main {
  margin: 0px;
  padding: 0px 10px 10px 10px;
}

#schuelerliste {
  border-collapse: collapse;
  min-width: 800px;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

#schuelerliste td {
  border: 1px solid darkgrey;
  font-size:8pt;
}

#schuelerliste tr:nth-child(1) {
  background-color: rgb(155, 187, 89);
  color: white;
  font-weight: bold;
}

#schuelerliste tr:nth-child(2n+2) {
  background-color:rgb(216, 228, 188);
}

#schuelerliste tr:nth-child(2n+3) {
  background-color:rgb(235, 241, 222);
}

#schuelerliste .col00 {
	text-align: center;
}

#schuelerliste .col01 {
	text-align: center;
}

#schuelerliste .col02 {
	text-align: center;
	width: 5%;
}
#schuelerliste .col03 {
	width: 10%;
}
#schuelerliste .col04 {
	width: 10%;
}
#schuelerliste .col06 {
	text-align: center;
	width: 5%;
}
#schuelerliste .col07 {
	width: 30%;
}
#schuelerliste .col08 {
	text-align: center;
	width: 20%;
}
#schuelerliste .col09 {
	text-align: center;
	width: 20%;
}

#select {
  text-align: center;
}

#select input[type=submit] {
  padding: 10px;
  margin-top: 10px;
  width: 250px;
  max-width: 100%;
}

#search {
  display: flex;
  gap: 10px;
  margin: 15px 0px;
  flex-wrap: wrap;
}

#search .filter {
  text-align: center;
}

#search input[type=text] {
  width: 100px;
  flex: 1;
  min-width: 80px;
}

#search label {
  font-size: 8pt;
  margin:0px;
  padding: 0px;
}

#search button {
	width: 100px;
	height: 21px;
  flex-shrink: 0;
}

#datenschutzgrundverordnung {
  text-align: justify;
}

#religionsentscheidung div {
  display: inline-block;
  vertical-align: middle;
}

#religionsentscheidung ul {
  list-style-type: none;
  margin: 0px;
  padding: 0px;
}

#religionsentscheidung li {
  margin-top: 10px;
}

#religionsentscheidung input {
  margin-left: 1px;
  margin-right: 9px;
  padding: 0px;
}

#religionsentscheidung p {
  margin: 0px;
  padding: 0px;
  text-align: justify;
}

#buttons {
  margin-top: 20px;
}

#buttons input[type=submit] {
  padding: 12px 24px;
  background-color: lightblue;
  border: none;
  border-radius: 5px;
  color: #333;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#buttons input[type=submit]:hover {
  background-color: #add8e6;
}

#buttons input[type=submit]:disabled {
  background-color: grey;
  color: white;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Generic button class to match the app's submit buttons */
.btn {
  padding: 12px 24px;
  background-color: lightblue;
  border: none;
  border-radius: 5px;
  color: #333;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  box-sizing: border-box;
  line-height: 1.2;
  min-width: 160px;
}

.btn:hover {
  background-color: #add8e6;
}

/* Landing page specific sizing to match other controls and keep layout */
#landingpage #buttons .btn {
  width: 250px;
  max-width: 100%;
}

@media (max-width: 768px) {
  #landingpage #buttons .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
  #wrapper, #wrapper2 {
    width: 95%;
    margin: 10px auto;
    padding: 15px;
  }

  #schuelerliste {
    font-size: 10pt;
  }

  #schuelerliste td {
    font-size: 8pt;
    padding: 5px;
  }

  #select input[type=submit] {
    width: 100%;
  }

  #search {
    flex-direction: column;
    align-items: center;
  }

  #search input[type=text] {
    width: 100%;
    max-width: 200px;
  }

  #search button {
    width: 100%;
    max-width: 200px;
  }

  #buttons {
    text-align: center;
  }

  #buttons input[type=submit] {
    width: 100%;
    max-width: 150px;
  }

  h1 {
    font-size: 1.8em;
  }

  #landingpage h2 {
    font-size: 1.3em;
  }

  #landingpage p {
    font-size: 0.95em;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5em;
  }

  #landingpage h2 {
    font-size: 1.2em;
  }

  #landingpage p {
    font-size: 0.9em;
  }

  #user {
    flex-direction: column;
    align-items: center;
  }

  #user li:last-child {
    margin-left: 0;
    margin-top: 10px;
  }
}

/* Error modal styles (used by retrieve.php show_error) */
.error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  z-index: 9999;
}

.error-modal {
  background-color: whitesmoke; /* match #wrapper */
  border: 1px solid darkgrey;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 90%;
  width: 420px;
  box-sizing: border-box;
}

.error-modal h2 {
  margin-top: 0;
}

/* Use the existing .btn styles for the modal button; ensure reasonable spacing */
.error-modal .btn {
  min-width: 120px;
  margin-top: 12px;
}
