/* Tool Container Styles */
.tool-page-shell .tool-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Hash Tool Styles — golden luxury */
.hash-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);
}

.input-section,
.output-section,
.algorithm-selection,
.action-buttons {
  margin-bottom: 30px;
}

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

/* Textarea Styles */
#textInput {
  width: 100%;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 8px;
  padding: 16px;
  color: #4a351f;
  font-family: 'Outfit', monospace;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

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

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

/* Algorithm Selection */
.algorithm-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.algo-btn {
  background: transparent;
  border: 1px solid rgba(145, 103, 48, 0.28);
  color: #7a572c;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.algo-btn:hover {
  border-color: #ab7c34;
  color: #5e4329;
  background: rgba(182, 138, 58, 0.1);
}

.algo-btn.active {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  border-color: rgba(121, 85, 40, 0.48);
  font-weight: 600;
}

.algo-btn.active:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Output Section */
.output-container {
  position: relative;
  display: flex;
  align-items: stretch;
}

#hashOutput {
  flex: 1;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 8px 0 0 8px;
  padding: 16px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  resize: none;
  min-height: 60px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

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

.copy-btn {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  border: 1px solid rgba(121, 85, 40, 0.48);
  border-left: none;
  border-radius: 0 8px 8px 0;
  padding: 16px;
  color: #fff8ef;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.copy-btn:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
  transform: scale(1.02);
}

.copy-btn i {
  font-size: 1.1rem;
}

.hash-info {
  margin-top: 12px;
  text-align: center;
}

.hash-info span {
  color: rgba(88, 64, 38, 0.75);
  font-size: 0.9rem;
  font-style: italic;
}

/* Copy Success Animation */
.copy-success {
  animation: copyPulse 0.6s ease;
  box-shadow: 0 0 12px rgba(182, 138, 58, 0.35);
}

.copy-success svg {
  display: inline-block;
  vertical-align: middle;
}

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

/* Error Message Styles */
.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-top: 15px;
  font-weight: 500;
  text-align: center;
  display: none;
  animation: errorSlide 0.3s ease;
}

.error-message.show {
  display: block;
}

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

/* Loading State */
.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #b98b3b;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.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%);
}

.toast.error {
  background: #c94a3a;
  color: #fff;
}

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

/* Input Character Counter */
.character-counter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.8rem;
  color: #7b6245;
  background: rgba(255, 252, 246, 0.95);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(145, 103, 48, 0.15);
  pointer-events: none;
}

.character-counter.warning {
  color: #b87a1a;
}

.character-counter.error {
  color: #9a3f2b;
}

/* Input validation styles */
.input-error {
  border-color: #c94a3a !important;
  box-shadow: 0 0 0 3px rgba(201, 74, 58, 0.15) !important;
}

.input-success {
  border-color: #6b8f3c !important;
  box-shadow: 0 0 0 3px rgba(107, 143, 60, 0.2) !important;
}

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

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

  .algorithm-buttons {
    justify-content: center;
  }

  .algo-btn {
    flex: 1;
    min-width: 70px;
    text-align: center;
  }

  .action-buttons {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
  }

  .hash-tool .btn {
    flex: 1;
    max-width: none;
  }

  .output-container {
    flex-direction: column;
  }

  #hashOutput {
    border-radius: 8px 8px 0 0;
    min-height: 80px;
  }

  .copy-btn {
    border-radius: 0 0 8px 8px;
    border-left: 1px solid rgba(121, 85, 40, 0.48);
    border-top: none;
    padding: 12px;
  }

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

@media (max-width: 480px) {
  .algorithm-buttons {
    flex-direction: row;
    gap: 10px;
  }

  .algo-btn {
    flex: 1;
    min-width: calc(50% - 5px);
    max-width: calc(50% - 5px);
  }
}
