/* General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 8px;
}

.navbar {
  background-color: #ffffff;
  overflow: hidden;
  border-bottom: 1px solid #e9ecef;
}

.nav-menu {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
}

.nav-item {
  float: left;
}

.nav-item a {
  display: block;
  color: #333;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.nav-item a:hover {
  background-color: #e9ecef;
}

.about-section {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.4);
}

.about-content {
  background-color: #ffffff;
  color: #333;
  margin: 15% auto;
  padding: 20px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 80%;
  max-width: 400px;
  text-align: center;
}

.about-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.about-close:hover,
.about-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: #fafafa;
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  color: #333;
  margin-bottom: 40px;
  padding: 20px;
}

header .logo {
  display: block;
  margin: 0 auto 12px;
  width: 300px;
  max-width: 300px;
  height: auto;
  transition: width 0.3s ease;
}

/* Logo on tablets and up */
@media (min-width: 769px) {
  header .logo {
    width: 300px;
  }
}

/* Logo on medium screens (iPad landscape, small laptops) */
@media (max-width: 768px) and (min-width: 481px) {
  header .logo {
    width: 200px;
  }
}

/* Logo on mobile phones */
@media (max-width: 480px) {
  header .logo {
    width: 120px;
  }
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
  font-size: 1.1em;
  opacity: 0.9;
}

/* Search Section */
.search-section {
  margin-bottom: 40px;
}

.search-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  max-width: 60%;
  margin-left: auto;
  margin-right: auto;
}

.search-bar {
  flex: 1;
  padding: 15px 20px;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.search-bar:focus {
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-btn {
  padding: 15px 30px;
  background: #31b9ef;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-btn:hover {
  background: #0dabea;
}

.search-btn:active {
  transform: scale(0.98);
}

/* Rubriek filter */
.filter-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 60%;
  margin: 0 auto 10px;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.filter-container[hidden] {
  display: none;
}

.filter-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 0.8em;
  font-weight: 600;
  color: #666;
  padding-left: 4px;
}

.filter-select {
  width: 100%;
  padding: 11px 40px 11px 16px;
  font: inherit;
  font-size: 0.95em;
  color: #333;
  background-color: white;
  /* eigen pijltje, zodat de keuzelijst er in elke browser hetzelfde uitziet */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  border: 2px solid transparent;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.filter-select:focus {
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* gekozen filter valt op in de kleur van de zoekknop */
.filter-select.active {
  border-color: #31b9ef;
}

.filter-select:disabled {
  color: #aaa;
  background-color: #f3f3f3;
  box-shadow: none;
  cursor: not-allowed;
}

.filter-clear {
  padding: 8px 16px;
  font: inherit;
  font-size: 0.95em;
  font-weight: 600;
  color: #31b9ef;
  background: white;
  border: 2px solid #31b9ef;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.filter-clear:hover {
  color: white;
  background: #31b9ef;
}

.filter-actions[hidden] {
  display: none;
}

.search-hint {
  max-width: 60%;
  margin: 0 auto 12px;
  text-align: center;
  font-size: 0.8em;
  color: #888;
}

.search-status {
  text-align: center;
  color: #333;
  font-size: 0.95em;
  min-height: 20px;
}

/* Results Grid */
.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.image-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.image-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.image-card-thumbnail {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.image-card-id {
  font-weight: 600;
  color: #667eea;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.image-card-title {
  font-size: 0.85em;
  color: #666;
  /*word-break: break-all;*/
  overflow-wrap: break-word;
  word-break: normal;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 8px;
  color: #999;
  font-size: 1.1em;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
  margin-bottom: 15px;
}

.close:hover,
.close:focus {
  color: #000;
}

.modal-body {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex-wrap: wrap;
}

.modal-image-wrapper {
  flex: 1;
  min-width: 300px;
}

#extraImages {
  flex: 1 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

#modalImage {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
}

.modal-info {
  white-space: pre-wrap;
  font-family: "Helvetica", monospace;
  font-size: 0.7em;
  color: #333;
  overflow-y: auto;
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
}

.modal-coordinates {
  white-space: pre-wrap;
  font-family: "Helvetica", monospace;
  font-size: 0.9em;
  color: #333;
  overflow-y: auto;
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
}

/* Responsive Design */

.modal.fullscreen {
  background-color: rgba(0, 0, 0, 1);
}

.modal.fullscreen .modal-content {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.fullscreen .modal-body {
  width: 100%;
  height: 100%;
  gap: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal.fullscreen .modal-image-wrapper {
  width: 100%;
  height: 100%;
  min-width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.fullscreen #modalImage {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2em;
  }

  .search-container {
    flex-direction: column;
    max-width: 100%;
  }

  .filter-container {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .filter-clear {
    width: 100%;
  }

  .search-hint {
    max-width: 100%;
  }

  .results-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-body {
    flex-direction: column;
  }

  .modal-image-wrapper {
    min-width: auto;
  }

  #extraImages {
    flex: 1 100%;
    order: 2;
  }

  #modalInfo {
    order: 3;
  }
}

#modalImage.expanded {
  max-height: 80vh;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Loading State */
.loading {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: blink 1.4s infinite;
  margin-left: 5px;
}

@keyframes blink {
  0%,
  20%,
  50%,
  80%,
  100% {
    opacity: 1;
  }
  40% {
    opacity: 0.2;
  }
  60% {
    opacity: 0.5;
  }
}
