/* Color palette extractor — golden luxury */

.tool-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.palette-extractor-tool {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.97));
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.35);
  border: 1px solid rgba(145, 103, 48, 0.15);
}

.upload-section {
  margin-bottom: 25px;
}

.upload-area {
  width: 100%;
  min-height: 200px;
  padding: 40px;
  background: #fffaf2;
  border: 2px dashed rgba(145, 103, 48, 0.35);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: #ab7c34;
  background: rgba(182, 138, 58, 0.06);
}

.upload-area.dragover {
  border-color: #ab7c34;
  background: rgba(182, 138, 58, 0.12);
}

.upload-area i {
  font-size: 3rem;
  color: #b98b3b;
}

.upload-area p {
  color: rgba(88, 64, 38, 0.72);
  font-size: 1rem;
  margin: 0;
}

.controls-section {
  margin-bottom: 25px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  color: #5e4329;
  font-size: 0.95rem;
  font-weight: 600;
}

.form-select {
  padding: 12px 15px;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  color: #4a351f;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-select:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

.preview-section {
  margin-bottom: 25px;
}

.image-preview {
  background: #fffaf2;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(145, 103, 48, 0.15);
}

.preview-header {
  margin-bottom: 15px;
}

.preview-header h3 {
  color: #5e4329;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.picker-hint {
  color: rgba(88, 64, 38, 0.65);
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 8px;
  overflow: visible;
}

#previewCanvas {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  touch-action: none;
}

.picker-cursor {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  transition: none;
  display: none;
  top: 0;
  left: 0;
}

.color-picker-result {
  background: #fffaf2;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(145, 103, 48, 0.15);
  margin-bottom: 25px;
}

.color-picker-result h3 {
  color: #5e4329;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.picked-color-display {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.picked-color-box {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.3);
  box-shadow: 0 4px 16px rgba(94, 65, 30, 0.12);
  flex-shrink: 0;
}

.picked-color-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 250px;
}

.color-code-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(182, 138, 58, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(145, 103, 48, 0.12);
}

.color-code-label {
  color: rgba(88, 64, 38, 0.72);
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 50px;
}

.color-code-value {
  color: #7a5526;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.copy-code-btn {
  background: rgba(182, 138, 58, 0.12);
  border: 1px solid rgba(145, 103, 48, 0.28);
  border-radius: 6px;
  color: #7a572c;
  padding: 8px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-code-btn:hover {
  background: rgba(182, 138, 58, 0.22);
  border-color: #ab7c34;
}

.palette-section {
  margin-bottom: 25px;
}

.palette-section h3 {
  color: #5e4329;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.color-swatch {
  background: #fffaf2;
  border-radius: 12px;
  padding: 15px;
  border: 1px solid rgba(145, 103, 48, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.color-swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(94, 65, 30, 0.12);
}

.color-box {
  width: 100%;
  height: 80px;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 2px solid rgba(145, 103, 48, 0.15);
}

.color-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.color-hex {
  color: #7a5526;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.color-rgb {
  color: rgba(88, 64, 38, 0.65);
  font-size: 0.8rem;
}

.category-tab {
  padding: 10px 20px;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 12px;
  color: rgba(88, 64, 38, 0.72);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-tab:hover {
  border-color: rgba(171, 124, 52, 0.45);
  color: #4a351f;
}

.category-tab.active {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  border-color: transparent;
  color: #fff8ef;
}

.converter-form {
  margin-bottom: 25px;
}

.conversion-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.input-group {
  flex: 1;
  display: flex;
  gap: 10px;
}

.input-group .form-input {
  flex: 1;
}

.unit-select {
  padding: 12px 15px;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  color: #4a351f;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.unit-select:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

.swap-btn {
  padding: 12px;
  background: rgba(182, 138, 58, 0.12);
  border: 1px solid rgba(145, 103, 48, 0.28);
  border-radius: 12px;
  color: #7a572c;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swap-btn:hover {
  background: rgba(182, 138, 58, 0.22);
  border-color: #ab7c34;
  transform: rotate(180deg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #5e4329;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 15px;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  color: #4a351f;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

.form-input::placeholder {
  color: #8c7558;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
  transform: scale(1.05);
}

.btn-secondary {
  background: transparent;
  color: #7a572c;
  border: 2px solid rgba(145, 103, 48, 0.4);
}

.btn-secondary:hover {
  background: rgba(182, 138, 58, 0.12);
  color: #5e4329;
  transform: scale(1.05);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.result-header h3 {
  color: #5e4329;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.result-card {
  background: rgba(182, 138, 58, 0.06);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(145, 103, 48, 0.15);
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(145, 103, 48, 0.1);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: rgba(88, 64, 38, 0.72);
  font-size: 1rem;
  font-weight: 500;
}

.result-value {
  color: #7a5526;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.hash-type-icon {
  font-size: 2.5rem;
  color: #b98b3b;
}

.hash-type-info h4 {
  color: #4a351f;
  font-size: 1.5rem;
  margin: 0 0 5px 0;
}

.hash-type-info p {
  color: rgba(88, 64, 38, 0.65);
  margin: 0;
  font-size: 0.95rem;
}

.hash-details {
  display: grid;
  gap: 15px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 252, 246, 0.85);
  border-radius: 6px;
}

.detail-label {
  color: rgba(88, 64, 38, 0.72);
  font-weight: 500;
}

.detail-value {
  color: #7a5526;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.error-message {
  background: rgba(173, 82, 47, 0.12);
  border: 1px solid rgba(154, 63, 43, 0.26);
  color: #9a3f2b;
  padding: 15px;
  border-radius: 12px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .tool-container {
    padding: 0 15px;
  }

  .palette-extractor-tool {
    padding: 20px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .hash-type-card {
    flex-direction: column;
    text-align: center;
  }

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .picked-color-display {
    flex-direction: column;
  }

  .picked-color-box {
    width: 100px;
    height: 100px;
  }

  .picked-color-info {
    width: 100%;
    min-width: auto;
  }

  #resetBtn.btn-secondary {
    border-width: 1px;
  }

  .copy-code-btn.copied {
    background: rgba(182, 138, 58, 0.22);
    border-color: #ab7c34;
  }

  .copy-code-btn.copied svg {
    display: inline-block !important;
    vertical-align: middle;
    width: 14px;
    height: 14px;
  }

  .canvas-wrapper {
    overflow: visible;
    position: relative;
  }

  .picker-cursor {
    min-width: 30px;
    min-height: 30px;
    pointer-events: none;
    will-change: transform, left, top;
  }
}
