/* Grundlayout und Schrift */
body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background-color: #fff8e7;
  color: #1b1b6e;
}

a:hover {
  text-decoration: none;
}

p {
  font-size: 1rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1, h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1b1b6e;
  text-align: left;
}

h2 {
  text-align: left;
}

a.Logo-Link {
  color: #1C1C4A;
  text-decoration: none;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.logo {
  font-family: 'Chewy', 'regular';
  font-size: 3rem;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.sonnencreme {
  width: 35px;
  transform: rotate(40deg);
  margin-left: 12px;
  margin-top: 0;
}

.uv-header #uv-index {
  font-size: 3rem;
  font-weight: bold;
  margin: 0;
}

.uv-button {
  text-decoration: none;
}

/* Hauptbereich */
main {
  display: grid;
  grid-template-columns: repeat(19, 1fr);
  gap: 2rem;
  padding: 2rem;
  margin-top: 4rem;
}


.erklärseite {
  grid-column: 2 / 15;
  background-color: #FFF4D2;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* UV-Anzeige */
.uv-display {
  grid-column: 13 / 18;
  border-radius: 12px;      
  overflow: hidden;         
  padding: 1.5rem;
  text-align: center;
}

.uv {
  padding: 0.5rem;
  text-align: center;
  font-weight: bold;
}

.uv.schwach {
  background-color: #D3E4CD;
  color: #4F9A5E;
}

.uv.mittel {
  background-color: #FFEB99;
  color: #FFB84C;
}

.uv.hoch {
  background-color: #FF7F7F;
  color: #B20000;
}

.uv.sehr-hoch {
  background-color: #FF2D00;
  color: white;
}

.uv.extrem {
  background-color: #B20000;
  color: white;
}

/* Tabellen */
.table-container {
  border-radius: 12px;
  overflow: hidden;
  background-color: #FFF4D2;
  margin-top: 2rem;
}

.table-container table,
.empfehlungstabelle {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 90%;
}

/* Ecken in Kopfzeile */
.table-container table thead tr:first-child th:first-child,
.empfehlungstabelle thead tr:first-child th:first-child {
  border-top-left-radius: 12px;
}

.table-container table thead tr:first-child th:last-child,
.empfehlungstabelle thead tr:first-child th:last-child {  
  border-top-right-radius: 12px;
}

.table-container table tbody tr:last-child td:first-child,
.empfehlungstabelle tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.table-container table tbody tr:last-child td:last-child,
.empfehlungstabelle tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

th, td,
.empfehlungstabelle th, .empfehlungstabelle td {
  padding: 1rem;
  padding-right: 0;
  text-align: left;
  font-weight: normal;
  border: 1px solid transparent;
}

th,
.empfehlungstabelle th {
  background-color: #1C1C4A;
  color: white;
}

td,
.empfehlungstabelle td {
  background-color: #fff8e7;
}

.table-container {
  margin-top: 0;
}

/* Formelbox */
.formel-tabelle {
  /* margin: 2rem auto; */
  font-size: 1.2rem;
  color: #1C1C4A;
  background-color: #FFF4D2;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.formel-tabelle td {
  padding: 1rem;
  font-weight: bold;
}

/* Ecken gezielt abrunden */
.formel-tabelle tr:first-child td:first-child {
  border-top-left-radius: 12px;
}

.formel-tabelle tr:first-child td:last-child {
  border-top-right-radius: 12px;
}


/* Prognose-Box */
.forecast {
  grid-column: 15 / 19;
  background-color: #FFF4D2;
  padding: 1.5rem;
  border-radius: 12px;      /* von 16px auf 12px geändert */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: fit-content;
  overflow: hidden;         /* overflow hidden für abgerundete Ecken */
}

.uv-display > *, 
.forecast > * {
  border-radius: inherit;
}

.forecast h2 {
  margin-bottom: 1rem;
  text-align: center;
  justify-content: center;
}

#uv-forecast {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.uv-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-color: #1C1C4A1A;
  color: #1C1C4A;
  font-size: 1.2rem;
  padding: 1rem;
  border-radius: 16px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  width: 100px;
}

.uv-wert {
  font-weight: bold;
  font-size: 1.1em;
  color: #1C1C4A;
  margin-bottom: 4px;
}

.uv-zeit {
  font-size: 0.9em;
  color: #1C1C4A;
}

.uv-label {
  color: #1C1C4A;
  font-size: 0.5em;
}


/* Farbliche Anpassung je nach UV-Wert */
.uv-low {
  color: #B3E5FC !important;
}

.uv-moderate {
  color: #FFE082 !important;
}

.uv-high {
  color: #FFB74D !important;
}

.uv-veryhigh {
  color: #CE93D8 !important;
}

.uv-extreme {
  color: darkred !important;
}

/* Responsive Layout für mobile Geräte */
@media (max-width: 992px) {
  /* Header anpassen */
  header {
    flex-direction: row;  
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff8e7;
  }

  .logo {
    font-size: 2rem;
    display: flex;
    align-items: center;
  }

  .sonnencreme {
    width: 26px;
    transform: rotate(40deg);
    margin-left: 10px;
    margin-top: 0;
  }

  /* UV-Display in Header rechts oben */
  .uv-display {
    position: static; 
    order: 2;
    border-radius: 12px;
    /* padding: 0.5rem 1rem; */
    background-color: transparent;
    width: auto;
    max-width: 150px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  /* UV-Index und Spruch im Header kleiner */
  .uv-header #uv-index {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
  }

  .uv-spruch-container p {
    margin: 0;
    font-size: 0.85rem;
    color: #1C1C4A;
  }

  /* Hauptbereich anpassen */
  main {
    display: flex !important;
    flex-direction: column;
    padding: 1rem;
    gap: 2rem;
    margin-top: 2rem;
  }

  .table-container table{
    width: 100%;
  }

  main > .uv-display {
    display: none;
  }

  .erklärseite_button {
    margin-top: 0;
    font-size: 1rem;
  }

  /* Grid Column Überschreibungen */
  .uv-display,
  .SPF_Rechner,
  .forecast,
  .erklärseite {
    width: 100%;
    max-width: 100%;
    padding: 1.2rem;
    box-sizing: border-box;
    grid-column: unset !important;
  }

  .inputs label {
    margin-top: 2rem;
    font-size: 1rem;
  }

  .hauttyp_options span,
  .Sonnenzeit_options span {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }

  button {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem;
  }

  #spf-ergebnis {
    text-align: center;
    margin-top: 1rem;
  }

  #uv-forecast {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .uv-box {
    width: 80px;
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .forecast {
    order: 4;
  }

  .uv-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #1C1C4A1A;
    color: #1C1C4A;
    font-size: 1.2rem;
    padding: 1rem;
    border-radius: 16px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100px;
  }

  .erklärseite {
    order: 3;
    text-align: left;
    font-size: 1rem;
    background-color: #FFF4D2;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
  }

  .formel-wrapper {
    border-radius: 12px !important;
    overflow: hidden;
  }
  
  .formel-label {
    font-weight: bold;
    white-space: nowrap;
  }
  
  .formel-math {
    flex: 1;
    min-width: 200px;
    font-size: 1.1rem;
    text-align: center;
  }

  .uv-display {
    order: 1;
    padding: 0;
  }
  .SPF_Rechner {
    order: 2;
  }
}
