.bg-remover {
  max-width: 1100px;
  margin: 20px auto;
  font-family: Arial, sans-serif;
  color: #222;
  padding: 0 15px;
}

.bg-remover__header {
  text-align: center;
  margin-bottom: 25px;
}

.bg-remover__title {
  font-size: 26px;
  margin: 0 0 10px;
  color: #1a1a1a;
}

.bg-remover__desc {
  font-size: 16px;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

.bg-remover__upload {
  border: 3px dashed #4CAF50;
  border-radius: 12px;
  padding: 50px 20px;
  text-align: center;
  background: #f7fdf7;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.bg-remover__upload:hover,
.bg-remover__upload.dragover {
  background: #e8f7e8;
  border-color: #388E3C;
}

.bg-remover__upload-icon {
  font-size: 50px;
  display: block;
  margin-bottom: 10px;
}

.bg-remover__upload-text p {
  margin: 5px 0;
  font-size: 18px;
}

.bg-remover__upload-hint {
  color: #777;
  font-size: 14px !important;
}

.bg-remover__workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.bg-remover__canvas-wrap {
  position: relative;
  background:
    linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #fff;
  border: 2px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  min-height: 300px;
}

.bg-remover__canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

#overlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
}

.bg-remover__controls {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 15px;
}

.bg-remover__section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.bg-remover__section:last-child {
  margin-bottom: 0;
}

.bg-remover__section-title {
  font-size: 16px;
  margin: 0 0 10px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

.bg-remover__row {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bg-remover__row label {
  font-size: 15px;
  min-width: 100%;
  font-weight: 500;
}

.bg-remover__row input[type="range"] {
  flex: 1;
  width: 100%;
}

.bg-remover__row input[type="color"] {
  width: 50px;
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
}

.bg-remover__tools {
  justify-content: space-between;
}

.bg-remover__btn {
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-weight: 500;
}

.bg-remover__btn:active {
  transform: scale(0.97);
}

.bg-remover__btn--primary {
  background: #4CAF50;
  color: #fff;
  width: 100%;
}

.bg-remover__btn--primary:hover {
  background: #45a049;
}

.bg-remover__btn--secondary {
  background: #9e9e9e;
  color: #fff;
  width: 100%;
}

.bg-remover__btn--secondary:hover {
  background: #757575;
}

.bg-remover__btn--small {
  padding: 8px 12px;
  font-size: 14px;
  background: #2196F3;
  color: #fff;
}

.bg-remover__btn--small:hover {
  background: #1976D2;
}

.bg-remover__btn--tool {
  flex: 1;
  background: #e0e0e0;
  color: #333;
}

.bg-remover__btn--tool:hover {
  background: #d0d0d0;
}

.bg-remover__btn--active {
  background: #FF9800 !important;
  color: #fff !important;
}

@media (max-width: 800px) {
  .bg-remover__workspace {
    grid-template-columns: 1fr;
  }
  
  .bg-remover__title {
    font-size: 22px;
  }
  
  .bg-remover__upload {
    padding: 30px 15px;
  }
}