/* =============================================================================
   Stock Market Ticker — stock-ticker.css
   Version 1.3.0
   ============================================================================= */

/* ---- CSS Custom Properties (theme tokens) --------------------------------- */
:root {
  /* All color vars are set at runtime by stock-ticker.js from the admin
     color customizer. Values here are pre-JS fallbacks only. */
  --smt-accent:      #0073aa;
  --smt-up:          #22c55e;
  --smt-down:        #ef4444;
  --smt-up-bg:       rgba(34,  197, 94,  0.12);
  --smt-down-bg:     rgba(239, 68,  68,  0.12);
  --smt-bg:          #ffffff;
  --smt-surface:     #f8fafc;
  --smt-border:      #e2e8f0;
  --smt-text:        #0f172a;
  --smt-text-muted:  #64748b;
  --smt-ticker-bg:   #0f172a;
  --smt-ticker-txt:  #ffffff;
  --smt-shadow:      0 1px 6px rgba(0,0,0,.08);
  --smt-radius:      10px;
  --smt-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* .smt-dark class is still applied by PHP when Dark Mode is checked.
   Colors are now fully driven by the customizer, not hardcoded here. */

/* =============================================================================
   1. SCROLLING TICKER BAR
   ============================================================================= */

.smt-ticker-wrap {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  background: var(--smt-ticker-bg);
  border: 1px solid var(--smt-border);
  border-radius: var(--smt-radius);
  min-height: 44px;
  height: 44px;
  overflow: hidden;
  font-family: var(--smt-font);
  font-size: 13px;
  box-shadow: var(--smt-shadow);
  color: var(--smt-text);
  width: 100%;
  box-sizing: border-box;
}

.smt-ticker-label {
  flex-shrink: 0;
  flex-grow: 0;
  background: var(--smt-accent);
  color: var(--smt-ticker-txt);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 16px;
  height: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  user-select: none;
  white-space: nowrap;
}

.smt-ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  /* Fade edges */
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.smt-ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  animation: smt-scroll 30s linear infinite;
}

.smt-ticker-track:hover {
  animation-play-state: paused;
}

@keyframes smt-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.smt-ticker-inner {
  display: inline-flex;
  align-items: center;
}

.smt-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  cursor: default;
}

.smt-ticker-sym {
  font-weight: 700;
  color: var(--smt-text);
}

.smt-ticker-price {
  color: var(--smt-text);
}

.smt-ticker-chg {
  font-size: 12px;
}

.smt-ticker-sep {
  color: var(--smt-border);
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
}

.smt-ticker-loading,
.smt-ticker-error {
  padding: 0 20px;
  color: var(--smt-text-muted);
  font-style: italic;
}

/* =============================================================================
   2. DATA TABLE
   ============================================================================= */

.smt-table-wrap {
  font-family: var(--smt-font);
  overflow-x: auto;
  border-radius: var(--smt-radius);
  box-shadow: var(--smt-shadow);
}

.smt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--smt-surface);
  border-radius: var(--smt-radius);
  overflow: hidden;
  color: var(--smt-text);
}

.smt-table thead {
  background: var(--smt-bg);
}

.smt-table thead th {
  color: var(--smt-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  padding: 10px 16px;
  text-align: right;
  border-bottom: 2px solid var(--smt-border);
}

.smt-table thead th:first-child {
  text-align: left;
  /* Accent left-border on header label column */
  border-left: 3px solid var(--smt-accent);
  padding-left: 14px;
}

.smt-table td {
  padding: 11px 16px;
  text-align: right;
  border-bottom: 1px solid var(--smt-border);
  vertical-align: middle;
  white-space: nowrap;
}

.smt-table td:first-child {
  text-align: left;
}

.smt-table tbody tr:last-child td {
  border-bottom: none;
}

.smt-table tbody tr:hover {
  background: rgba(128, 128, 128, 0.06);
  transition: background 0.15s ease;
}

.smt-table-sym {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.smt-table-price {
  font-weight: 600;
  font-size: 14px;
}

.smt-loading {
  text-align: center !important;
  color: var(--smt-text-muted);
  padding: 24px 16px !important;
  font-style: italic;
}

.smt-timestamp {
  font-family: var(--smt-font);
  font-size: 11px;
  color: var(--smt-text-muted);
  text-align: right;
  margin: 6px 0 0;
}

/* =============================================================================
   3. MINI WIDGET CARD
   ============================================================================= */

.smt-card {
  display: inline-block;
  font-family: var(--smt-font);
  background: var(--smt-surface);
  border: 1px solid var(--smt-border);
  border-radius: var(--smt-radius);
  padding: 18px 22px;
  min-width: 210px;
  box-shadow: var(--smt-shadow);
  color: var(--smt-text);
  transition: box-shadow 0.2s ease;
}

.smt-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.smt-card-inner {
  position: relative;
}

.smt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.smt-card-symbol {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--smt-text);
}

.smt-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.smt-card-badge.smt-up {
  background: var(--smt-up-bg);
  color: var(--smt-up);
}

.smt-card-badge.smt-down {
  background: var(--smt-down-bg);
  color: var(--smt-down);
}

.smt-card-price {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  color: var(--smt-text);
}

.smt-card-change {
  font-size: 13px;
  margin-bottom: 14px;
}

.smt-card-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--smt-text-muted);
  border-top: 1px solid var(--smt-border);
  padding-top: 12px;
}

.smt-card-meta span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.smt-card-loading,
.smt-card-error {
  color: var(--smt-text-muted);
  font-size: 14px;
  padding: 6px 0;
  font-style: italic;
}

/* =============================================================================
   4. SPARKLINE CHART
   ============================================================================= */

.smt-sparkline-wrap {
  display: inline-block;
  font-family: var(--smt-font);
  background: var(--smt-surface);
  border: 1px solid var(--smt-border);
  border-radius: var(--smt-radius);
  padding: 16px 18px 12px;
  min-width: 260px;
  box-shadow: var(--smt-shadow);
  color: var(--smt-text);
}

.smt-sparkline-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.smt-sparkline-symbol {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.smt-sparkline-price {
  font-size: 20px;
  font-weight: 600;
}

.smt-sparkline-change {
  font-size: 13px;
  font-weight: 500;
}

.smt-sparkline-canvas {
  width: 100%;
  height: 80px;
  display: block;
  border-radius: 4px;
}

.smt-sparkline-period {
  font-size: 11px;
  color: var(--smt-text-muted);
  margin-top: 6px;
  text-align: right;
}

.smt-sparkline-loading {
  color: var(--smt-text-muted);
  font-size: 13px;
  text-align: center;
  padding: 18px 0;
  font-style: italic;
}

/* =============================================================================
   5. SHARED UP / DOWN COLOURS
   ============================================================================= */

.smt-up   { color: var(--smt-up); }
.smt-down { color: var(--smt-down); }

/* =============================================================================
   6. RESPONSIVE OVERRIDES
   ============================================================================= */

@media (max-width: 600px) {
  .smt-table th:nth-child(n+5),
  .smt-table td:nth-child(n+5) {
    display: none; /* hide H/L/O/PC on small screens */
  }

  .smt-card {
    min-width: unset;
    width: 100%;
  }

  .smt-sparkline-wrap {
    min-width: unset;
    width: 100%;
  }
}
