/* Wrapper */
.tool-wrapper {
  display: flex;
  justify-content: center;
  padding: 50px 20px;
  font-family: 'Segoe UI', sans-serif;
  background: #f5f6fa;
}

/* Container layout */
.tool-container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1200px;
  width: 100%;
}

/* Left Panel */
.tool-settings {
  flex: 1;
  min-width: 320px;
  max-width: 400px;
  background: #e2e4ff;
  padding: 35px 30px;
  border-radius: 10px;
  
  display: flex;
  flex-direction: column;
  transition: 0.3s;
}

.tool-settings:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.tool-settings h2 {
  margin-bottom: 25px;
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  text-align: left;
}

/* Palette */
.palette-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.palette-container {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  gap: 5px;
}

.color-box {
  width: 50px;
  height: 50px;
  border: 1px solid #000;
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.color-box.dragging {
  opacity: 0.7;
  
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.color-box:hover {
  transform: scale(1.1);
}

/* Palette controls (+/- buttons) */
.palette-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.small-btn {
  width: 38px;
  height: 38px;
  font-size: 20px;
  font-weight: bold;
  padding: 0;
  border: none;
  background: linear-gradient(135deg,#ff7e5f,#feb47b);
  color: #fff;
  cursor: pointer;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.small-btn:hover {
  transform: scale(1.0);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* Download button */
.download-btn {
  margin: 15px 0;
  padding: 12px 10px;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  background: linear-gradient(135deg,#6a11cb,#2575fc);
  color: #fff;
  cursor: pointer;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Custom file input */
.custom-file-input {
  width: 100%;
  padding: 12px 15px;
  margin-top: 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  background: #f9f9f9;
  cursor: pointer;
  transition: 0.3s;
}

.custom-file-input:hover {
  background: #f0f0f0;
}

/* Slider */
input[type=range] {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  margin-top: 10px;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6a11cb;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  transition: background 0.3s;
}

input[type=range]::-webkit-slider-thumb:hover {
  background: #2575fc;
}

input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6a11cb;
  cursor: pointer;
  transition: background 0.3s;
}

input[type=range]::-moz-range-thumb:hover {
  background: #2575fc;
}

/* Right Panel */
.image-preview {
  flex: 2;
  min-width: 320px;
  display: flex;
  justify-content: center;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 720px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

#imageCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
}

/* Pointers */
.pointer {
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50%;
  position: absolute;
  cursor: grab;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}

.pointer:hover {
  transform: scale(1.3);
}

.pointer span {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .tool-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  
  .tool-settings h2 {
  margin-bottom: 18px;
  text-align: center;
}
  
  
  .tool-settings {
  flex: 1;
 max-width: 90%;
    width: 100%;
  background: #e2e4ff;
  padding: 17px 10px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  transition: 0.3s;
}

  .image-preview {
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
  }

  .canvas-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto !important;
  }

  #imageCanvas {
    width: 100%;
    height: auto !important;
  }

  .palette-wrapper {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .palette-controls {
    flex-direction: row;
    gap: 10px;
    margin-top: 10px;
  }

  .small-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}
