/* === BASISRESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --vh: 1vh;
}


html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #f4f9fc, #ffffff);
  color: #333;
  overflow-x: hidden;
  display: block;
}

/* === BODY STRUCTUUR === */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 0;
}

/* === HEADER === */
header {
  background: linear-gradient(to bottom right, #5da9e9, #b7e3ff);
  color: #fff;
  padding: 1.2rem 1.5rem;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

header h1 {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #fff;
}

header p {
  font-size: 1.1rem;
  color: #d0ecff;
}

nav {
  margin-top: 10px;
  flex-wrap: wrap;
  display: flex;
  justify-content: center;
  gap: 10px;
}

nav a {
  padding: 10px 20px;
  border-radius: 999px;
  background-color: #ffffff;
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

nav a:hover {
  background-color: #eaf6ff;
  color: #1a7cc7;
  transform: scale(1.07);
}

/* === MAIN === */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* === KAART === */
#map {
  width: 100%;
  height: calc(var(--vh, 1vh) * 60);
  min-height: 400px;
  border-radius: 14px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 5;
}

/* === DATACONTAINER === */
#dataContainer {
  display: none;
  background: #ffffff;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 18px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  text-align: center;
  animation: fadeIn 0.6s ease;
  position: relative;
  z-index: 4;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === RESULTAAT TITEL === */
.result-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.result-title.green {
  color: green;
}

.result-title.red {
  color: red;
}

/* === RESULTAAT AFBEELDING === */
.result-item img,
.result-image {
  margin: 20px 0;
  width: 100%;
  max-width: 250px;
  border-radius: 12px;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.result-image.green:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px green);
}

.result-image.red:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px red);
}

/* === METINGEN LIJST === */
.measurement-list {
  list-style: none;
  margin-top: 1.5rem;
  padding: 0;
  text-align: left;
}

.measurement-item {
  font-size: 1rem;
  padding: 10px 0;
  border-bottom: 1px solid #e2e2e2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.measurement-item .label {
  font-weight: bold;
  flex: 0 0 120px;
}

.measurement-item .value {
  flex: 1;
  color: green;
}

.measurement-item.red .value {
  color: red;
}

/* === BUTTONS === */
button {
  padding: 14px 28px;
  font-size: 1.1rem;
  font-weight: bold;
  background: linear-gradient(to right, #4ab7e8, #3598db);
  color: white;
  border: none;
  border-radius: 999px;
  margin: 20px auto;
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease-in-out;
  box-shadow: 0 6px 12px rgba(74, 144, 226, 0.3);
}

button:hover {
  background: linear-gradient(to right, #3598db, #2c7ac4);
  transform: translateY(-3px) scale(1.05);
}

/* === SPINNER & OVERLAY === */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  position: fixed;
  top: 50%;
  left: 50%;
  margin: -20px 0 0 -20px;
  z-index: 1001;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: none;
  pointer-events: none;
}

/* === FOOTER === */
footer {
  background: #3498db;
  color: white;
  padding: 1.2rem;
  font-size: 0.95rem;
  text-align: center;
  margin-top: auto;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: static;
  z-index: auto;
}

/* === STATUS GLOWS === */
.green-glow {
  box-shadow: 0 0 20px 10px rgba(0, 255, 0, 0.1);
  border: 2px solid rgba(0, 255, 0, 0.3);
  background: linear-gradient(to bottom right, #e0ffe0, #ffffff);
}

.red-glow {
  box-shadow: 0 0 20px 10px rgba(255, 0, 0, 0.1);
  border: 2px solid rgba(255, 0, 0, 0.3);
  background: linear-gradient(to bottom right, #ffe0e0, #ffffff);
}

/* === RESPONSIVE MEDIA QUERIES === */
@media (max-width: 1024px) {
  #map {
    width: 85%;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  nav a {
    padding: 8px 16px;
    font-size: 0.95rem;
  }

  .result-item {
    font-size: 0.75rem;
  }

  #map {
    width: 90%;
  }

  button {
    width: 90%;
    font-size: 1rem;
  }

  .measurement-item {
    flex-direction: row;
    align-items: flex-start;
  }
  .measurement-item .label,
  .measurement-item .value {
    width: 100%;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  nav a {
    font-size: 0.85rem;
  }

  #dataContainer {
    padding: 1.5rem;
  }

  .result-item {
    font-size: 1.3rem;
  }
}