/* ---------------------- */
/* BASISSTIJL EN STRUCTUUR */
/* ---------------------- */
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #333;
}

.container {
  max-width: 500px;
  margin: 60px auto;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.content-container {
  max-width: 80%;
  margin: 60px auto;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.user-container {
  max-width: 800px;
  margin: 60px auto;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

h2 {
  margin-top: 0;
  text-align: center;
}

h3 {
  margin-top: 0;
  text-align: left;
  color: #005b96;
}

/* ---------------------- */
/* FORMULIEREN EN KNOPPEN */
/* ---------------------- */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input {
  padding: 10px;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
}

button {
  padding: 10px;
  font-size: 1rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

button.red {
  display: inline-block;
  width: auto;
  padding: 10px 16px; /* optioneel: ruimte rondom de tekst */
  font-size: 1rem;
  background-color: #b00020;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap; /* voorkomt afbreken op kleine schermen */
}

button.red:hover {
  opacity: 0.9;
}

.btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  margin: 10px auto;
  background-color: #007BFF;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
  text-align: center;
}

.btn:hover {
  background-color: #0056b3;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 10px;
    display: flex; 
    flex: 2
    justify-content: space-between;
}

.btn-small:hover {
    background-color: #0056b3;
}

/* ---------------------- */
/* NAVIGATIE EN LINKS */
/* ---------------------- */
.back-link {
  text-align: left;
  font-size: 0.9rem;
}

.back-link a {
  float: none !important;
  display: inline-block;
  margin-top: 25px;
  color: #007bff;
  text-decoration: none;
  font-size: 0.95rem;
}

.back-link a:hover {
  text-decoration: underline;
}

.admin-link {
    text-align: right;
    margin-bottom: 10px;
}

.admin-link a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.admin-link a:hover {
    text-decoration: underline;
}

label strong {
    color: #007bff;
}

/* ---------------------- */
/* FOUTMELDINGEN EN BERICHTEN */
/* ---------------------- */
.error {
  color: #b00020;
  background: #fdd;
  padding: 10px;
  border: 1px solid #faa;
  border-radius: 5px;
  margin-bottom: 15px;
  text-align: center;
}

.success-msg {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 30px;
}

/* ---------------------- */
/* VOORTGANGSBALK */
/* ---------------------- */
#progress-container {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 20;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
}

.progress-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

#progress-container:hover {
  background-color: #f1f1f1;
  cursor: pointer;
}

#progress-container label {
  font-weight: bold;
  flex-shrink: 0;
  min-width: 100px;
}

#progress-container progress {
  flex: 1;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 100%;
}

#progress-text {
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
  color: #333;
}

progress::-webkit-progress-bar {
  background-color: #eee;
  border-radius: 10px;
  overflow: hidden;
}

progress::-webkit-progress-value {
  background-color: #4caf50;
  border-radius: 10px 0 0 10px;
}

progress::-moz-progress-bar {
  background-color: #4caf50;
  border-radius: 10px;
}

/* ---------------------- */
/* CHECKLIST TABEL */
/* ---------------------- */
h2.checklist-user {
  margin-top: 25px
}

.checklist-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  background-color: #fff;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.checklist-section {
  margin-bottom: 40px;
  background: #fff;
  position: relative;
}

.checklist-section h3 {
  position: sticky;
  top: 78px;
  background: #ffffff;
  padding: 10px 16px;
  margin: 0;
  font-size: 1.2em;
  border-bottom: 1px solid #eee;
  z-index: 10;
}

.checklist-table thead {
  background-color: #f4f4f4;
}

.checklist-table th,
.checklist-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  word-wrap: break-word;
}

.checklist-table th {
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

.checklist-table th:last-child {
  text-align: right;
}

.checklist-table thead th.col-85, .checklist-table tbody td.col-85, col.col-85 {
  width: 85%;
}

.checklist-table thead th.col-15, .checklist-table tbody td.col-15, col.col-15 {
  width: 15%;
  text-align: right;
}

.checklist-table input[type="checkbox"] {
  transform: scale(1.0);
  cursor: pointer;
}

input[type="checkbox"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-width: 24px;
  min-height: 24px;
  cursor: pointer;
}

.checklist-section h3.completed-category {
  background-color: #d4edda !important;
  border-bottom: 1px solid #c3e6cb; /* optioneel: iets groener randje */
}

/* ---------------------- */
/* TOPBAR EN UITLOGGEN */
/* ---------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4f4f4;
  padding: 10px 20px;
  border-bottom: 1px solid #ccc;
}

.autosave-msg {
  font-size: 0.9em;
  color: green;
}

.logout-btn {
  padding: 6px 12px;
  background: #c62828;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.logout-btn:hover {
  background: #b71c1c;
}

.password-btn {
  padding: 6px 12px;
  background: #909090;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.password-btn:hover {
  background: #7c7c7c;
}

.btn-logout-small {
  padding: 10px 20px;
  background-color: #c62828;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease-in-out;
  display: inline-block;
  width: 150px;
}

.btn-logout-small:hover {
  background-color: #b71c1c;
}

/* ---------------------- */
/* ADMIN GEBRUIKERSTABEL */
/* ---------------------- */
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 30px;
  background-color: #fff;
}

.admin-users-table th,
.admin-users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #ccc;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) {
  width: 7%;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
  width: 20%;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
  width: 24%;
}

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
  width: 18%;
  text-align: right;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) {
  width: 20%;
}

/* ---------------------- */
/* TOEZICHTHOUDER GEBRUIKERSTABEL */
/* ---------------------- */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.dashboard-table th,
.dashboard-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.dashboard-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.dashboard-table th.actions {
  text-align: center;
}

.dashboard-table td.actions {
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.icon-btn {
    display: inline-block;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration-line: none;
    font-size: 1.2em;
    padding: 6px 10px;
}

.icon-btn:hover {
    background-color: #f0f0f0;
    border-radius: 6px;
}

.btn-row {
    text-align: center;
    margin-top: 40px;
}

.btn-row form {
    display: inline-block;
    margin: 0 10px;
}

.btn-row button {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

.password-btn {
    background-color: #909090;
}

.password-btn:hover {
    background-color: #7c7c7c;
}

.no-users {
    text-align: center;
    margin-top: 40px;
}

.percentage-col {
    text-align: right;
}

/* ---------------------- */
/* DARK MODE STIJLEN */
/* ---------------------- */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }
  
  a {
    color: #66b2ff;
  }

  a:hover {
    color: #99ccff;
  }

  .admin-link a {
      color: #4da3ff;
  }
  
  .share-container {
    background-color: #1e1e1e;
    border-color: #444;
  }

  .share-container input[type="text"] {
    background-color: #2c2c2c;
    border-color: #555;
    color: #f0f0f0;
  }

  .container,
  .content-container,
  .user-container {
    background-color: #1c1c1c;
    box-shadow: 0 4px 15px rgba(255,255,255,0.05);
  }

  .topbar {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
  }

  .checklist-section h3 {
    background-color: #1e1e1e;
    border-bottom: 1px solid #444;
  }

  .checklist-table,
  .admin-users-table {
    background-color: #1e1e1e;
    color: #e0e0e0;
  }

  .checklist-table thead,
  .admin-users-table thead {
    background-color: #2c2c2c;
  }

  .checklist-table th,
  .checklist-table td,
  .admin-users-table th,
  .admin-users-table td {
    border-bottom: 1px solid #444;
  }
  
  .checklist-table th {
  color: #ffffff; /* i.p.v. #333 */
}

  #progress-container {
    background-color: #1c1c1c;
  }

  #progress-container:hover {
    background-color: #2a2a2a;
  }

  #progress-text {
    color: #ddd;
  }

  progress::-webkit-progress-bar {
    background-color: #444;
  }

  progress::-webkit-progress-value,
  progress::-moz-progress-bar {
    background-color: #4caf50;
  }

  .success-msg {
    background-color: #2e7d32;
    border-color: #1b5e20;
    color: #c8e6c9;
  }
  
  tr.toggle-header.completed {
    background-color: #2c2c2c !important;
    color: #ffffff !important;
  }
  
  .toggle-header {
  	background-color: #2c2c2c !important;
  	color: #ffffff !important;
  }

  .toggle-header:hover {
  	background-color: #3a3a3a !important;
  }

  .toggle-table {
  	background-color: #1e1e1e;
  	color: #e0e0e0;
  	border-top: 1px solid #444;
  }

  .toggle-table td {
  	border: none;
  	padding: 0;
  }

  .toggle-table .checklist-table {
  	background-color: transparent;
	box-shadow: none;
  }

  .toggle-table .checklist-table th {
  	background-color: #2c2c2c;
  	color: #ffffff;
  	border-bottom: 1px solid #444;
  }

  .toggle-table .checklist-table td {
  	border-bottom: 1px solid #444;
  }
  
  .dashboard-table th, .dashboard-table td {
      font-size: 0.9rem;
      padding: 10px;
  }
  
  .icon-btn {
      font-size: 1.1em;
  }
}

/* ---------------------- */
/* RESPONSIVENESS MOBIEL */
/* ---------------------- */
@media screen and (max-width: 768px) {
  .progress-overview-btn,
  .password-btn {
    display: none;
  }
  .admin-link {
      text-align: center;
      margin-top: 10px;
      margin-bottom: 20px;
  }
  
  .checklist-table th,
  .checklist-table td {
    padding: 10px;
    font-size: 0.95rem;
  }

  .checklist-table thead th span.label-text {
    display: none;
  }

  .container,
  .content-container,
  .user-container {
    margin: 0 auto;
  }

  .admin-users-table tr {
    display: flex;
    flex-wrap: wrap;
  }

  .admin-users-table td,
  .admin-users-table th {
    flex: 1 1 100%;
    box-sizing: border-box;
  }

  .admin-users-table td:nth-child(1),
  .admin-users-table th:nth-child(1) {
    flex: 0 0 12%;
  }

  .admin-users-table td:nth-child(2),
  .admin-users-table th:nth-child(2) {
    flex: 1 1 28%;
  }

  .admin-users-table td:nth-child(3),
  .admin-users-table th:nth-child(3) {
    flex: 1 1 30%;
  }

  .admin-users-table td:nth-child(4),
  .admin-users-table th:nth-child(4) {
    flex: 1 1 30%;
    text-align: right;
  }

  .admin-users-table td:nth-child(5),
  .admin-users-table th:nth-child(5) {
    flex: 1 1 100%;
    order: 3;
    margin-top: 8px;
  }

  .admin-users-table td:nth-child(5)::before {
    content: "Voortgang: ";
    font-weight: bold;
    display: inline-block;
    margin-right: 8px;
  }

  .admin-users-table td:nth-child(5) progress {
    width: 60%;
    margin-top: 5px;
  }

  .admin-users-table thead th:nth-child(5) {
    display: none;
  }
  
  .checklist-section h3 {
  top: 55px;
}