/**
 * Time Difference Calculator – same design language as random string generator.
 */

.tool-time-difference .hidden {
  display: none !important;
}

/* Main layout: form column wider, results narrower; prevent overflow */
.tool-time-difference .td-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .tool-time-difference .td-main-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

.tool-time-difference .td-main-col {
  min-width: 0;
}

/* CLS: reserve height for result card so placeholder→results swap on load does not shift layout */
.tool-time-difference .td-main-col--results .td-card {
  min-height: 360px;
}

.tool-time-difference .td-card {
  background: var(--bg-800);
  border: 1px solid var(--line2);
  color: var(--fg);
}

.tool-time-difference .td-icon-wrap,
.tool-time-difference .td-icon-sm {
  background: var(--bg-900);
  border: 1px solid var(--line2);
  color: var(--fg);
}

.tool-time-difference .td-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  min-width: 0;
}

@media (min-width: 768px) {
  .tool-time-difference .td-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.tool-time-difference .td-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.tool-time-difference .td-form-actions {
  grid-column: 1 / -1;
}

.tool-time-difference .td-label {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
}

.tool-time-difference .td-label--secondary {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.tool-time-difference .td-input,
.tool-time-difference .td-select {
  width: 100%;
  background: var(--bg-900);
  border: 1px solid var(--line2);
  color: var(--fg);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: none;
}

.tool-time-difference .td-input--datetime {
  padding: 1rem;
  font-size: 1.125rem;
  font-family: ui-monospace, monospace;
}

.tool-time-difference .td-select {
  margin-top: 0;
}

.tool-time-difference .td-input:focus,
.tool-time-difference .td-select:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 2px rgba(var(--cta-rgb, 99 102 241), 0.2);
}

/* Native datetime-local: match site theme */
html[data-theme="dark"] .tool-time-difference input.td-input[type="datetime-local"],
html[data-theme="dark"] .tool-time-difference .td-input--datetime {
  color-scheme: dark;
}

html[data-theme="light"] .tool-time-difference input.td-input[type="datetime-local"],
html[data-theme="light"] .tool-time-difference .td-input--datetime {
  color-scheme: light;
}

.tool-time-difference .td-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line2);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: none;
}

.tool-time-difference .td-btn-ghost:hover {
  border-color: var(--cta);
  background: color-mix(in srgb, var(--cta) 10%, transparent);
}

.tool-time-difference .td-btn-ghost--full {
  width: 100%;
}

.tool-time-difference .td-btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: currentColor;
}

.tool-time-difference .td-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 12rem;
  aspect-ratio: 1;
  margin: 0 auto 1.5rem;
  background: var(--bg-900);
  border: 2px solid var(--line2);
  border-radius: 20px;
  color: var(--muted);
}

.tool-time-difference .td-placeholder-icon {
  width: 4rem;
  height: 4rem;
  opacity: 0.5;
}

.tool-time-difference .td-result-block {
  background: var(--bg-900);
  border: 1px solid var(--line2);
}

.tool-time-difference .td-btn-copy {
  background: var(--cta);
  color: var(--color-on-accent);
  border: 1px solid var(--cta);
}

.tool-time-difference .td-btn-copy:hover {
  filter: brightness(1.1);
}

.tool-time-difference .td-copy-success {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cta);
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-time-difference .td-copy-success--visible {
  opacity: 1;
}

.tool-time-difference .td-features {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.tool-time-difference .td-feature-card {
  background: var(--bg-800);
  border: 1px solid var(--line2);
  transition: none;
}

.tool-time-difference .td-feature-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.tool-time-difference .td-feature-icon {
  background: var(--bg-900);
  border: 1px solid var(--line2);
  color: var(--fg);
}

@media (max-width: 768px) {
  .tool-time-difference .td-card { padding: 1.25rem 1.5rem; }
  .tool-time-difference .sticky { position: relative; top: 0; }
  .tool-time-difference .td-btn-ghost { min-height: 44px; }
}

@media (max-width: 480px) {
  .tool-time-difference .td-card { padding: 1rem 1.25rem; }
}
