/* === Radikaler CSS Reset === */
*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* === Google Fonts: Poppins === */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --accent-green: #06ac74;
  --accent-green-visited: #239770;
  --background-grey: #f9f9f9;
  --formfield-green: #e4f1ee;
  --danger-red: #e74c3c;
  --text-dark: #333;
  --text-light: #888;
  --border-grey: #eaeaea;
  --border-light: #f0f0f0;
  --border-radius: 6px;
  --shadow: box-shadow: 0px 0px 11.161px 0px rgba(0, 0, 0, 0.07);
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Basisstile === */
html {
  font-size: 16px;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text-dark);
  background-color: var(--background-grey);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 2rem;
}

/* === Listen-Stile === */
ul {
  list-style-type: disc;
  margin: 2rem 0;
  padding-left: 2rem;
}

ol {
  list-style-type: decimal;
  margin: 1rem 0;
  padding-left: 2rem;
}

ul li, ol li {
  padding: 0.3rem 0;
}

/* Entfernung aller speziellen Listen-Stylings */
.timeline-list,
.info-timeline,
.data-timeline,
.applicant-data,
.child-data-list,
.timeline-list::before,
.info-timeline::before,
.data-timeline::before,
.applicant-data::before,
.child-data-list::before,
.timeline-list li,
.info-timeline li,
.data-timeline li,
.applicant-data li,
.child-data-list li,
.timeline-list li:last-child,
.info-timeline li:last-child,
.data-timeline li:last-child,
.applicant-data li:last-child,
.child-data-list li:last-child,
.timeline-list li::before,
.info-timeline li::before,
.data-timeline li::before,
.applicant-data li::before,
.child-data-list li::before {
  /* Reset aller speziellen Styles */
  all: unset;
}

/* === Überschriften === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.4rem;
}
h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent-green);
  text-decoration: none;
  &:visited {
    color: var(--accent-green-visited);
  }
}

a:hover {
  text-decoration: underline;
}

/* === Layout === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* === Header & Navigation === */
header {
  background: white;
  box-shadow: var(--shadow);
  padding: 1rem 0;
}

nav {
  display: flex;
  align-items: center;
}

/* === Prozess-Navigation === */
.process-steps {
  display: flex;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  gap: 0.5rem;
}

.process-steps li {
  padding: 0.6rem 1.5rem;
  background: white;
  border-radius: 2rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.process-steps li.active {
  background: var(--accent-green);
  color: white;
}

/* === Tabellen === */
table {
  width: auto; /* Nicht volle Breite */
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Table Header */
th {
  font-weight: 600;
  color: var(--text-dark);
  background: white;
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
}

/* Table Cells */
td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-dark);
  background: white;
}

/* Abwechselnde Zeilenfarbe (striped) */
tr:nth-child(even) td {
  background-color: var(--background-grey);
}

/* Letzte Zeile ohne Border */
tr:last-child td {
  border-bottom: none;
}

/* Hover-Effekt auf Zeilen */
tr:hover td {
  background: var(--formfield-green);
  transition: background 0.2s;
}

/* === Form-Elemente === */
form {
  margin: 1.5rem 0;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

table form {
  max-width: fit-content;
  padding: 0;
}

/* Labels */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text-light);
}

/* Input-Felder, Select-Menüs, Textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 0.8rem;
  background: var(--formfield-green);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(6, 172, 116, 0.1);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* Checkboxen & Radio-Buttons */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
  accent-color: var(--accent-green);
}

/* Gruppierung von Formularfeldern */
.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row > * {
  flex: 1;
}

.button-row {
  a {
    margin-right: 1rem !important;
  }
}

/* === Buttons === */
button,
.btn,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  background: var(--accent-green);
  color: white;
  font-weight: 500;
  border-radius: var(--border-radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

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

button.secondary,
.btn.secondary {
  background: #e0e0e0;
  color: var(--text-dark);
}

button.secondary:hover,
.btn.secondary:hover {
  background: #d0d0d0;
}

/* Icon-Buttons in Tabellen */
table button,
table .btn {
  background: transparent;
  color: var(--accent-green);
  box-shadow: none;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

table button:hover,
table .btn:hover {
  background: var(--formfield-green);
  transform: none;
}

/* Button mit Icon */
button svg,
.btn svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

/* Zurück/Weiter-Buttons */
.nav-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.nav-buttons .btn-previous {
  background: white;
  color: var(--text-dark);
  border: 1px solid var(--border-grey);
}

.nav-buttons .btn-next {
  margin-left: auto;
}

/* === Cards & Panels === */
.card,
.panel {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title,
.panel-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.card-title svg,
.panel-title svg {
  margin-right: 0.5rem;
  color: var(--accent-green);
}

/* === Icons === */
.icon {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  color: inherit;
  vertical-align: middle;
}

/* === Status-Anzeigen === */
.status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-success {
  background: rgba(6, 172, 116, 0.1);
  color: var(--accent-green);
}

.status-error {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger-red);
}

/* === Utility-Klassen === */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  table {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 0.6rem;
  }
}

/* Spezifische Überschreibungen für bestehende HTML-Struktur */
#phoneField {
  display: none;
}

.form-group.half-width {
  width: 48%;
}

table {
  border: none !important;
}

th,
td {
  border: none !important;
}

input,
select,
textarea {
  border-color: #d1e7dd !important;
}

button,
input[type="submit"] {
  background-color: var(--accent-green) !important;
}

.error {
  color: var(--danger-red);
  font-weight: 500;
  margin: 0.5rem 0;
}

/* Tabellen mit spezifischen Breiten wie im Design */
.table-container {
  overflow-x: auto;
  max-width: 100%;
}

/* Löschen-Button Überschreibung */
button[type="submit"][style*="background-color:red"],
button[style*="background-color:red"],
.cancel-button {
  background-color: var(--danger-red) !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0 !important; /* Text verstecken */
  position: relative !important;
  cursor: pointer !important;
  overflow: hidden !important;
}

/* X-Symbol als ::before-Element */
button[type="submit"][style*="background-color:red"]::before,
button[style*="background-color:red"]::before,
.cancel-button::before {
  content: "" !important;
  position: absolute !important;
  width: 14px !important;
  height: 2px !important;
  background-color: white !important;
  transform: rotate(45deg) !important;
}

/* X-Symbol als ::after-Element */
button[type="submit"][style*="background-color:red"]::after,
button[style*="background-color:red"]::after,
.cancel-button::after {
  content: "" !important;
  position: absolute !important;
  width: 14px !important;
  height: 2px !important;
  background-color: white !important;
  transform: rotate(-45deg) !important;
}

/* Hover-Effekt für den Löschen-Button */
button[type="submit"][style*="background-color:red"]:hover,
button[style*="background-color:red"]:hover,
.cancel-button:hover {
  background-color: #c0392b !important;
}

/* === Header-Überschreibung (clerk_header) === */
div[style*="background-color: #007BFF"] {
  background-color: var(--accent-green) !important;
  color: white !important;
  padding: 1rem 2rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  box-shadow: var(--shadow) !important;
  border-radius: var(--border-radius) !important;
  margin-bottom: 2rem !important;
  h1 {
    color: white !important;
    font-size: 2em !important;
  }
}

/* Stile für Elemente im Header */
div[style*="background-color: #007BFF"] a {
  color: white !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}

div[style*="background-color: #007BFF"] a:hover {
  text-decoration: underline !important;
}

/* === Ticket-Section Styling === */
.ticket-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--accent-green);
}

.ticket-section h2,
.ticket-section h3 {
  color: var(--text-dark);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Daten-Zeilen innerhalb der Ticket-Section */
.ticket-section .data-row {
  display: flex;
  margin-bottom: 0.8rem;
}

.ticket-section .data-label {
  font-weight: 500;
  min-width: 180px;
  color: var(--text-light);
}

.ticket-section .data-value {
  font-weight: 500;
  color: var(--text-dark);
}

/* Status-Anzeigen im Ticket */
.ticket-status {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(6, 172, 116, 0.1);
  color: var(--accent-green);
}

.ticket-status.open {
  background: rgba(6, 172, 116, 0.1);
  color: var(--accent-green);
}

.ticket-status.closed {
  background: rgba(100, 100, 100, 0.1);
  color: #666;
}

.ticket-status.urgent {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger-red);
}

/* === Ticket-Detailseite === */
/* Ticket-Überschrift */
h1.ticket-title,
h2.ticket-title {
  font-size: 1.6rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  font-weight: 600;
}

/* Basis-Container */
.form1,
.child_data {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--accent-green);
}

/* Kind-Container */
.child_data {
  border-left-color: #5dade2; /* Blau für Kinder */
}

/* Formular-Überschriften */
.form1 h3,
.child_data h3 {
  color: var(--text-dark);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Daten-Zeilen */
.ticket-info-row {
  margin-bottom: 0.8rem;
  display: flex;
}

.ticket-info-label {
  font-weight: 500;
  min-width: 180px;
  color: var(--text-light);
}

.ticket-info-value {
  font-weight: 500;
  color: var(--text-dark);
}

/* Item-Bereich */
.item {
  background: var(--background-grey);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 3px solid #5dade2;
}

.item h4 {
  color: var(--text-dark);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Status und Priority Styles */
.status-open,
.status-medium,
.status-closed,
.status-high {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-open {
  background: rgba(6, 172, 116, 0.1);
  color: var(--accent-green);
}

.status-medium {
  background: rgba(93, 173, 226, 0.1);
  color: #3498db;
}

.status-closed {
  background: rgba(100, 100, 100, 0.1);
  color: #666;
}

.status-high {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger-red);
}

/* Zeitstempel */
.timestamp {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Verbesserte Darstellung auf der Ticket-Detailseite */
body:has(.form1, .child_data) {
  background-color: #f5f7fa;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* === Ticket Container === */
.ticket-container {
  width: 100%;
  max-width: 600px;
  margin: 1.5rem 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ticket-header {
  background-color: var(--accent-green);
  color: white;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.ticket-header.blue {
  background-color: #3498db;
}

.ticket-data {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ticket-data li {
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
}

.ticket-data li:last-child {
  border-bottom: none;
}

.ticket-data li strong {
  min-width: 150px;
  color: #666;
}

/* Für eine mögliche nebeneinander-Anordnung */
.tickets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Masonry Layout für Tickets */
.tickets-masonry {
  column-count: 2;
  column-gap: 1.5rem;
  margin: 2rem 0;
}

/* Bei schmalen Bildschirmen nur eine Spalte */
@media (max-width: 768px) {
  .tickets-masonry {
    column-count: 1;
  }
}

/* Ticket-Container im Masonry-Layout */
.tickets-masonry .ticket-container {
  display: inline-block;
  width: 100%;
  margin: 0 0 1.5rem 0;
  break-inside: avoid; /* Verhindert, dass Container über Spalten gebrochen werden */
}

.tickets-row .ticket-container {
  flex: 1;
  min-width: 300px;
}

/* Spezifische Styles für Kind-Container */
.ticket-container.child {
  border-left: 3px solid #5dade2;
}

.ticket-container.child .ticket-header {
  background-color: #5dade2;
}

/* === Kinder Container Styles === */
#kinder_container, 
.kinder_container,
.child-form-container {
  margin: 2rem 0;
  max-width: 100%;
  background-color: white;
}

.kind-form {
  border: 1px solid var(--accent-green)!important;
}

.upload-section {
  background-color: #f4f9f8!important;
}

.upload-section .upload-label {
  display: block;
  margin-bottom: 0.5em;
}

/* Fieldset Styling - Einfaches, modernes Design */
fieldset {
  border: none;
  border-left: 3px solid var(--accent-green);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* Fieldset Legend */
legend {
  padding: 0 10px;
  color: var(--accent-green);
  font-size: 1rem;
  font-weight: 600;
  margin-left: -10px;
}

/* Input-Felder in Fieldsets */
fieldset input,
fieldset select,
fieldset textarea {
  background-color: var(--formfield-green);
  border: none;
  border-radius: 4px;
  padding: 0.8rem;
  width: 100%;
  margin-bottom: 1rem;
}

/* Labels in Fieldsets */
fieldset label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

/* Überschriftstypen (blau & grün) */
.section-header {
  padding: 0.8rem 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: white;
}

.section-header.blue {
  background-color: #3498db;
}

.section-header.green {
  background-color: var(--accent-green);
}

/* Timeline-Stil für Antragsteller/Kinder-Daten - spezifische Klassen */
.timeline-list,
.info-timeline,
.data-timeline,
.applicant-data,
.child-data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline-list::before,
.info-timeline::before,
.data-timeline::before,
.applicant-data::before,
.child-data-list::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: #eaeaea;
  z-index: 0;
}

.timeline-list li,
.info-timeline li,
.data-timeline li,
.applicant-data li,
.child-data-list li {
  position: relative;
  padding: 12px 0 12px 45px;
  margin: 0;
  border-bottom: 1px solid #f1f1f1;
}

.timeline-list li:last-child,
.info-timeline li:last-child,
.data-timeline li:last-child,
.applicant-data li:last-child,
.child-data-list li:last-child {
  border-bottom: none;
}

.timeline-list li::before,
.info-timeline li::before,
.data-timeline li::before,
.applicant-data li::before,
.child-data-list li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--accent-green);
  border-radius: 50%;
  z-index: 1;
}

/* Override für die generellen Listen-Styles */
.timeline-list li::before,
.info-timeline li::before,
.data-timeline li::before,
.applicant-data li::before,
.child-data-list li::before {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  content: attr(data-count);
}

/* Spezifische Klassen für Info-Labels und Values */
.timeline-label,
.info-label,
.data-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 3px;
}

.timeline-value,
.info-value,
.data-value {
  display: block;
  font-weight: 500;
  color: var(--text-dark);
}

/* Header-Styles für die Abschnitte */
.section-header,
.info-header,
.data-section-header {
  padding: 10px 15px;
  background-color: #3498db;
  color: white;
  font-weight: 600;
  margin-bottom: 15px;
}

.section-header.green,
.info-header.green,
.data-section-header.green {
  background-color: var(--accent-green);
}

/* Dreispaltiges Layout für ticket-container */
div.form-container,
div[class="form-container"],
form > div[class*="form-container"] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
  width: 100%;
}

/* Styling für die ticket-container innerhalb des Grids */
.ticket-container {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* Höhere Spezifität für flex-Override */
div.form-container[style*="flex"],
div[class="form-container"][style*="flex"] {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
  div.form-container,
  div[class="form-container"],
  form > div[class*="form-container"],
  div.form-container[style*="flex"],
  div[class="form-container"][style*="flex"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  div.form-container,
  div[class="form-container"],
  form > div[class*="form-container"],
  div.form-container[style*="flex"],
  div[class="form-container"][style*="flex"] {
    grid-template-columns: 1fr !important;
  }
}

