/*!
 * Minecraft Distance Calculator - nogard.dev
 * Copyright (c) 2026 Nogard. All rights reserved.
 *
 * Served to your browser so the tool can run. That is not a licence to copy, host,
 * rebrand, resell or redistribute this code, in whole or in part.
 * Licensing enquiries: https://nogard.dev/contact
 */

/* Everything the tool needs for its controls comes from tools/converter.css. Only
   two things are missing there: a copy target inside a table cell, and the status
   line. Both are lifted from the Discord Timestamp Generator so they behave the
   same way on both pages. */

/* Copy target inside the unit table. Transparent, so the <code> chip that
   styles/table.css paints stays the visible surface. */
.mdc-copy-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mdc-copy-cell code {
  transition: all 0.2s ease;
}

.mdc-copy-cell:hover code {
  border-color: #3984a7;
  background: #f0f8ff;
  color: #2d6a89;
}

.mdc-copy-cell:active {
  transform: scale(0.98);
}

.mdc-copy-cell:focus-visible {
  outline: 2px solid #3984a7;
  outline-offset: 2px;
}

.mdc-copy-cell .copy-icon {
  width: 14px;
  height: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.mdc-copy-cell:hover .copy-icon {
  color: #3984a7;
}

.mdc-copy-cell.copied code {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

.mdc-copy-cell.copied .copy-icon {
  color: #4caf50;
}

/* Copy success goes green, the same #4CAF50 the UUID generator, base converter
   and JSON formatter all use. converter.css does not carry this state, so every
   page in that family declares it itself. */
.converter-button.copied,
.converter-button-secondary.copied {
  background-color: #4caf50 !important;
  border-color: #4caf50 !important;
  color: #ffffff !important;
}

/* The teleport command is a secondary artifact under the buttons. */
.mdc-tp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Reserved height so announcing a copy never reflows the page. */
.mdc-status {
  max-width: 560px;
  margin: 10px auto 0;
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.mdc-status.is-error {
  color: #b91c1c;
  font-weight: 600;
}

/* The game units and the real world units are two groups in one table. */
.mdc-real tr:first-child td {
  border-top: 2px solid #c4c4c4;
}

/* converter.css does not style the disabled state its buttons can enter. */
.converter-button:disabled,
.converter-button:disabled:hover {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
