/*
 * Basisstijl voor de random generator UI.
 *
 * Dit bestand bevat alleen presentatie: layout, kleuren, knoppen en resultaatvak.
 * Functioneel gedrag staat in de JavaScript-bestanden en Flask-routes.
 */

:root {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  color: #172033;
  background: #f5f7fb;
}

body { margin: 0; }

/* Browser hidden attribute must win over component display styles.
   Without this, .modal-backdrop { display: flex; } can accidentally make
   the About modal visible immediately on page load. Tiny CSS trap, naturally. */
[hidden] {
  display: none !important;
}


/* Centrale contentbreedte. */
.container {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 16px;
}

/* Witte kaart voor formulier en resultaat. */
.card {
  background: white;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.07);
  margin-bottom: 20px;
}

h1, h2 { margin-top: 0; }
.muted { color: #5d6b82; }

/* Responsieve grid voor de formulierinstellingen. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
}

input, select {
  padding: 10px 12px;
  border: 1px solid #ccd4e0;
  border-radius: 10px;
  font: inherit;
}

.checks {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.checks label {
  flex-direction: row;
  align-items: center;
  font-weight: 500;
}

.buttons {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  background: #172033;
  color: white;
}

button[type="reset"], #copy-button {
  background: #e7ebf3;
  color: #172033;
}

/* Resultaat wordt monospaced getoond zodat JSON/CSV leesbaar blijft. */
pre {
  background: #111827;
  color: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
  min-height: 80px;
}

.errors {
  color: #a4001d;
  font-weight: 700;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.result-header h2 { margin: 0; }

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7ebf3;
  color: #172033;
  font-size: 20px;
}

label.disabled { opacity: .55; }
input:disabled { background: #eef2f7; cursor: not-allowed; }

.download-button {
  border: 1px solid #1f2937;
  background: #172033;
  color: white;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
}

.download-button:hover { background: #243247; }

/* Vlaggetjes voor taalkeuze. */
.lang-flags {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 12px;
  font-size: 28px;
}

.lang-flags a {
  text-decoration: none;
  filter: saturate(0.95);
  transition: transform .15s ease;
}

.lang-flags a:hover { transform: scale(1.1); }

.lang-flags a.active {
  transform: scale(1.12);
  filter: saturate(1.25);
  text-shadow: 0 0 0 3px rgba(23,32,51,.18);
}

/* Deelknop: zichtbaar na generatie, maar zonder de URL op het scherm te tonen. */
.share-result-panel {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-result-button {
  background: #e7ebf3;
  color: #172033;
  border: 1px solid #cfd6e3;
}

.share-result-button:hover {
  background: #dbe2ee;
}

.share-result-status {
  color: #1f6b42;
  font-weight: 700;
}

/* Topbar voor About-knop en taalvlaggen. */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.about-button {
  background: #e7ebf3;
  color: #172033;
  border: 1px solid #cfd6e3;
  padding: 0.55rem 0.85rem;
}

.about-button:hover { background: #dbe2ee; }

/* De oude vlaggenklasse blijft bestaan, maar zit nu in de topbar. */
.topbar .lang-flags { margin-bottom: 0; }

/* About-modal. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-card {
  background: white;
  color: #172033;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  max-width: 760px;
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e6ebf3;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h2 { margin: 0; }

.modal-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: #e7ebf3;
  color: #172033;
  font-size: 24px;
  line-height: 1;
}

.about-content h3 {
  margin: 18px 0 6px;
}

.about-content p {
  margin: 0;
  line-height: 1.55;
  color: #38445a;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  border-top: 1px solid #e6ebf3;
  padding-top: 16px;
}
