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

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

.top-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.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;
}

/* EXPORT/IMPORT KNOPPEN */
.export-btn, .import-btn {
  border: none;
  background-color: #28a745;
  color: white;
  font-size: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}

.export-btn:hover, .import-btn:hover {
  background-color: #218838;
}

/* 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: #AFC8E6; }
.color-2  { background: #8FB1D9; }
.color-3  { background: #6F99CC; }

.color-4  { background: #B7D7C2; }
.color-5  { background: #97C6A8; }
.color-6  { background: #77B58E; }

.color-7  { background: #F2D388; }
.color-8  { background: #E6BF5E; }
.color-9  { background: #D9AA34; }

.color-10 { background: #E6B8AF; }
.color-11 { background: #D98F80; }
.color-12 { background: #CC6651; }

.color-13 { background: #C3B1E1; }
.color-14 { background: #A792D4; }
.color-15 { background: #8B73C7; }

.color-16 { background: #E0C1A6; }
.color-17 { background: #CFA27E; }
.color-18 { background: #B98256; }

.color-19 { background: #E3E3E3; }
.color-20 { background: #BFBFBF; }
.color-21 { background: #9B9B9B; }

/* MOBIEL */
@media (max-width: 600px) {
  .add-project-btn, .export-btn, .import-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;
  }
}
