/* File hash calculator — golden luxury */

.tool-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

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

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

.algorithm-selection {
  margin-bottom: 30px;
}

.action-buttons.btn-contain-x {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
}

.input-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;
  text-align: center;
}

.file-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#fileInput {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-select-label {
  display: block;
  width: 100%;
  min-height: 160px;
  background: #fffaf2;
  border: 2px dashed rgba(145, 103, 48, 0.35);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.file-select-label::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(182, 138, 58, 0.08), rgba(182, 138, 58, 0.02));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.file-select-label:hover {
  border-color: #ab7c34;
  background: rgba(182, 138, 58, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(94, 65, 30, 0.12);
}

.file-select-label:hover::before {
  opacity: 1;
}

.file-select-label:active {
  transform: translateY(0);
}

.file-select-label.drag-over {
  border-color: #ab7c34;
  background: rgba(182, 138, 58, 0.12);
  border-style: solid;
  transform: scale(1.02);
}

.file-select-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  height: 100%;
  position: relative;
  z-index: 1;
}

.file-select-icon {
  color: #b98b3b;
  font-size: 3rem;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.file-select-label:hover .file-select-icon {
  transform: scale(1.1);
  color: #9a7a3a;
}

.file-select-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.file-select-main {
  color: #5e4329;
  font-size: 1.1rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}

.file-select-sub {
  color: rgba(88, 64, 38, 0.65);
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
}

.file-info {
  display: block;
  padding: 0;
  background: rgba(182, 138, 58, 0.08);
  border: 1px solid rgba(145, 103, 48, 0.18);
  border-radius: 12px;
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

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

.file-info-content {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
}

.file-info-icon {
  color: #b98b3b;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.file-info-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.file-name {
  color: #5e4329;
  font-weight: 500;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  word-break: break-all;
}

.file-size {
  color: rgba(88, 64, 38, 0.65);
  font-size: 0.85rem;
  font-family: 'Outfit', sans-serif;
}

.file-remove-btn {
  background: transparent;
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #c94a3a;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  padding: 0;
}

.file-remove-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: #ff6b6b;
  transform: scale(1.1);
}

.file-remove-btn:active {
  transform: scale(0.95);
}

.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: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.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: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px -6px rgba(94, 65, 30, 0.35);
}

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

.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);
  position: relative;
  z-index: 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 {
  position: relative;
  z-index: 2;
  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);
}

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

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

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

.result-content {
  padding: 20px;
}

.hash-output {
  background: rgba(255, 252, 246, 0.95);
  color: #4a351f;
  padding: 16px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  word-break: break-all;
  border: 1px solid rgba(145, 103, 48, 0.12);
  margin-bottom: 12px;
}

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

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

.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 #ab7c34;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

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

/* Copy feedback — this page does not load email-subscribe.css, so toast must be defined here */
.toast.file-hash-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  z-index: 10050;
  box-shadow: 0 10px 30px rgba(94, 65, 30, 0.2);
  animation: fileHashToastSlideIn 0.35s ease;
}

.toast.file-hash-toast.success {
  background: linear-gradient(135deg, rgba(255, 250, 241, 0.98), rgba(244, 228, 200, 0.96));
  color: #4a351f;
  border: 1px solid rgba(145, 103, 48, 0.35);
}

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

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

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

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

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

  .algo-btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
    font-size: 0.9rem;
  }

  .file-info-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .file-info-icon {
    align-self: center;
  }

  .file-remove-btn {
    align-self: flex-end;
  }

  .file-select-content {
    padding: 30px 15px;
  }

  .file-select-icon {
    font-size: 2.5rem;
  }

  .file-select-main {
    font-size: 1rem;
  }

  .file-select-sub {
    font-size: 0.85rem;
  }

  .toast.file-hash-toast {
    top: auto;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    right: 16px;
    max-width: none;
    animation: fileHashToastSlideInMobile 0.35s ease;
  }

  @keyframes fileHashToastSlideInMobile {
    from {
      transform: translateY(120%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

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

  .algo-btn {
    width: 100%;
  }
}
