/* Color Picker Tool Styles */

/* Tool-specific styles */
.back-link {
  margin-top: 20px;
}

.back-link a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.back-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Tab content */
.tab-content {
  padding: 1.5rem;
}
/* Color values display in the preview box */
.picker-values {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.95rem;
  text-align: center;
  margin: 1rem 0;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.input-group label {
  font-weight: 600;
  color: #333;
}

.input-with-button {
  display: flex;
  align-items: center;
}

.input-with-button input {
  flex: 1;
  margin-right: 0.5rem;
  padding: 14px;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.input-with-button input:focus,
.labeled-input input:focus {
  outline: none;
  border-color: #5468ff;
  box-shadow: 0 0 0 3px rgba(84, 104, 255, 0.15);
}

.rgb-inputs, .hsl-inputs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.labeled-input {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.labeled-input input {
  width: 65px;
  text-align: center;
  padding: 10px;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.labeled-input span {
  font-weight: 600;
  color: #555;
  width: 20px;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 1.5rem;
  width: 100%;
}

.action-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  white-space: nowrap;
  font-size: 0.95rem;
}

/* Color Tool Layout */
.tool-content {
  padding: 1.5rem;
}

.color-tool-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.color-picker-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #f8fafc;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  .color-picker-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.color-picker-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 280px;
}

.color-gradient {
  height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-image: linear-gradient(to top, #000, transparent),
                    linear-gradient(to right, #fff, transparent);
  cursor: crosshair;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(0, 100%, 50%);
  border-radius: 8px;
  z-index: -1;
}

.picker-preview {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.preview-box {
  width: 150px;
  height: 150px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
  transition: background-color 0.3s ease;
}

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

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hue-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Palette Tab */
.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  min-height: 200px;
}

.palette-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.palette-color-box {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}

.palette-color-box:hover {
  transform: scale(1.05);
}

.palette-color-value {
  font-family: monospace;
  font-size: 0.8rem;
  color: #555;
}

.palette-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.empty-palette-message {
  grid-column: 1 / -1;
  text-align: center;
  color: #888;
  padding: 2rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px dashed #ddd;
}

.palette-export {
  margin-top: 2rem;
  display: none;
}

.palette-export.active {
  display: block;
}

.export-options {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#export-code {
  width: 100%;
  height: 150px;
  font-family: monospace;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #f8f9fa;
}

/* Color examples */
.color-examples {
  margin-top: 1.5rem;
}

.example-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.example-color {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-box {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-info {
  font-family: monospace;
  font-size: 0.85rem;
  color: #555;
}

/* Tab message */
.tab-message {
  text-align: center;
  padding: 2rem;
  color: #4a5568;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
  margin: 1rem 0;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #5468ff;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  font-weight: 500;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive styles */
@media (min-width: 1024px) {
  .converter-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
  }

  .picker-preview {
    width: 320px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .converter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .picker-preview {
    width: 300px;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }

  .rgb-inputs, .hsl-inputs {
    flex-wrap: wrap;
  }

  .picker-preview {
    width: 100%;
    margin-top: 1rem;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .example-color {
    flex-direction: column;
    align-items: center;
  }

  .color-info {
    text-align: center;
  }

  .palette-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .palette-controls .btn {
    width: 100%;
  }
}

/* Button Styles - aligned with main styles */
.btn {
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.btn.primary {
  background-color: #5468ff;
  color: white;
  box-shadow: 0 2px 5px rgba(84, 104, 255, 0.3);
}

.btn.primary:hover {
  background-color: #4054e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(84, 104, 255, 0.4);
}

.btn.secondary {
  background-color: #f5f7ff;
  color: #5468ff;
  border: 1px solid rgba(84, 104, 255, 0.2);
}

.btn.secondary:hover {
  background-color: #e6eaff;
  transform: translateY(-2px);
}

/* Controls section */
.controls {
  display: flex;
  gap: 10px;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
}

/* Button modifiers */
.btn.small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn.mini {
  padding: 6px 12px;
  font-size: 0.85rem;
  background-color: #f8fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

.btn.mini.active {
  background-color: #5468ff;
  color: white;
  border-color: #5468ff;
}

/* Cursor */
.color-picker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 5px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 5;
}

.color-picker.random {
  animation: pulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.5); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 0, 0, 0.5); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
