/* =========================================================
   GENERELT
   ========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f6f7;
  color: #222;
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

h2 {
  margin-top: 0;
}

p {
  line-height: 1.5;
}


/* =========================================================
   KALENDERHEADER
   ========================================================= */

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.calendar-header h2 {
  margin: 0;
  text-align: center;
  flex: 1;
  text-transform: capitalize;
}

.calendar-nav {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;

  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;

  cursor: pointer;
  font-size: 22px;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.calendar-nav:hover:not(:disabled) {
  background: #f1f1f1;
  border-color: #888;
}

.calendar-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}


/* =========================================================
   KALENDERVÆRKTØJER
   I DAG / GÅ TIL DATO
   ========================================================= */

.calendar-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;

  margin-bottom: 20px;
}

.date-jump {
  margin-left: auto;
}

.date-jump label {
  margin-top: 0;
}

.date-jump-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-jump-controls input {
  width: auto;
  min-width: 170px;
}

.calendar-tool-button {
  min-height: 44px;
  padding: 10px 18px;

  border: 1px solid #bbb;
  background: #fff;
  border-radius: 6px;

  font-size: 15px;
  color: #222;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.calendar-tool-button:hover:not(:disabled) {
  background: #f1f1f1;
  border-color: #888;
}

.calendar-tool-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* =========================================================
   KALENDERGRID
   ========================================================= */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekday {
  text-align: center;
  font-weight: bold;
  padding: 7px 3px;
  font-size: 14px;
}


/* =========================================================
   KALENDERDAGE – STANDARD
   ========================================================= */

.calendar-day {
  min-height: 82px;
  position: relative;
  padding: 9px;

  border: 2px solid #66bb6a;
  border-radius: 8px;

  /*
   * Standardtilstanden er LEDIG.
   */
  background: #e8f5e9;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.day-number {
  font-weight: bold;
  font-size: 16px;
}

.day-status {
  position: absolute;

  bottom: 7px;
  left: 7px;
  right: 7px;

  font-size: 11px;
  line-height: 1.25;
}


/* =========================================================
   LEDIG – GRØN
   ========================================================= */

.calendar-day:not(.partial):not(.full):not(.past):not(.empty) {
  background: #e8f5e9;
  border-color: #66bb6a;
}

.calendar-day:not(.partial):not(.full):not(.past):not(.empty) .day-status {
  color: #2e7d32;
  font-weight: 600;
}


/* =========================================================
   DELVIST OPTAGET / RESERVERET – GUL
   ========================================================= */

.calendar-day.partial {
  background: #fff3cd;
  border-color: #f0ad4e;
}

.calendar-day.partial .day-status {
  color: #805400;
  font-weight: 600;
}


/* =========================================================
   OPTAGET – RØD
   ========================================================= */

.calendar-day.full {
  background: #f8d7da;
  border-color: #dc3545;

  cursor: not-allowed;
}

.calendar-day.full .day-status {
  color: #842029;
  font-weight: 600;
}


/* =========================================================
   FORTID – GRÅ
   ========================================================= */

.calendar-day.past {
  background: #eeeeee;
  border-color: #cccccc;

  opacity: 0.6;

  cursor: not-allowed;
}

.calendar-day.past .day-status {
  color: #666;
}


/* =========================================================
   TOMME KALENDERFELTER
   ========================================================= */

.calendar-day.empty {
  background: transparent;
  border-color: transparent;

  cursor: default;
}


/* =========================================================
   VALGT DATO
   ========================================================= */

.calendar-day.selected {
  outline: 3px solid #222;
  outline-offset: 2px;

  box-shadow: 0 0 0 2px #fff;
}


/* =========================================================
   HOVER
   ========================================================= */

@media (hover: hover) and (pointer: fine) {

  .calendar-day:not(.full):not(.past):not(.empty):hover {
    transform: translateY(-2px);
    border-color: #333;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.08);
  }
}


/* =========================================================
   KALENDERFORKLARING / LEGEND

   Understøtter både den oprindelige HTML:
     legend / legend-box

   og den nyere:
     calendar-legend / legend-color
   ========================================================= */

.legend,
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;

  margin-top: 18px;
  margin-bottom: 18px;

  font-size: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-box,
.legend-color {
  width: 18px;
  height: 18px;

  flex: 0 0 18px;

  border-radius: 4px;
  border: 1px solid #999;
}


/* Ledig */

.legend-available,
.legend-color.available {
  background: #e8f5e9;
  border-color: #66bb6a;
}


/* Delvist optaget / reserveret */

.legend-partial,
.legend-color.partial {
  background: #fff3cd;
  border-color: #f0ad4e;
}


/* Optaget */

.legend-full,
.legend-color.full {
  background: #f8d7da;
  border-color: #dc3545;
}


/* =========================================================
   BOOKINGMULIGHEDER
   ========================================================= */

.booking-option {
  border: 1px solid #ddd;
  border-radius: 7px;

  padding: 18px;
  margin-bottom: 12px;

  background: #fff;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.booking-option:hover {
  background: #f6f6f6;
  border-color: #aaa;
}

.booking-option.unavailable {
  opacity: 0.45;
  cursor: not-allowed;
}

.booking-option.unavailable:hover {
  background: #fff;
  border-color: #ddd;
}

.booking-option.selected {
  border: 2px solid #222;
  background: #fafafa;

  box-shadow: 0 0 0 1px #222;
}

.option-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 6px;
}

.option-price {
  font-size: 19px;
  font-weight: bold;
  margin-top: 8px;
}


/* =========================================================
   FORMULARER
   ========================================================= */

label {
  display: block;

  font-weight: bold;

  margin-top: 16px;
  margin-bottom: 6px;
}

input,
textarea {
  width: 100%;

  padding: 11px;

  border: 1px solid #bbb;
  border-radius: 5px;

  background: #fff;
  color: #222;

  font-family: inherit;
  font-size: 16px;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;

  border-color: #555;

  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}


/*
 * Datovælgerne bruger nu kun dato,
 * ikke datetime-local.
 */
input[type="date"] {
  min-height: 44px;
}


/* =========================================================
   TEXTAREA
   ========================================================= */

textarea {
  min-height: 100px;
  resize: vertical;
}


/* =========================================================
   FORMULAR-RÆKKER
   ========================================================= */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}


/* =========================================================
   CHECKBOX
   ========================================================= */

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;

  margin-top: 18px;
}

.checkbox input {
  width: auto;
  margin-top: 3px;
}

.checkbox label {
  margin: 0;
  font-weight: normal;
}


/* =========================================================
   PRIMÆR KNAP
   ========================================================= */

button.primary {
  min-height: 44px;

  margin-top: 24px;
  padding: 13px 24px;

  border: none;
  border-radius: 6px;

  background: #222;
  color: #fff;

  font-size: 16px;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    opacity 0.15s ease;
}

button.primary:hover:not(:disabled) {
  background: #444;
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* =========================================================
   PRISOVERSIGT
   ========================================================= */

.summary {
  background: #f5f5f5;

  padding: 18px;

  border-radius: 7px;

  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;

  padding: 5px 0;
}

.summary-total {
  border-top: 1px solid #aaa;

  margin-top: 8px;
  padding-top: 10px;

  font-weight: bold;
  font-size: 18px;
}


/* =========================================================
   INFORMATION
   ========================================================= */

.notice {
  background: #f2f2f2;

  padding: 13px;

  border-radius: 6px;

  margin: 14px 0;

  line-height: 1.45;
}


/* =========================================================
   FEJLMEDDELELSE
   ========================================================= */

.error {
  background: #fdecec;
  color: #721c24;

  border: 1px solid #f5c6cb;

  padding: 14px;

  border-radius: 6px;

  margin-bottom: 18px;
}


/* =========================================================
   SUCCESS
   ========================================================= */

.success {
  background: #edf7ed;
  color: #1e4620;

  border: 1px solid #c3e6cb;

  padding: 20px;

  border-radius: 6px;
}


/* =========================================================
   SKJULTE ELEMENTER
   ========================================================= */

.hidden {
  display: none !important;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading {
  text-align: center;
  padding: 30px;

  color: #555;
}


/* =========================================================
   HONEYPOT – SPAMBESKYTTELSE
   ========================================================= */

.hp-field {
  position: absolute !important;

  left: -10000px !important;

  width: 1px !important;
  height: 1px !important;

  overflow: hidden !important;
}


/* =========================================================
   TILGÆNGELIGHED
   ========================================================= */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.booking-option:focus-visible,
.calendar-day:focus-visible {
  outline: 3px solid #222;
  outline-offset: 2px;
}


/* =========================================================
   TABLET / MOBIL
   ========================================================= */

@media (max-width: 650px) {

  body {
    padding: 8px;
  }

  .card {
    padding: 18px;
    border-radius: 8px;
  }


  /* Kalenderheader */

  .calendar-header {
    gap: 8px;
    margin-bottom: 14px;
  }

  .calendar-header h2 {
    font-size: 20px;
  }


  /* I dag / gå til dato */

  .calendar-tools {
    align-items: stretch;
    gap: 12px;
  }

  .calendar-tool-button {
    min-height: 44px;
  }

  #todayButton {
    width: 100%;
  }

  .date-jump {
    width: 100%;
    margin-left: 0;
  }

  .date-jump-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .date-jump-controls input {
    width: 100%;
    min-width: 0;
  }


  /* Kalender */

  .calendar-grid {
    gap: 3px;
  }

  .weekday {
    font-size: 12px;
    padding: 5px 1px;
  }

  .calendar-day {
    min-height: 57px;
    padding: 5px;
    border-width: 1px;
    border-radius: 5px;
  }

  .day-number {
    font-size: 15px;
  }

  /*
   * På telefonen skjules statusteksten.
   * Farverne viser stadig status.
   */
  .day-status {
    display: none;
  }

  .calendar-day.selected {
    outline-width: 2px;
    outline-offset: 1px;
  }


  /* Legend */

  .legend,
  .calendar-legend {
    gap: 10px 16px;

    font-size: 13px;

    margin-top: 14px;
    margin-bottom: 16px;
  }


  /* Formular */

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }


  /* Prisoversigt */

  .summary-row {
    gap: 10px;
  }
}


/* =========================================================
   MEGET SMÅ SKÆRME
   ========================================================= */

@media (max-width: 400px) {

  .calendar-header h2 {
    font-size: 18px;
  }

  .calendar-nav {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .calendar-day {
    min-height: 50px;
  }

  .weekday {
    font-size: 11px;
  }

  .date-jump-controls {
    grid-template-columns: 1fr;
  }

  .date-jump-controls .calendar-tool-button {
    width: 100%;
  }

  .legend,
  .calendar-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
}
