/* Modern CSS for Messe Flurstücksinformationssystem */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* Layout Containers */
DIV.content {
  margin: 20px;
  max-width: 1400px;
}

DIV.menu {
  margin: 0;
  padding: 12px 20px;
  color: #FFF;
  background-color: #000066;
  text-align: center;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

DIV.header {
  padding: 20px;
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  color: #FFF;
  background-color: #000066;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

DIV.footer {
  color: #FFF;
  background-color: #000066;
  margin-top: 40px;
  padding: 20px;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

DIV.login {
  font-size: 12px;
  color: #FFF;
  text-align: right;
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Links */
a:link {
  text-decoration: underline;
  font-weight: normal;
  color: white;
  transition: background-color 0.2s ease;
}

a:visited {
  text-decoration: underline;
  font-weight: normal;
  color: white;
}

a:hover {
  text-decoration: underline;
  font-weight: normal;
  background-color: #6699CC;
  border-radius: 2px;
  padding: 2px 4px;
  margin: -2px -4px;
}

a:focus {
  outline: 2px solid #6699CC;
  outline-offset: 2px;
}

DIV.content a:link {
  text-decoration: underline;
  font-weight: normal;
  color: #000066;
}

DIV.content a:visited {
  text-decoration: underline;
  font-weight: normal;
  color: #000066;
}

DIV.content a:hover {
  text-decoration: underline;
  font-weight: normal;
  background-color: #6699CC;
  color: #000066;
  border-radius: 2px;
  padding: 2px 4px;
  margin: -2px -4px;
}

/* Typography */
h1, h2, h3, h4 {
  color: #000066;
  font-weight: 500;
  margin-top: 0;
}

h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

P, LI {
  text-decoration: none;
  font-weight: normal;
  color: black;
  margin: 8px 0;
}

.klein, P.klein {
  font-size: 13px;
}

DIV.klein {
  font-size: 13px;
}

/* Tables */
table {
  border-collapse: collapse;
  border-color: #333;
  border: 1px solid #333;
  width: 100%;
  margin: 12px 0;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th {
  padding: 8px 10px;
  border-color: #333;
  border-width: 1px;
  background-color: #999999;
  border-style: solid;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: #000;
}

th.empty {
  padding: 8px;
  border: none;
  background-color: white;
  text-align: left;
}

th.festebreite1 {
  width: 450px;
}

th.spacy {
  padding: 10px;
}

td {
  padding: 6px 10px;
  border-color: #333;
  border-width: 1px;
  border-style: solid;
  font-size: 14px;
}

td.empty {
  padding: 6px;
  border: none;
}

td.spacy {
  padding: 10px;
}

.nobg {
  background-color: white;
}

.noborder {
  border: none;
}

/* Clickable table rows */
tr.clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

tr.clickable:hover {
  background-color: #E8F0FE;
}

/* Detail Boxes (Flurstueck, Vorgaenger, Nachfolger) */
.flurstueck,
.nachfolger,
.vorgaenger {
  position: relative;
  margin: 20px 0;
  padding: 16px;
  background: #F4F8FE;
  color: black;
  border: 1px solid #A4BCDF;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.flurstueck td,
.nachfolger td,
.vorgaenger td {
  font-size: 13px;
  padding: 4px 10px;
  max-width: 600px;
}

.flurstueck th,
.nachfolger th,
.vorgaenger th {
  font-size: 13px;
  padding: 4px 10px;
  width: 180px;
  font-weight: 600;
}

.flurstueck .eingerueckt th {
  width: 160px;
}

/* Historical rows */
.row_historisch td {
  color: #666;
  font-style: italic;
}

/* Utility Classes */
.roter_rahmen {
  border: 2px solid #C00000;
  border-radius: 4px;
}

.eingerueckt {
  padding: 8px 0 0 24px;
}

.eingerueckt2 {
  margin: 8px 0 0 24px;
}

.pfeil_eingerueckt {
  padding: 4px 0 4px 275px;
  font-size: 2em;
  text-align: center;
}

.pfeil {
  padding: 4px 0 4px 300px;
  text-align: center;
  font-size: 2em;
}

/* Messages */
.error {
  color: #C00000;
  background-color: #FFE6E6;
  border: 2px solid #C00000;
  border-radius: 4px;
  margin: 16px 0;
  padding: 12px 16px;
  font-size: 14px;
}

.positivnotice {
  color: #008000;
  background-color: #E6F7E6;
  border: 2px solid #008000;
  border-radius: 4px;
  margin: 16px 0;
  padding: 12px 16px;
  font-size: 14px;
}

/* Forms */
input[type="text"],
input[type="password"],
select,
textarea {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6699CC;
  box-shadow: 0 0 0 3px rgba(102, 153, 204, 0.1);
}

input[type="submit"],
button,
.button {
  padding: 10px 20px;
  background-color: #000066;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

input[type="submit"]:hover,
button:hover,
.button:hover {
  background-color: #000088;
  transform: translateY(-1px);
}

input[type="submit"]:active,
button:active,
.button:active {
  transform: translateY(0);
}

input[type="submit"].primary,
button.primary {
  background-color: #000066;
}

/* Login Form */
DIV.form,
#loginform {
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 32px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Center login form vertically and horizontally */
body.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.login-page DIV.content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

DIV.form h3,
#loginform h3 {
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
  color: #000066;
  font-size: 22px;
}

DIV.form label,
#loginform label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

DIV.form input[type="text"],
DIV.form input[type="password"],
#loginform input[type="text"],
#loginform input[type="password"] {
  width: 100%;
  margin-bottom: 16px;
}

DIV.form input[type="submit"],
#loginform input[type="submit"] {
  width: 100%;
  margin-top: 8px;
}

/* Horizontal Rules */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 24px 0;
}

/* Responsive improvements */
@media (max-width: 768px) {
  DIV.content {
    margin: 12px;
  }

  DIV.menu {
    font-size: 12px;
    padding: 10px;
  }

  table {
    font-size: 13px;
  }

  th, td {
    padding: 6px 8px;
  }
}

/* Print styles */
@media print {
  DIV.menu,
  DIV.login,
  DIV.footer {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  a {
    color: black;
    text-decoration: none;
  }
}
