/*!
 * Discord Timestamp Generator - 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
 */

.dtg-card {
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 4px 20px;
  border: 2px solid #e9ecef;
  border-radius: 24px;
  background: #f8f9fa;
}

.dtg-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.dtg-field + .dtg-field {
  border-top: 1px solid #e9ecef;
}

.dtg-field-label {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
}

/* Sits under its input in the second grid column. The timestamp field reads both
   ways and nothing else on the page says so, and a title tooltip does not exist
   on touch at all. */
.dtg-hint {
  grid-column: 2;
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}

.dtg-hint code {
  font-family: Consolas, 'Cascadia Code', 'Courier New', monospace;
  font-size: 12px;
  background: #e9ecef;
  padding: 1px 5px;
  border-radius: 4px;
}

/* One control style for date, time and select alike */
.dtg-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 2px solid #d1d5db;
  border-radius: 24px;
  background: #ffffff;
  color: #2c3e50;
  font-family: Consolas, 'Roboto Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Liberation Mono', 'Courier New', monospace;
  font-size: 15px;
  font-weight: bold;
  min-height: 44px;
  transition: border-color 0.2s ease;
}

select.dtg-input {
  font-family: inherit;
  cursor: pointer;
}

.dtg-input:focus {
  outline: none;
  border-color: #3984a7;
}

.dtg-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
  border-radius: 6px;
  padding: 2px;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.dtg-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: #f0f8ff;
}

/* The "Discord shows" row is a readout, not a control */
.dtg-field-preview {
  align-items: baseline;
}

.dtg-preview {
  font-size: 16px;
  font-weight: bold;
  color: #16a34a;
  word-break: break-word;
}

/* ---------------------------------------------------------------------------
   Output: the thing people actually came for
   --------------------------------------------------------------------------- */

/* Same field treatment as the live clock, one size up: this is what the page
   is for. Clickable in its own right, on the .output-display precedent. */
.dtg-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 20px;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 2px solid #e9ecef;
  border-radius: 24px;
  background: #ffffff;
  font-family: Consolas, 'Roboto Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Liberation Mono', 'Courier New', monospace;
  font-size: clamp(18px, 4.4vw, 26px);
  font-weight: bold;
  color: #2c3e50;
  letter-spacing: 0.5px;
  word-break: break-all;
  min-height: 64px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.dtg-code:hover {
  border-color: #3984a7;
  background: #f0f8ff;
}

.dtg-code:active {
  transform: scale(0.99);
}

.dtg-code:focus-visible {
  outline: 2px solid #3984a7;
  outline-offset: 2px;
}

.dtg-code.copied {
  border-color: #16a34a;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.dtg-copy.copied {
  background-color: #16a34a;
  border-color: #16a34a;
}

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

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

/* ---------------------------------------------------------------------------
   Powerful by choice: everything past here stays folded away by default
   --------------------------------------------------------------------------- */

/* Full format list inside the fold */

/* Copy target inside the style table. Transparent, so the <code> chip that
   styles/table.css paints stays the visible surface. */
.dtg-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;
}

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

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

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

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

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

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

.dtg-copy-cell.copied code {
  border-color: #16a34a;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.dtg-copy-cell.copied .copy-icon {
  color: #16a34a;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

@media (max-width: 480px) {
}

@media (max-width: 360px) {
}

@media (max-width: 560px) {
  .dtg-card {
    padding: 4px 16px;
  }

  .dtg-field {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }

  .dtg-field-label {
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: bold;
  }

  /* The grid collapses to one column here, so the hint follows in column 1. */
  .dtg-hint {
    grid-column: 1;
    margin-top: 2px;
  }

  .dtg-copy {
    width: 100%;
  }
}

/* The raw values and the live clock are separate groups in the same table. */
.dtg-other tr:first-child td,
.dtg-raw tr:first-child td,
.dtg-live tr:first-child td {
  border-top: 2px solid #c4c4c4;
}

/* Without this the row twitches every tick as digit widths change. */
.dtg-live code {
  font-variant-numeric: tabular-nums;
}

/* Viewing angle for the preview column. Deliberately quiet: it changes
   nothing about the timestamp, only how the preview column is rendered. */
.dtg-viewas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
}

.dtg-viewas-select {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  background: #ffffff;
  color: #374151;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 100%;
}

.dtg-viewas-select:hover {
  border-color: #3984a7;
  background: #f0f8ff;
}

.dtg-viewas-select:focus-visible {
  outline: 2px solid #3984a7;
  outline-offset: 2px;
}
