/* Universal reset and layout fix */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Poppins', sans-serif;
  background: #e4e4e4 url('Group29.png') no-repeat bottom -2vh right -5vw;
  background-size: 30vw auto;
  background-attachment: fixed;
}

button {
  font-family: 'Poppins', sans-serif;
}

.navbar {
  background-color: #004f51;
  padding: 1rem 2rem;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.navbar span {
  color: #00b3a4;
}

.navbar button {
  padding: 0.4rem 0.75rem;
  background-color: #00b3a4;
  border: none;
  color: white;
  border-radius: 0.25rem;
  cursor: pointer;
  margin-left: 0.3rem;
}

.navbar button:hover {
  background-color: #008f87;
}

.container {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.paneel {
  background: white;
  border-radius: 0.625rem;
  box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 18rem;
  min-height: 6.25rem;
  overflow: hidden;
}

.paneel::before {
  content: '';
  height: 1.875rem;
  width: 100%;
  background-color: #004f51;
  border-top-left-radius: 0.625rem;
  border-top-right-radius: 0.625rem;
  position: absolute;
  top: 0;
  left: 0;
}

.opdrachten {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 36.875rem;
  padding-right: 0.625rem;
}

.opdracht {
  background: #f9f9f9;
  border-radius: 0.9375rem;
  margin-bottom: 0.9375rem;
  padding: 0.9375rem;
}

.opdracht h3 {
  margin: 0 0 0.3125rem;
}

.opdracht .cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.625rem;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.opdracht .cta button {
  background: #004f51;
  color: white;
  padding: 0.5rem 0.9375rem;
  border: none;
  border-radius: 1.25rem;
  cursor: pointer;
}

.opdracht-info {
  flex: 2;
  padding: 1.25rem;
}

.opdracht-info img {
  width: 100%;
  border-radius: 0.625rem;
  margin: 0.625rem 0;
}

.welkom {
  flex: 1;
  padding: 1.25rem;
  color: #004f51;
  background: none;
}

.welkom h1 {
  font-size: 1.8rem;
  font-weight: 300;
}

.welkom h1 span {
  font-weight: 700;
}

:root {
  --searchbar-bg: #d6e4e5;
  --searchbar-border: #ccc;
  --searchbar-text: #000000;
  --searchbar-button-bg: #00b3a4;
  --searchbar-button-text: #ffffff;
  --searchbar-button-hover: #009688;
}

.searchbar-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.searchbar-container form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.searchbar-container input[type="text"] {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--searchbar-border);
  border-radius: 0.25rem;
  background-color: var(--searchbar-bg);
  color: var(--searchbar-text);
  width: 100%;
  max-width: 28.125rem; /* 450px -> rem */
  font-family: 'Poppins', sans-serif;
}

.searchbar-container button {
  padding: 0.375rem 0.75rem;
  background-color: var(--searchbar-button-bg);
  border: none;
  color: var(--searchbar-button-text);
  border-radius: 0.25rem;
  cursor: pointer;
}

.searchbar-container button:hover {
  background-color: var(--searchbar-button-hover);
}

.opdracht p:nth-of-type(1) {
  color: #666;
  font-weight: 500;
}

.opdracht-info h4 {
  color: #666;
  font-weight: 500;
}

.paneel.opdracht-info {
  display: none;
  position: relative;
}

.paneel.opdracht-info.active {
  display: block;
}

.close-btn {
  position: absolute;
  top: 2px;
  right: 12px;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}

.close-btn:hover {
  color: black;
}

.opdracht p {
  margin: 0.2rem 0;
}

/* Responsive styles */
@media (max-width: 64rem) {
  .container {
    flex-direction: column;
    padding: 0.625rem;
  }

  .paneel {
    width: 100%;
  }

  .searchbar-container form {
    flex-direction: column;
    width: 100%;
  }

  .searchbar-container input[type="text"],
  .searchbar-container button {
    width: 100%;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }

  .opdracht .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  body {
    background-attachment: scroll; /* prevents mobile lag */
  }
}
