/* Color converter — golden luxury */

.tool-page-shell .tool-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 0;
}

.color-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);
}

.input-section {
  margin-bottom: 30px;
}

.input-section label {
  display: block;
  color: #5e4329;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-input-wrapper {
  display: flex;
  gap: 15px;
  align-items: center;
}

.color-picker-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  position: relative;
  align-self: center;
}

.color-picker-label {
  color: rgba(88, 64, 38, 0.65);
  font-size: 0.75rem;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

#colorInput {
  flex: 1;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 8px;
  padding: 16px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

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

#colorInput::placeholder {
  color: #8c7558;
}

#colorPicker {
  width: 60px;
  height: 50px;
  min-height: 50px;
  border: 1px solid rgba(145, 103, 48, 0.35);
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: all 0.3s ease;
}

#colorPicker:hover {
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.12);
  transform: scale(1.05);
}

#colorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
}

#colorPicker::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.color-preview {
  margin-bottom: 30px;
  text-align: center;
}

.preview-box {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.25);
  margin-bottom: 15px;
  box-shadow: 0 4px 18px rgba(94, 65, 30, 0.12);
}

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

.error-message {
  background: rgba(173, 82, 47, 0.12);
  border: 1px solid rgba(154, 63, 43, 0.26);
  color: #9a3f2b;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  text-align: center;
  animation: errorSlide 0.3s ease;
}

@keyframes errorSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-section {
  margin-bottom: 25px;
  background: #fffaf2;
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.12);
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(182, 138, 58, 0.08);
  border-bottom: 1px solid rgba(145, 103, 48, 0.1);
}

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

.result-header h3 i {
  font-size: 1rem;
}

.copy-btn-small {
  background: transparent;
  border: 1px solid rgba(145, 103, 48, 0.3);
  color: #7a572c;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.copy-btn-small:hover {
  background: rgba(182, 138, 58, 0.12);
  border-color: #ab7c34;
  transform: scale(1.05);
}

.result-content {
  padding: 20px;
}

.results-output {
  display: grid;
  gap: 15px;
}

.color-format {
  background: rgba(255, 252, 246, 0.95);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(145, 103, 48, 0.12);
  display: flex;
  align-items: center;
  gap: 15px;
}

.format-label {
  color: #7a5526;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.format-value-text {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
}

.copy-format-btn {
  background: transparent;
  border: 1px solid rgba(145, 103, 48, 0.3);
  color: #7a572c;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

  .color-tool {
    padding: 25px 20px;
  }

  .color-input-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  #colorInput {
    flex: 1;
    min-height: 50px;
  }

  .color-input-wrapper {
    align-items: center;
  }

  .color-picker-wrapper {
    flex-shrink: 0;
    gap: 0;
  }

  #colorPicker {
    width: 50px;
    height: 50px;
    min-height: 50px;
  }

  .color-picker-label {
    display: none;
  }

  .result-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .copy-btn-small.copied,
  .copy-format-btn.copied {
    animation: copyPulse 0.6s ease;
    box-shadow: 0 0 0 2px rgba(171, 124, 52, 0.35);
  }

  .copy-btn-small.copied svg,
  .copy-format-btn.copied svg {
    display: inline-block;
    vertical-align: middle;
  }

  @keyframes copyPulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.1);
    }
    100% {
      transform: scale(1.05);
    }
  }

  .copy-btn-small {
    width: auto;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
}

.action-buttons.btn-contain-x {
  margin-bottom: 25px;
}

/* Modal lives inside .tool-page-shell; footer is a sibling with the same z-index as the shell,
   so the footer paints on top of the whole main column. While the picker is open, lift the
   shell above footer, sticky header (1000), and mobile float nav (1100). */
body.page-toolkit-labs:has(.color-picker-modal.active) .tool-page-shell {
  z-index: 1200;
}

.color-picker-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 28, 16, 0.72);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

.color-picker-modal.active {
  display: flex;
}

.color-picker-modal-content {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.96));
  border-radius: 16px;
  padding: 25px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(145, 103, 48, 0.28);
  box-shadow: 0 20px 50px -20px rgba(94, 65, 30, 0.4);
}

.color-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(145, 103, 48, 0.15);
}

.color-picker-header h3 {
  color: #5e4329;
  margin: 0;
  font-size: 1.3rem;
}

.color-picker-close {
  background: transparent;
  border: none;
  color: #7a572c;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.color-picker-close:hover {
  background: rgba(173, 82, 47, 0.12);
  color: #9a3f2b;
}

.color-picker-body {
  margin-bottom: 20px;
}

.color-picker-main {
  margin-bottom: 20px;
}

.color-picker-saturation {
  width: 100%;
  height: 200px;
  position: relative;
  border-radius: 8px;
  margin-bottom: 15px;
  cursor: crosshair;
  overflow: hidden;
  border: 1px solid rgba(145, 103, 48, 0.28);
}

.color-picker-white {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, #fff, transparent);
}

.color-picker-black {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, #000, transparent);
}

.color-picker-pointer {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  top: 0;
  left: 100%;
}

.color-picker-hue {
  width: 100%;
  height: 20px;
  position: relative;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  border: 1px solid rgba(145, 103, 48, 0.28);
}

.color-picker-hue-pointer {
  position: absolute;
  width: 20px;
  height: 100%;
  border: 2px solid #fff;
  border-radius: 4px;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  left: 0;
  background: rgba(255, 255, 255, 0.3);
}

.color-picker-preview {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.color-picker-preview-box {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid rgba(145, 103, 48, 0.28);
  flex-shrink: 0;
  background: #ff5733;
}

.color-picker-inputs {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}

.color-picker-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.color-picker-input-group label {
  color: #5e4329;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.color-picker-input-group input {
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.22);
  border-radius: 6px;
  padding: 8px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.3s ease;
}

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

.color-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(145, 103, 48, 0.15);
}

@media (max-width: 768px) {
  .color-picker-modal-content {
    width: 95%;
    padding: 20px;
  }

  .color-picker-saturation {
    height: 180px;
  }

  .color-picker-preview {
    flex-direction: column;
  }

  .color-picker-preview-box {
    width: 100%;
    height: 60px;
  }

  .color-picker-inputs {
    grid-template-columns: repeat(4, 1fr);
  }
}
