/* ═══════════════════════════════════════════════════════════════════
   Timestamp Converter - Scoped Styles
   Prefix: .tst-  (timestamp-tool)
   All rules scoped under #tst-root so they CANNOT affect other tools.
   Brand: Blue / Indigo  (#4f46e5 / #6366f1)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Google Font ─────────────────────────────────────────────────── */
/* (loaded inline in the view via <link>) */

/* ── CSS Variables ───────────────────────────────────────────────── */
#tst-root {
  --tst-brand:        #4f46e5;
  --tst-brand-mid:    #4338ca;
  --tst-brand-dark:   #3730a3;
  --tst-brand-light:  #eef2ff;
  --tst-brand-glow:   rgba(79, 70, 229, 0.18);
  --tst-brand-2:      #6366f1;

  --tst-bg:           #f8fafc;
  --tst-surface:      #ffffff;
  --tst-surface-2:    #f1f5f9;
  --tst-border:       #e2e8f0;
  --tst-border-focus: #4f46e5;

  --tst-text:         #0f172a;
  --tst-text-2:       #475569;
  --tst-text-3:       #94a3b8;

  --tst-success-bg:   #f0fdf4;
  --tst-success-text: #166534;
  --tst-success-bdr:  #86efac;
  --tst-error-bg:     #fff1f2;
  --tst-error-text:   #9f1239;
  --tst-error-bdr:    #fda4af;

  --tst-radius:       14px;
  --tst-radius-sm:    9px;
  --tst-radius-xs:    6px;
  --tst-shadow:       0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.06);
  --tst-shadow-card:  0 2px 8px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.07);
  --tst-shadow-focus: 0 0 0 3px var(--tst-brand-glow);
  --tst-transition:   all .18s cubic-bezier(.4,0,.2,1);

  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--tst-bg);
  color: var(--tst-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Reset ───────────────────────────────────────────────────────── */
#tst-root *, #tst-root *::before, #tst-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════ */
#tst-root .tst-hero {
  text-align: center;
  padding: 52px 20px 40px;
  max-width: 720px;
  margin: 0 auto;
}

#tst-root .tst-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--tst-brand-light);
  color: var(--tst-brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}

#tst-root .tst-hero-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

#tst-root .tst-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--tst-text);
  margin-bottom: 14px;
}

#tst-root .tst-hero h1 span {
  background: linear-gradient(135deg, var(--tst-brand) 0%, var(--tst-brand-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#tst-root .tst-hero p {
  font-size: 16px;
  color: var(--tst-text-2);
  max-width: 560px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════
   LIVE CLOCK BANNER
   ═══════════════════════════════════════════════════════════════════ */
#tst-root .tst-clock-banner {
  max-width: 920px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

#tst-root .tst-clock-card {
  background: linear-gradient(135deg, var(--tst-brand) 0%, var(--tst-brand-2) 100%);
  border-radius: var(--tst-radius);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#tst-root .tst-clock-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

#tst-root .tst-clock-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#tst-root .tst-clock-icon svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

#tst-root .tst-clock-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}

#tst-root .tst-clock-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}

#tst-root .tst-clock-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#tst-root .tst-clock-meta {
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 8px 14px;
  text-align: center;
  min-width: 120px;
}

#tst-root .tst-clock-meta-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 3px;
}

#tst-root .tst-clock-meta-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

#tst-root .tst-clock-copy-btn {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  padding: 8px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--tst-transition);
  white-space: nowrap;
  align-self: center;
}

#tst-root .tst-clock-copy-btn:hover {
  background: rgba(255,255,255,.3);
}

#tst-root .tst-clock-copy-btn svg {
  width: 15px;
  height: 15px;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════════ */
#tst-root .tst-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  #tst-root .tst-main {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════ */
#tst-root .tst-card {
  background: var(--tst-surface);
  border-radius: var(--tst-radius);
  box-shadow: var(--tst-shadow-card);
  border: 1px solid var(--tst-border);
  overflow: hidden;
}

#tst-root .tst-card-head {
  padding: 20px 22px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

#tst-root .tst-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#tst-root .tst-card-icon.is-blue {
  background: var(--tst-brand-light);
  color: var(--tst-brand);
}

#tst-root .tst-card-icon.is-violet {
  background: #f5f3ff;
  color: #7c3aed;
}

#tst-root .tst-card-icon svg {
  width: 20px;
  height: 20px;
}

#tst-root .tst-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tst-text);
  margin-bottom: 3px;
}

#tst-root .tst-card-sub {
  font-size: 12px;
  color: var(--tst-text-3);
}

#tst-root .tst-card-body {
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Field ──────────────────────────────────────────────────────── */
#tst-root .tst-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#tst-root .tst-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tst-text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}

#tst-root .tst-input-wrap {
  position: relative;
}

#tst-root .tst-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--tst-text);
  background: var(--tst-surface-2);
  border: 1.5px solid var(--tst-border);
  border-radius: var(--tst-radius-sm);
  outline: none;
  transition: var(--tst-transition);
  -webkit-appearance: none;
}

#tst-root .tst-input:focus {
  border-color: var(--tst-border-focus);
  background: var(--tst-surface);
  box-shadow: var(--tst-shadow-focus);
}

#tst-root .tst-input::placeholder {
  color: var(--tst-text-3);
  font-weight: 400;
}

#tst-root .tst-input.is-error {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244,63,94,.15);
}

/* Date + time side-by-side */
#tst-root .tst-datetime-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

#tst-root .tst-input[type="date"],
#tst-root .tst-input[type="time"] {
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ── Toggle row ─────────────────────────────────────────────────── */
#tst-root .tst-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#tst-root .tst-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tst-text-2);
  white-space: nowrap;
}

#tst-root .tst-unit-group {
  display: flex;
  background: var(--tst-surface-2);
  border: 1.5px solid var(--tst-border);
  border-radius: var(--tst-radius-xs);
  overflow: hidden;
}

#tst-root .tst-unit-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tst-text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--tst-transition);
}

#tst-root .tst-unit-btn.is-active {
  background: var(--tst-brand);
  color: #fff;
}

/* ── Buttons ────────────────────────────────────────────────────── */
#tst-root .tst-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#tst-root .tst-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--tst-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--tst-transition);
  white-space: nowrap;
  outline: none;
}

#tst-root .tst-btn:focus-visible {
  box-shadow: var(--tst-shadow-focus);
}

#tst-root .tst-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

#tst-root .tst-btn-primary {
  background: var(--tst-brand);
  color: #fff;
}

#tst-root .tst-btn-primary:hover {
  background: var(--tst-brand-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--tst-brand-glow);
}

#tst-root .tst-btn-primary:active {
  transform: translateY(0);
}

#tst-root .tst-btn-outline {
  background: transparent;
  color: var(--tst-brand);
  border: 1.5px solid var(--tst-brand);
}

#tst-root .tst-btn-outline:hover {
  background: var(--tst-brand-light);
}

#tst-root .tst-btn-ghost {
  background: var(--tst-surface-2);
  color: var(--tst-text-2);
  border: 1.5px solid var(--tst-border);
}

#tst-root .tst-btn-ghost:hover {
  background: var(--tst-border);
  color: var(--tst-text);
}

/* ── Output box ─────────────────────────────────────────────────── */
#tst-root .tst-output {
  background: var(--tst-surface-2);
  border: 1.5px solid var(--tst-border);
  border-radius: var(--tst-radius-sm);
  overflow: hidden;
  min-height: 130px;
  transition: border-color .18s;
}

#tst-root .tst-output.has-result {
  border-color: var(--tst-brand);
}

#tst-root .tst-output-placeholder {
  padding: 28px 18px;
  text-align: center;
  color: var(--tst-text-3);
  font-size: 13px;
}

#tst-root .tst-output-placeholder svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  display: block;
  color: var(--tst-text-3);
  opacity: .5;
}

#tst-root .tst-result-rows {
  display: none;
}

#tst-root .tst-output.has-result .tst-output-placeholder {
  display: none;
}

#tst-root .tst-output.has-result .tst-result-rows {
  display: block;
}

#tst-root .tst-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--tst-border);
  transition: background .15s;
}

#tst-root .tst-result-row:last-child {
  border-bottom: none;
}

#tst-root .tst-result-row:hover {
  background: var(--tst-surface);
}

#tst-root .tst-result-key {
  font-size: 11px;
  font-weight: 600;
  color: var(--tst-text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  min-width: 80px;
  flex-shrink: 0;
}

#tst-root .tst-result-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--tst-text);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
  flex: 1;
  text-align: right;
}

#tst-root .tst-result-val.is-highlight {
  color: var(--tst-brand);
  font-weight: 700;
}

#tst-root .tst-copy-row-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--tst-text-3);
  padding: 3px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: var(--tst-transition);
  flex-shrink: 0;
}

#tst-root .tst-copy-row-btn:hover {
  color: var(--tst-brand);
  background: var(--tst-brand-light);
}

#tst-root .tst-copy-row-btn svg {
  width: 14px;
  height: 14px;
}

/* ── Error / notice banner ──────────────────────────────────────── */
#tst-root .tst-notice {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: var(--tst-radius-xs);
  font-size: 13px;
  font-weight: 500;
}

#tst-root .tst-notice.is-visible {
  display: flex;
}

#tst-root .tst-notice.is-error {
  background: var(--tst-error-bg);
  color: var(--tst-error-text);
  border: 1px solid var(--tst-error-bdr);
}

#tst-root .tst-notice.is-success {
  background: var(--tst-success-bg);
  color: var(--tst-success-text);
  border: 1px solid var(--tst-success-bdr);
}

#tst-root .tst-notice svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SEO CONTENT SECTION
   ═══════════════════════════════════════════════════════════════════ */
#tst-root .tst-seo {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

#tst-root .tst-seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  #tst-root .tst-seo-grid {
    grid-template-columns: 1fr;
  }
}

#tst-root .tst-seo-card {
  background: var(--tst-surface);
  border: 1px solid var(--tst-border);
  border-radius: var(--tst-radius);
  padding: 22px;
  box-shadow: var(--tst-shadow);
}

#tst-root .tst-seo-card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--tst-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

#tst-root .tst-seo-card h2 svg {
  width: 18px;
  height: 18px;
  color: var(--tst-brand);
  flex-shrink: 0;
}

#tst-root .tst-seo-card p {
  font-size: 14px;
  color: var(--tst-text-2);
  line-height: 1.7;
}

/* FAQ */
#tst-root .tst-faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#tst-root .tst-faq-item {
  background: var(--tst-surface);
  border: 1px solid var(--tst-border);
  border-radius: var(--tst-radius-sm);
  padding: 16px 18px;
  box-shadow: var(--tst-shadow);
}

#tst-root .tst-faq-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--tst-text);
  margin-bottom: 6px;
}

#tst-root .tst-faq-a {
  font-size: 13px;
  color: var(--tst-text-2);
  line-height: 1.65;
}

/* Examples table */
#tst-root .tst-examples {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

#tst-root .tst-examples th {
  font-size: 11px;
  font-weight: 700;
  color: var(--tst-text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--tst-border);
}

#tst-root .tst-examples td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--tst-border);
  color: var(--tst-text-2);
  vertical-align: top;
}

#tst-root .tst-examples tr:last-child td {
  border-bottom: none;
}

#tst-root .tst-examples td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--tst-brand);
  white-space: nowrap;
}

/* ── Section heading ────────────────────────────────────────────── */
#tst-root .tst-seo-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--tst-text);
  margin-bottom: 16px;
  letter-spacing: -.01em;
}

/* ── Copy flash toast ───────────────────────────────────────────── */
#tst-root .tst-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 100px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  white-space: nowrap;
}

#tst-root .tst-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Divider ────────────────────────────────────────────────────── */
#tst-root .tst-divider {
  height: 1px;
  background: var(--tst-border);
  max-width: 920px;
  margin: 0 auto 40px;
}

/* ─── Responsive tweaks ─────────────────────────────────────────── */
@media (max-width: 480px) {
  #tst-root .tst-hero {
    padding: 36px 16px 28px;
  }
  #tst-root .tst-clock-card {
    padding: 18px 18px;
    flex-direction: column;
    align-items: stretch;
  }
  #tst-root .tst-clock-right {
    justify-content: space-between;
  }
  #tst-root .tst-clock-meta {
    flex: 1;
    min-width: unset;
  }
  #tst-root .tst-card-body {
    padding: 0 16px 18px;
  }
  #tst-root .tst-card-head {
    padding: 16px 16px 0;
  }
  #tst-root .tst-btn-row {
    flex-direction: column;
  }
  #tst-root .tst-btn {
    justify-content: center;
    width: 100%;
  }
}
