/* ============================================================
   Trading Hours page — RIT Gestio
   ============================================================ */

/* ---------- World clock strip ---------- */
.world-clock {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 28px;
  align-items: stretch;
  background: linear-gradient(165deg, #0b1220 0%, #131f3a 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: #e2e8f0;
  position: relative;
  overflow: hidden;
}
.world-clock::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(35% 60% at 100% 0%, rgba(37, 99, 235, 0.30), transparent 60%),
    radial-gradient(30% 60% at 0% 100%, rgba(6, 182, 212, 0.18), transparent 60%);
  pointer-events: none;
}
.world-clock > * { position: relative; }
.clock-now { border-right: 1px solid rgba(255, 255, 255, 0.08); padding-right: 28px; }
.clock-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.clock-label::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
  animation: clockPulse 2.4s ease-in-out infinite;
}
@keyframes clockPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.20); }
  50%      { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}
.clock-utc {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock-utc .utc-tag {
  font-size: 14px;
  color: #93c5fd;
  margin-left: 8px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.clock-meta { font-size: 13px; color: #94a3b8; margin-top: 6px; }

.clock-cities {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: center;
}
.clock-cities .city {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.city-name {
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.city-time {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

@media (max-width: 980px) {
  .world-clock { grid-template-columns: 1fr; padding: 24px 26px; }
  .clock-now { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-right: 0; padding-bottom: 22px; }
  .clock-cities { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .clock-cities { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Timeline ---------- */
.timeline-card { padding: 28px 32px; }
.timeline {
  position: relative;
  padding-left: 130px;
  padding-top: 28px;
  padding-bottom: 8px;
}
.timeline-axis {
  position: absolute;
  left: 130px;
  right: 0;
  top: 0;
  height: 22px;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  border-bottom: 1px dashed var(--line);
}
.timeline-axis::before { content: ""; }
.timeline-axis .tick {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  text-align: left;
  line-height: 1;
  position: relative;
  padding-top: 2px;
}
.timeline-axis .tick::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 1px; height: 5px;
  background: var(--line);
}
.timeline-axis .tick.major { color: var(--ink); font-weight: 600; }
.timeline-rows {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 0;
  position: relative;
  margin-left: -130px;
}
.trow-label {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  padding-right: 16px;
  letter-spacing: -0.01em;
}
.trow-track {
  position: relative;
  height: 22px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.tbar {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 999px;
  transform-origin: left center;
  animation: barIn 700ms cubic-bezier(.2,.7,.2,1) both;
}
.tbar-fx {
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.45) inset, 0 0 0 1px rgba(37, 99, 235, 0.30);
}
.tbar-crypto {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.40) inset, 0 0 0 1px rgba(124, 58, 237, 0.30);
}
@keyframes barIn {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
.timeline-now {
  position: absolute;
  top: 0; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.9), rgba(220, 38, 38, 0.15));
  z-index: 4;
  pointer-events: none;
  /* JS sets `left` inline */
}
.timeline-now .now-flag {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 6px 14px -4px rgba(220, 38, 38, 0.4);
}

.timeline-legend {
  display: flex;
  gap: 24px;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
}
.timeline-legend .dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-right: 8px; vertical-align: -2px; }
.timeline-legend .tl-fx { background: linear-gradient(90deg, #06b6d4, #2563eb); }
.timeline-legend .tl-crypto { background: linear-gradient(90deg, #4f46e5, #7c3aed); }

@media (max-width: 760px) {
  .timeline-card { padding: 22px; overflow-x: auto; }
  .timeline { min-width: 720px; }
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  align-self: flex-start;
  width: max-content;
  max-width: 100%;
}
.chip-filter {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.chip-filter:hover { color: var(--ink); }
.chip-filter.on {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---------- Market cards ---------- */
.markets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.m-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.m-card.hidden { display: none; }
.m-card:hover {
  transform: translateY(-3px);
  border-color: #cfd8e3;
  box-shadow: var(--shadow-lg);
}
.m-card.is-open {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow:
    0 22px 50px -18px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(34, 197, 94, 0.18);
}
.m-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.m-name { display: flex; align-items: center; gap: 12px; }
.m-flag {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.m-flag svg { width: 100%; height: 100%; display: block; }
/* Legacy gradient classes kept for backwards-compat; not used anymore */
.flag-au, .flag-jp, .flag-gb, .flag-us, .flag-de, .flag-nl, .flag-hk, .flag-global { background: transparent; }

.m-card h4 { margin: 0; font-size: 16px; letter-spacing: -0.015em; }
.m-region { font-size: 12px; color: var(--muted-2); margin-top: 2px; }

.m-status {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-soft);
  color: var(--muted-2);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.m-status.is-open {
  background: #dcfce7;
  color: #166534;
  border-color: rgba(22, 163, 74, 0.2);
}
.m-status.is-open::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
.m-status.is-soon {
  background: #fef3c7;
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.25);
}
.m-status.is-soon::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #d97706;
}
.m-status.is-closed {
  background: #f1f5f9;
  color: #475569;
}

.m-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px;
}
.m-label {
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.m-val { color: var(--ink); font-weight: 600; white-space: nowrap; }
.m-note {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 980px) {
  .markets-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .markets-grid { grid-template-columns: 1fr; }
}

/* ---------- Overlap windows ---------- */
.overlap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.overlap-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.overlap-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.overlap-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
}
.overlap-time {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.overlap-time span { color: var(--muted-2); font-weight: 500; margin-left: 4px; }
.overlap-card h3 {
  font-size: 22px; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.overlap-card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0; }
.overlap-mini {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.overlap-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-2);
  letter-spacing: 0.04em;
}
@media (max-width: 960px) {
  .overlap-grid { grid-template-columns: 1fr; }
  .overlap-card { padding: 26px; }
}

/* ---------- Home preview ---------- */
.th-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.th-preview::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(40% 50% at 100% 0%, rgba(37, 99, 235, 0.06), transparent 60%);
  pointer-events: none;
}
.th-preview > * { position: relative; }
.th-preview h2 { margin-top: 18px; }
.th-preview-text p { font-size: 16.5px; margin-top: 16px; }
.th-preview-mini {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.th-mini-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.th-mini-card:hover {
  transform: translateX(4px);
  border-color: #cfd8e3;
  background: #fff;
}
.th-mini-card .ic {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.th-mini-card .ic svg { width: 100%; height: 100%; display: block; }
.th-mini-card h5 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.th-mini-card p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted-2);
}
.th-mini-utc {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-align: right;
  white-space: nowrap;
}
/* Mini timeline */
.th-mini-timeline {
  margin-top: 14px;
  padding: 18px 18px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}
.th-mini-timeline .axis {
  display: grid; grid-template-columns: repeat(8, 1fr);
  margin-bottom: 10px;
}
.th-mini-timeline .axis span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
}
.th-mini-timeline .rows { display: flex; flex-direction: column; gap: 6px; }
.th-mini-timeline .row {
  display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center;
}
.th-mini-timeline .row span:first-child {
  font-size: 11.5px; color: var(--ink-2); font-weight: 600;
}
.th-mini-timeline .row .track {
  position: relative;
  height: 8px;
  background: #eef2f9;
  border-radius: 999px;
  overflow: hidden;
}
.th-mini-timeline .row .bar {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  border-radius: 999px;
  animation: barIn 800ms cubic-bezier(.2,.7,.2,1) both;
}
@media (max-width: 880px) {
  .th-preview { padding: 32px; grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .clock-label::before,
  .tbar,
  .th-mini-timeline .row .bar {
    animation: none !important;
  }
  .m-card:hover, .overlap-card:hover, .th-mini-card:hover { transform: none; }
}
