/* BASIS */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #f4f4f4;
  color: #222;
}

/* PROJECTENLAAG */
.projects-section {
  padding: 16px 24px;
}

.projects-layer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 10px 0;
}

/* PROJECTBLOKKEN */
.project {
  min-height: 120px;
  border-radius: 12px;
  padding: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background: #fff;
}

.project span {
  font-size: 18px;
  font-weight: bold;
  padding: 4px;
  cursor: text;
  word-break: break-word;
  padding-right: 40px; /* Ruimte voor drag-handle */
}

/* BUTTON ROW */
.button-row {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

/* PLUS KNOP HOOFDMENU */
.add-project-btn {
  border: none;
  background-color: #444;
  color: white;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  margin-bottom: 16px;
}

/* KNOPPEN IN HET PROJECT */
.open-project-btn, .delete-project-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

.delete-project-btn {
  color: #ff4444;
  padding: 8px 10px;
  font-size: 18px;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #999;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  cursor: pointer;
  flex-shrink: 0;
}

/* SLEEP-HANDVAT (☰) */
.drag-handle {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: grab;
  font-size: 24px;
  color: rgba(0,0,0,0.4);
  user-select: none;
}

/* OVERLAY BASIS */
#project-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: flex-start;
  z-index: 1000;
  padding-top: 20px;
  overflow-y: auto;
}

.overlay-content {
  background: white;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.overlay-project-title {
  font-size: 22px;
  font-weight: bold;
  margin-right: 40px;
}

#close-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 35px;
  border: none;
  background: none;
  cursor: pointer;
  color: #ff4444;
}

/* ITEMS IN DE OVERLAY */
.overlay-items-layer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.overlay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #cfd9f1;
  font-weight: 600;
}

.delete-item-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #444;
}

.item-notes {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

#add-overlay-item-btn {
  align-self: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #444;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* KLEURENPALET */
#color-palette {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: none;
  gap: 8px;
  z-index: 2000;
  flex-wrap: wrap;
  max-width: 200px;
}

#color-palette div {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.1);
}

/* KLEUREN CLASSES */
.color-1 { background: #f6c1cc; }
.color-2 { background: #f4e1a1; }
.color-3 { background: #bfe3d2; }
.color-4 { background: #cfd9f1; }
.color-5 { background: #e2c9f3; }
.color-6 { background: #ff6b6b; }
.color-7 { background: #4ecdc4; }
.color-8 { background: #45b7d1; }
.color-9 { background: #f7dc6f; }
.color-10 { background: #bb8fce; }
.color-11 { background: #52c41a; }
.color-12 { background: #ff9f43; }
.color-13 { background: #a8e6cf; }
.color-14 { background: #dcedc1; }
.color-15 { background: #ffd3b6; }
.color-16 { background: #ffaaa5; }
.color-17 { background: #b4a7d6; }
.color-18 { background: #8ee4af; }
.color-19 { background: #edf5e1; }
.color-20 { background: #5cdb95; }
.color-21 { background: #c1946a; }
.color-22 { background: #7fb069; }
.color-23 { background: #85cdca; }
.color-24 { background: #defde0; }

/* MOBIEL */
@media (max-width: 600px) {
  .add-project-btn { 
    width: 56px; 
    height: 56px; 
    font-size: 28px; 
  }
  
  .project { 
    min-height: 140px;
  }
  
  .project span { 
    font-size: 20px;
  }
  
  .open-project-btn, .delete-project-btn {
    padding: 10px 14px;
    font-size: 16px;
  }
  
  .color-btn {
    width: 36px;
    height: 36px;
  }
  
  .drag-handle { 
    font-size: 28px;
  }
  
  .overlay-content {
    width: 95%;
    max-width: none;
  }
}