@charset "UTF-8";

/* ==========================================
   FOREX-SESSIONS.CSS – Live Market Chart
   Project: src-main | Gold Forward v3.0.0
   Uses design tokens from base.css
   Dark-theme native — no inline overrides
   ========================================== */

/* ---------- Session Color Tokens ---------- */
:root {
  --session-sydney: #7c8ba0;
  --session-tokyo: #64748b;
  --session-london: #22c55e;
  --session-newyork: #16a34a;

  /* Glass tokens — light theme fallback */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(10, 32, 214, 0.12);
}

/* ==========  STATS ROW  ========== */
.hero__stats {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  min-height: 72px;
}

/* Stats Card - City */
.stats-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-border);
  backdrop-filter: blur(8px);
  min-width: 120px;
  text-align: center;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.stats-card:hover {
  border-color: var(--border-gold-hover);
  border-top-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Open state — green top accent */
.stats-card.is-open {
  border-top-color: var(--color-success);
}

/* Active / current session */
.stats-card.is-active {
  border-top-color: var(--color-primary);
  box-shadow:
    0 0 0 1px var(--border-gold),
    var(--shadow-md);
}

.stats-card__city {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stats-card__time {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-heading);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stats-card__status {
  font-size: 10px;
  font-weight: 700;
  margin-top: var(--space-0);
  padding: 2px var(--space-1);
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-card__status.open {
  background: var(--surface-success);
  color: var(--color-success);
}

.stats-card__status.closed {
  background: var(--glass);
  color: var(--color-text-muted);
}

/* Stats Card - Next Event (Highlight) */
.stats-card--next {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-deep)
  );
  border-color: transparent;
  min-width: 150px;
  position: relative;
  overflow: hidden;
}

.stats-card--next::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
}

.stats-card--next:hover {
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(10, 32, 214, 0.2);
}

.stats-card--next .stats-card__label {
  font-size: 9px;
  font-weight: 600;
  color: var(--color-on-primary-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stats-card--next .stats-card__time {
  color: var(--color-on-primary);
  font-size: var(--font-size-2xl);
}

.stats-card--next .stats-card__event {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-on-primary-muted);
  margin-top: 2px;
}

.stats-card--next .stats-card__event.opening {
  color: var(--color-on-primary);
}

.stats-card--next .stats-card__event.closing {
  color: var(--color-on-primary-subtle);
}

/* ==========  WEEKEND BANNER  ========== */
.hero__banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
}

.hero__banner--closed {
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.hero__banner-icon {
  font-size: var(--font-size-xl);
  opacity: 0.6;
}

.hero__banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__banner-text strong {
  font-size: var(--font-size-sm);
  color: var(--color-text-heading);
}

.hero__banner-text span {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ==========  CHART SECTION  ========== */
.hero__chart {
  background: var(--surface-card);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  position: relative;
  overflow: clip;
  box-shadow: var(--shadow-sm);
}

/* Chart Header */
.chart__header {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
}

.chart__label {
  width: 140px;
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.chart__scale {
  display: flex;
  justify-content: space-between;
  flex: 1;
}

.chart__gmt {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Time Markers */
.time-marker {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  flex: 1;
  position: relative;
}

.time-marker::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 5px;
  background: var(--color-border);
}

/* Chart Body */
.chart__body {
  position: relative;
  padding: var(--space-2) 0;
  margin-left: 140px;
  min-height: 200px;
}

/* Session Row */
.session-row {
  position: relative;
  height: 44px;
  margin-bottom: var(--space-0);
}

/* Session Label */
.session-label {
  position: absolute;
  left: -140px;
  width: 135px;
  height: 100%;
  display: flex;
  align-items: center;
  padding-right: var(--space-2);
}

.city-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.city-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-1);
  font-variant-numeric: tabular-nums;
}

/* Session Bar */
.session-bar {
  position: absolute;
  height: 32px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-text-heading);
  font-weight: 600;
  transition: var(--transition-base);
  cursor: default;
}

.session-bar:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-md);
}

/* Session States */
.session-bar.inactive {
  opacity: 0.35;
}

.session-bar.active {
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Session Colors - Asian (Slate) */
.session-bar.sydney {
  background: var(--session-sydney);
}

.session-bar.tokyo {
  background: var(--session-tokyo);
}

/* Session Colors - Major (Green) */
.session-bar.london {
  background: var(--session-london);
}

.session-bar.newyork {
  background: var(--session-newyork);
}

/* Active Glow */
.session-bar.sydney.active {
  box-shadow: 0 0 20px rgba(124, 139, 160, 0.5);
}
.session-bar.tokyo.active {
  box-shadow: 0 0 20px rgba(100, 116, 139, 0.5);
}
.session-bar.london.active {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}
.session-bar.newyork.active {
  box-shadow: 0 0 20px rgba(22, 163, 74, 0.5);
}

/* Tooltip */
.session-bar[data-pairs]::after {
  content: attr(data-pairs);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--surface-dropdown);
  color: var(--color-text-heading);
  border: 1px solid var(--glass-border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
  z-index: var(--z-dropdown);
  pointer-events: none;
}

.session-bar[data-pairs]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Current Time Line */
.chart__now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-primary);
  z-index: var(--z-base);
  box-shadow: 0 0 12px rgba(10, 32, 214, 0.3);
  transition: left 0.1s linear;
}

.chart__now::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top: 6px solid var(--color-primary);
}

.chart__now::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom: 6px solid var(--color-primary);
}

/* Overlap Zones */
.overlap-zone {
  position: absolute;
  height: calc(100% + 16px);
  top: -8px;
  background: var(--surface-gold);
  border-left: 1px dashed rgba(10, 32, 214, 0.2);
  border-right: 1px dashed rgba(10, 32, 214, 0.2);
  z-index: 0;
  pointer-events: none;
}

.overlap-zone::before {
  content: attr(data-label);
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  background: var(--surface-gold-hover);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 5;
}

/* ==========  LEGEND  ========== */
.hero__legend {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
}

.legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend__dot--asian {
  background: var(--session-tokyo);
}

.legend__dot--major {
  background: var(--color-success);
}

.legend__dot--overlap {
  background: var(--color-primary);
}

/* ==========  RESPONSIVE  ========== */
@media (max-width: 768px) {
  .hero {
    padding: var(--space-6) 0 var(--space-4) 0;
  }

  .hero__container {
    padding: 0 var(--space-2);
  }

  .hero__header {
    margin-bottom: var(--space-3);
  }

  .hero__title {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
    line-height: 1.2;
    animation: none;
    margin-top: 0;
    margin-bottom: var(--space-1);
  }

  .hero__subtitle {
    font-size: var(--font-size-xs);
    opacity: 0.7;
    max-width: 280px;
    margin: 0 auto;
  }

  .hero__stats {
    gap: var(--space-1);
    flex-wrap: wrap;
    min-height: 56px;
  }

  .stats-card {
    min-width: 0;
    flex: 1 1 20%;
    padding: var(--space-1) var(--space-1);
  }

  .stats-card__city {
    font-size: 8px;
  }

  .stats-card__time {
    font-size: var(--font-size-base);
  }

  .stats-card--next {
    flex: 1 1 100%;
    order: -1;
    flex-direction: row;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2);
  }

  .stats-card--next .stats-card__time {
    font-size: var(--font-size-xl);
  }

  .hero__chart {
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .chart__header {
    min-width: 600px;
  }

  .chart__label {
    width: 90px;
    font-size: var(--font-size-xs);
  }

  .chart__body {
    margin-left: 90px;
    min-height: 180px;
    min-width: 600px;
  }

  .session-row {
    position: relative;
    height: 38px;
  }

  .session-label {
    left: -90px;
    width: 85px;
  }

  .city-name {
    font-size: var(--font-size-xs);
  }

  .city-time {
    display: none;
  }

  .time-marker {
    font-size: 9px;
  }

  .session-bar {
    height: 28px;
    font-size: 9px;
  }

  .hero__legend {
    gap: var(--space-3);
  }
}

@media (max-width: 500px) {
  .chart__label {
    width: 70px;
  }

  .chart__body {
    margin-left: 70px;
  }

  .session-label {
    left: -70px;
    width: 65px;
  }

  .time-marker:nth-child(odd) {
    visibility: hidden;
  }
}
