/* stijl.css - Stylesheet for HCDB Kaarten application */

* {
  margin: 0;
  padding: 0;

  --main-background-color: #f7f7f7;
  --input-background-color: #ffe770;
  --card-background-color: #ffffff;
  --panel-background-color: #f0f4f8;
  --text-color: #222;
  --muted-text-color: #555;
  --accent-color: #024fa8;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --heading-shadow: 8px 8px 16px rgba(0, 0, 0, 0.35);
  --hcdb-main-color: #ffd800;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

html {
  height: 100%;
  box-sizing: border-box;
}

body {
  position: relative;
  min-height: 100%;
  margin: 0;
  padding: 2rem 1.5rem 7rem;
  background: var(--main-background-color);
  color: var(--text-color);
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
}

body.is-busy,
body.is-busy * {
  cursor: wait !important;
}

input[type="submit"]:disabled,
button:disabled {
  opacity: 0.7;
  cursor: wait;
}

h1,
h2,
h3 {
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2rem;
}

h2,
h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  text-decoration: underline;
}

/* Shared page width */
.page-header,
div#formulier,
.result-wrap {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Header */
.page-header {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  column-gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  text-align: left;
  color: var(--hcdb-main-color);
  -webkit-text-stroke: 1px black;
  filter: drop-shadow(var(--heading-shadow));
}

.page-header .hdrimg {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
  border-radius: 6px;
  filter: drop-shadow(var(--heading-shadow));
}

/* Card blocks */
div#formulier,
.result-wrap {
  background: var(--card-background-color);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px var(--shadow-color);
}

.result-wrap {
  margin-top: 1rem;
}

.result-meta {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--panel-background-color);
  border-radius: 6px;
}

.result-meta p {
  margin-bottom: 0.5rem;
}

.result-meta p:last-child {
  margin-bottom: 0;
}

.result-actions {
  margin: 1.5rem 0;
}

.result-note {
  margin-top: 1rem;
  color: var(--muted-text-color);
  font-size: 0.95rem;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 80px;
  gap: 0.9rem 0.8rem;
  align-items: center;
}

.full {
  grid-column: 1 / -1;
}

.section-title h3 {
  margin: 0.75rem 0 0.25rem;
}

.form-label {
  font-weight: 500;
}

.form-field {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.form-field input[type="date"] {
  flex: 1 1 0;
  min-width: 0;
}

.form-field input[type="text"],
.form-field input[type="number"] {
  width: 100%;
  max-width: 320px;
}

.form-aside {
  text-align: right;
}

.spacer {
  height: 0.5rem;
}

.cardtype-options {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

/* Parking section aligned to the same columns as the form */
.parking-section {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 80px;
  gap: 0.9rem 0.8rem;
  align-items: start;
}

.parking-left {
  grid-column: 1;
  min-width: 0;
}

.parking-right {
  grid-column: 2 / 4;
  min-width: 0;
}

.parking-left .section-title h3,
.parking-right .section-title h3 {
  margin: 0.75rem 0 0.25rem;
}

.parking-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-top: 0.25rem;
}

.parking-map-panel {
  width: 100%;
  background: #808080;
  border-radius: 8px;
  overflow: hidden;
}

.parking-map {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
}
/* end parking section */

/* Form controls */
input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  background-color: var(--input-background-color);
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  color: var(--text-color);
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  margin-right: 0.35rem;
  accent-color: var(--accent-color);
}

input[type="color"] {
  padding: 0.15rem;
  width: 3rem;
  height: 2.2rem;
  border-radius: 6px;
}

input[type="submit"],
button {
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent-color);
  color: #fff;
  font-size: 1rem;
}

input[type="submit"]:hover,
button:hover {
  opacity: 0.92;
}

ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}

li {
  margin: 0.25rem 0;
  word-break: break-all;
}

.hidden {
  display: none;
}

.footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1rem;
  background-color: var(--main-background-color);
  text-align: center;
}

.wmbase {
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

/* Small screens */
@media (max-width: 700px) {
  .page-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    row-gap: 1rem;
  }

  .page-header h1 {
    text-align: center;
  }

  .page-header .hdrimg {
    max-width: 120px;
  }

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

  .form-label,
  .form-field,
  .form-aside,
  .cardtype-options,
  .form-actions {
    grid-column: 1;
  }

  .form-aside {
    text-align: left;
  }

  .form-field {
    flex-direction: column;
    align-items: stretch;
  }

  .form-field input[type="text"],
  .form-field input[type="number"] {
    max-width: none;
  }

  /* Mobile parking section */
  .parking-section {
    grid-template-columns: 1fr;
  }

  .parking-left,
  .parking-right {
    grid-column: 1;
  }

  .parking-right .section-title {
    display: none;
  }

  .parking-map-panel {
    margin-top: 0.5rem;
  }
  /* end mobile parking section */
}

/* Show pdf preview when hovering over pdf links in the result */
.pdf-preview-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.pdf-preview-item iframe {
  display: block;
  width: 100%;
  min-height: 500px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
}

/* Image select styles */
.image-preview {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  padding: 6px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-preview img {
  display: block;
  max-width: 300px;
  max-height: 200px;
}

.hidden {
  display: none;
}

/* Additional styles for form field notes and PDF previews */
.form-field small {
  color: var(--muted-text-color);
  font-size: 0.9rem;
}

.form-field small {
  color: var(--muted-text-color);
  font-size: 0.9rem;
}

.pdf-preview-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.pdf-preview-item iframe {
  display: block;
  width: 100%;
  min-height: 500px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
}

.image-preview {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  padding: 6px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 40px;
  min-height: 40px;
}

.image-preview img {
  display: block;
  max-width: 300px;
  max-height: 200px;
}
