:root {
  font-family: Inter, -apple-system, sans-serif;
  line-height: 1.5;
  font-weight: 300;

  color-scheme: light;
  color: #213547;
  background-color: #fff;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  text-align: center;
  color: #333;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.color-picker {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.picker-main {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.main-controls {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 500px;
}

.color-area {
  position: relative;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-area canvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
  border-radius: 4px;
  overflow: hidden;
}

#hueSlider {
  width: 100%;
  height: 40px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%
  );
  border-radius: 4px;
  outline: none;
}

#hueSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 40px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  cursor: pointer;
}

#hueSlider::-moz-range-thumb {
  width: 12px;
  height: 20px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  cursor: pointer;
}

.color-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.color-info {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.palettes {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.palette {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.palette-preview {
  width: 100%;
  height: 50px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.palette-preview:hover {
  transform: scale(1.02);
}

.palette.active .palette-preview {
  box-shadow: 0 0 0 2px #000;
}

.contrast-test {
  margin-bottom: 16px;
}

.contrast-preview {
  width: 100%;
  height: 80px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.contrast-text-light {
  font-weight: 300;
  font-size: 18px;
}

.contrast-text-bold {
  font-weight: 700;
  font-size: 18px;
}

.contrast-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
}

.contrast-ratio {
  font-weight: 500;
}

.contrast-rating {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rating-item {
  display: flex;
  gap: 8px;
}

.rating-label {
  color: #666;
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.value-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.value-group label {
  min-width: 45px;
  font-weight: 400;
  color: #666;
  font-size: 13px;
  letter-spacing: -0.2px;
}

.value-group input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
}

.triple-input,
.quad-input {
  flex: 1;
  display: flex;
  gap: 5px;
}

.triple-input input,
.quad-input input {
  width: 0;
  flex: 1;
  text-align: center;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


.color-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-color {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.history-color:hover {
  transform: scale(1.1);
}

.color-suggestions {
  background: transparent;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: fit-content;
}

.suggestion-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-scheme {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 10px;
}

.scheme-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.scheme-name {
  font-weight: 400;
  color: #333;
  font-size: 13px;
  letter-spacing: -0.2px;
}

.scheme-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.scheme-button,
.copy-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 12px;
  color: #666;
  border-radius: 3px;
}

.scheme-button {
  padding: 4px 6px;
}

.scheme-button:hover,
.copy-button:hover {
  color: #000;
  background: #f5f5f5;
}

.button-icon {
  font-size: 12px;
  line-height: 1;
}

.button-text {
  font-size: 11px;
}

.scheme-colors {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.scheme-color-group {
  display: flex;
  flex-direction: column;
}

.scheme-color {
  aspect-ratio: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.scheme-color:hover {
  transform: scale(1.1);
}

.scheme-color::after {
  content: "Copy";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.2s ease;
  font-size: 8px;
  color: white;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 4px;
  border-radius: 2px;
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.scheme-color:hover::after {
  opacity: 1;
}

.scheme-color.copied::after {
  content: "Copied";
  background: rgba(0, 0, 0, 0.8);
}

.color-code {
  display: none;
}

@media (max-width: 1024px) {
  .color-picker {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .main-controls {
    flex-direction: column;
    align-items: center;
  }

  .color-area,
  .color-info {
    width: 100%;
    max-width: 400px;
  }

  .color-area canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .palettes {
    flex-direction: column;
  }

  .palette {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .scheme-colors {
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
  }
  
  .scheme-color {
    aspect-ratio: 1;
    border-radius: 2px;
  }
}