/* =========================================
   Allgemeine Basis-Styles
========================================= */

body {
  font-family: 'Open Sans', sans-serif;
  background-color: #EAFFE6;
  margin: 0;
  padding: 0;
  color: #00005D;
  font-size: 18pt;
}

h1, h2, h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: bold;
  margin: 0 0 1rem;
}

h1 { font-size: 32pt; }
h2 { font-size: 26pt; }
h3 { font-size: 22pt; }

header {
  background-color: #533DF6;
  height: 197px;
  display: flex;
  align-items: center;
  justify-content: center;
}

main.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 128px 20px 38px;
  margin: 0 auto;
  max-width: 1100px;
  width: 100%;
}

/* =========================================
   Intro-Bereich
========================================= */

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.intro-text {
  max-width: 60%;
}

.intro ol {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.intro ol li {
  margin-bottom: 0.5rem;
}

.intro img {
  max-width: 35%;
  height: auto;
}

/* =========================================
   Buttons & Toggles
========================================= */

.btn-primary,
.toggle-buttons button {
  background-color: #3CF417;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  font-weight: bold;
  color: #00005D;
}

.btn-primary:hover,
.toggle-buttons button:hover {
  background-color: #533DF6;
  color: white;
}

.toggle-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin: 1rem 0;
}

.toggle-buttons button.active {
  background-color: #533DF6;
  color: white;
}

/* =========================================
   Klapptext-Element
========================================= */

.chart-explanation {
  margin: 1rem 0;
  padding: 1rem;
  background: #f3f7fc;
  border: 1px solid #ccd;
  border-radius: 8px;
}

.chart-explanation summary {
  cursor: pointer;
  font-size: 1rem;
  font-weight: bolder;
  color: #00005D;
}

.chart-explanation summary::-webkit-details-marker {
  display: none;
}

.chart-explanation summary::after {
  content: " ▼";
}

.chart-explanation[open] summary::after {
  content: " ▲";
}

/* =========================================
   Inhaltliche Boxen
========================================= */

.status-box,
.history-box {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 2rem 2.5rem;
  margin-top: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.next-intake {
  background-color: #533DF6;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: bold;
  font-size: 18pt;
  text-align: center;
}

/* =========================================
   Diagramme
========================================= */

.chart-container {
  width: 100%;
  height: 340px;
  max-height: 360px;
  position: relative;
  margin-top: 1rem;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  padding-bottom: 40px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.chart-divider-wrapper {
  width: 100%;
  margin-top: 2rem;
}

.chart-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 0;
}

/* =========================================
   Pop-up Formular
========================================= */

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #533df5;
  color: #00005c;
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  animation: fadeIn 0.4s ease-in-out;
  width: 90%;
  max-width: 550px;
}

.popup form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup label {
  font-weight: bold;
  display: block;
  color: #ffffff;
}

.popup input,
.popup select {
  width: 100%;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  color: #00005D;
  box-sizing: border-box;
}

.wochentage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  align-items: stretch;
}

.wochentage-grid div {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.6rem;
  gap: 0.4rem;
  border: 3px solid #ddd;
  border-radius: 10px;
  color: #00005D;
  min-height: 90px;
  box-sizing: border-box;
}

.wochentage-grid label {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.wochentage-grid input[type="time"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #ffffff;
  color: #00005D;
  text-align: center;
}

.wochentage-grid div:nth-child(7) {
  grid-column: span 2;
  justify-content: center;
}

.close-btn {
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  background-color: #eee;
  color: #00005D;
  transition: all 0.3s ease-in-out;
}

.close-btn:hover {
  background-color: #ccc;
}

/* =========================================
   Footer
========================================= */

footer {
  background-color: #533DF6;
  color: #3CF417;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}


@media (max-width: 480px) {
  body {
    font-size: 14pt;
  }

  h1 { font-size: 22pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 16pt; }

  main.container {
    padding: 64px 16px 32px;
    width: auto;
  }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }

  .intro-text,
  .intro img {
    max-width: 100%;
  }

  .intro img {
    height: auto;
  }

  .intro ol {
    padding-left: 1rem;
    font-size: 0.95rem;
  }

  .intro ol li {
    margin-bottom: 0.4rem;
  }

  .btn-primary,
  .toggle-buttons button,
  .close-btn {
    width: 100%;
    font-size: 1rem;
    padding: 0.75rem 1.2rem;
    margin-top: 0.5rem;
  }

  .toggle-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .chart-container {
    height: 260px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .status-box,
  .history-box {
    padding: 1.5rem;
  }

  .popup {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    padding: 1.2rem;
    border-radius: 16px;
  }

  .popup form {
    gap: 1rem;
  }

  .popup label {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
  }

  .popup input,
  .popup select {
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
  }

  .wochentage-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
  }

  .wochentage-grid div {
    padding: 0.6rem;
    gap: 0.4rem;
    min-height: 85px;
  }

  .wochentage-grid label {
    font-size: 0.9rem;
  }

  .wochentage-grid input[type="time"] {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    text-align: center;
  }

  .wochentage-grid div:nth-child(7) {
    grid-column: span 2;
    justify-content: center;
  }

  .chart-explanation {
    padding: 0.8rem;
    font-size: 0.95rem;
  }

  .chart-explanation summary {
    font-size: 1rem;
  }

  footer {
    padding: 0.8rem;
  }
}
