/* Shape panel container */
.shape-panel {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-family: "Inter", "Segoe UI", sans-serif;
}

.shape-panel h3 {
  font-size: 16px;
  margin: 0 0 10px;
  color: #333;
  text-align: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

/* Section */
.section {
  margin-bottom: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

/* Swatches */
.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px #dcdcdc;
  transition: 0.15s ease-out;
}

.swatch:hover {
  transform: scale(1.06);
}

.swatch.selected {
  border-color: #6458F5;
}

/* Coloris tile inside shape panel */
.shape-panel .clr-field {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px dashed #aaa;
  background: #fff;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* hide Coloris text input inside field */
.shape-panel .clr-field input.shape-coloris-input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  cursor: pointer;
}

/* optional: "+" sign on the Coloris tile */
.shape-panel .clr-field::after {
  content: "+";
  font-size: 16px;
  color: #666;
}

/* hide the global Coloris open button */
button[aria-labelledby="clr-open-label"] {
  display: none !important;
}

/* No fill checkbox row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
}

.checkbox-row input[type="checkbox"] {
  transform: scale(1.1);
  cursor: pointer;
}

/* Stroke width */
.stroke-width-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.width-btn {
  width: 40px;
  height: 28px;
  border-radius: 6px;
  background: #f5f3ff;
  border: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.width-btn:hover {
  background: #ece9ff;
}

.width-btn.selected {
  outline: 2px solid #6458F5;
  background: #eceaff;
}

.width-line {
  width: 24px;
  background: #333;
  border-radius: 3px;
}

/* numeric stroke input */
.stroke-number-input {
  width: 32px;
  padding: 2px 2px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  height: 20px;
}

.stroke-number-input:focus {
  outline: none;
  border-color: #6458F5;
  box-shadow: 0 0 4px rgba(100, 88, 245, 0.4);
}

/* Stroke Style Row */
.stroke-style-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.stroke-style-btn {
  width: 48px;
  height: 28px;
  border-radius: 6px;
  background: #f5f3ff;
  border: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.stroke-style-btn:hover {
  background: #ece9ff;
}

.stroke-style-btn.selected {
  outline: 2px solid #6458F5;
  background: #eceaff;
}

.stroke-style-btn svg line {
  stroke-linecap: round;
}

.stroke-spacing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.spacing-label {
  font-size: 13px;
  color: #444;
}

.stroke-spacing-input {
  width: 40px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
}
.stroke-spacing-input:focus {
  outline: none;
  border-color: #6458F5;
  box-shadow: 0 0 4px rgba(100, 88, 245, 0.4);
}

/* Opacity */
.opacity-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#shapeOpacity {
  flex: 1;
  accent-color: #6458F5;
  cursor: pointer;
}

#shapeOpacityValue {
  width: 38px;
  text-align: left;
  font-size: 12px;
  color: #555;
}

/* Image Filters */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-row label {
  width: 70px;
  font-size: 12px;
  color: #444;
}

.filter-row input[type="range"] {
  flex: 1;
  accent-color: #6458F5;
  cursor: pointer;
}

.filter-row span {
  width: 40px;
  text-align: right;
  font-size: 11px;
  color: #555;
}

.stroke-cap-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.stroke-cap-btn {
  width: 50px;
  height: 28px;
  border-radius: 6px;
  background: #f5f3ff;
  border: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
  padding: 0;
}

.stroke-cap-btn:hover {
  background: #ece9ff;
}

.stroke-cap-btn.selected {
  outline: 2px solid #6458F5;
  background: #eceaff;
}

.stroke-cap-btn svg line {
  stroke-linejoin: round;
}

.overlay-preview-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    transition: opacity 0.2s ease;
}

.overlay-chip {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.15s ease;
    overflow: hidden; /* GOOD */
    position: relative; /* ⭐ REQUIRED */
}

.overlay-chip canvas {
    width: 100% !important;   /* ⭐ force proper scaling */
    height: 100% !important;  /* ⭐ force proper scaling */
    display: block;
    pointer-events: none;
    position: relative;       /* ⭐ prevents canvas jumping to (0,0) */
}

.overlay-chip:hover {
    transform: scale(1.06);
}

.overlay-chip.selected {
    outline: 2px solid #6458F5;
}
    

/* 🌟 Layers Panel */
.layer-panel {
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    width: 90%;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    font-family: "Segoe UI", sans-serif;
    margin-top: 10px;
}

/* Panel Heading */
.layer-panel h3 {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
    text-align: center;
    width: 100%;
    display: block;
    box-sizing: border-box;
    background: none;
    white-space: normal;
    word-break: break-word;
}

/* 🧱 Layer List */
.layer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: fit-content;
    max-height: 300px;           /* 🆕 Scrollable when long */
    overflow-y: auto;
}

/* Individual Layer Items */
.layer-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 10px;
    color: #333;
    border-radius: 6px;
    transition: background-color 0.2s;
    cursor: pointer;
    border-bottom: 1px solid #eee; /* 🆕 Optional visual separation */
}

.layer-list li:hover {
    background-color: #f1f1f1;
}

.layer-list li.selected {
    background-color: #e0e0e0;
    font-weight: 600;
}

/* Layer Name Styling */
.layer-list li .layer-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons Container */
.layer-list li .layer-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Action Buttons */
.layer-list li .layer-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    transition: color 0.2s, transform 0.1s;
}

.layer-list li .layer-actions button:hover {
    color: #000;
}

.layer-list li .layer-actions button:active {
    transform: scale(0.95); /* 🆕 subtle click effect */
}
