.color-tool-container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.color-tool-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.color-tool-title {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 800;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.color-icon {
  font-size: 1.3em;
}

.color-tool-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.color-tool-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Tabs */
.color-tabs {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.color-tab {
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.color-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.color-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Sections */
.color-section {
  display: none;
}

.color-section.active {
  display: block;
}

/* Picker */
.picker-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.color-preview {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  cursor: pointer;
  border: 4px solid var(--surface);
}

.hidden-picker {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.color-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 500px;
}

.value-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.value-group label {
  font-size: 0.9rem;
  color: var(--text-light);
}

.value-group input {
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: monospace;
  text-align: center;
}

.tool-btn {
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.tool-btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* History */
.history {
  width: 100%;
  max-width: 500px;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.history-item {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.history-item:hover,
.history-item.active {
  border-color: var(--primary);
  transform: scale(1.12);
}

/* Gradient */
.gradient-preview {
  width: 100%;
  height: 220px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.gradient-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-row label {
  min-width: 80px;
  font-weight: 500;
}

#angleValue {
  min-width: 50px;
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}

.color-stops .stop-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  background: var(--bg);
  padding: 0.8rem;
  border-radius: 10px;
}

.stop-row input[type="color"] {
  width: 60px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.stop-row input[type="range"] {
  flex: 1;
}

.stop-row button {
  background: #ef4444;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Output */
.gradient-output pre {
  background: var(--bg);
  padding: 1rem;
  border-radius: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 180px;
}

.output-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.action-btn {
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .color-values { grid-template-columns: 1fr; }
  .gradient-controls { gap: 1.2rem; }
  .stop-row { flex-direction: column; align-items: stretch; }
  .stop-row input[type="color"] { width: 100%; height: 50px; }
}