/* Tool Container Styles */
.tool-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hex Tool Styles — golden luxury */
.hex-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.2);
}

.conversion-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

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

.input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

#hexInput,
#asciiInput {
  flex: 1;
  width: 100%;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 8px;
  padding: 16px 50px 16px 16px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  resize: vertical;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

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

#hexInput::placeholder,
#asciiInput::placeholder {
  color: #8c7558;
}

#hexInput.output-mode,
#asciiInput.output-mode {
  background: #fff8ef;
  border-color: rgba(145, 103, 48, 0.2);
  cursor: text;
  padding-right: 50px;
}

#hexInput.output-mode:focus,
#asciiInput.output-mode:focus {
  border-color: rgba(145, 103, 48, 0.38);
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

#hexInput.input-mode,
#asciiInput.input-mode {
  background: #fffaf2;
  border-color: rgba(145, 103, 48, 0.26);
  cursor: text;
}

.copy-input-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(182, 138, 58, 0.12);
  border: 1px solid rgba(145, 103, 48, 0.28);
  color: #7a572c;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  z-index: 10;
  opacity: 1;
  pointer-events: auto;
}

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

.copy-input-btn.copied {
  animation: copyPulse 0.6s ease;
  box-shadow: 0 0 12px rgba(182, 138, 58, 0.35);
}

.copy-input-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-input-btn:active {
  transform: scale(0.95);
}

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

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

.btn.active {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  box-shadow: 0 4px 16px -4px rgba(145, 103, 48, 0.45);
  transform: translateY(-1px);
  color: #fff8ef;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

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

  .conversion-section {
    grid-template-columns: 1fr;
  }

  .copy-input-btn {
    opacity: 1;
    pointer-events: auto;
  }

  .toast {
    top: auto;
    bottom: 100px;
    left: 20px;
    right: 20px;
  }
}
