/* ============================================================
   XAUUSD Signal Engine — Premium Dark Dashboard
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-base: #080b10;
  --bg-card: #0d1117;
  --bg-card2: #111820;
  --bg-hover: #161d28;
  --border: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(251, 191, 36, 0.3);
  --gold: #fbbf24;
  --gold-dim: #92711a;
  --gold-glow: rgba(251, 191, 36, 0.15);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --blue: #38bdf8;
  --blue-dim: rgba(56, 189, 248, 0.12);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.12);
  --yellow: #fde047;
  --text-primary: #f1f5f9;
  --text-secondary: #64748b;
  --text-muted: #334155;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(251, 191, 36, 0.08);
}

/* ── v-cloak: hide app until Vue mounts to prevent raw {{ }} flash ── */
[v-cloak] {
  display: none !important;
}

/* ── Pre-mount splash screen ──────────────────────────────────────── */
#app-splash {
  position: fixed;
  inset: 0;
  background: var(--bg-base, #080b10);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#app-splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.splash-logo {
  font-size: 2.8rem;
  animation: sk-pulse 1.2s ease-in-out infinite;
}

.splash-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.5px;
}

.splash-title span {
  color: #fbbf24;
}

.splash-meta {
  font-size: 0.72rem;
  color: #64748b;
  letter-spacing: 0.04em;
}

.splash-bars {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.splash-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.15) 25%, rgba(251, 191, 36, 0.5) 50%, rgba(251, 191, 36, 0.15) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.2s infinite linear;
}

.splash-bar:nth-child(2) {
  animation-delay: 0.15s;
}

.splash-bar:nth-child(3) {
  animation-delay: 0.30s;
}

.splash-sub {
  font-size: 0.7rem;
  color: #334155;
  margin-top: 4px;
  letter-spacing: 0.06em;
}


/* ── Skeleton / Shimmer Loading ─────────────────────────────── */
@keyframes shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

@keyframes sk-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.skel {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 25%,
      rgba(255, 255, 255, 0.10) 50%,
      rgba(255, 255, 255, 0.04) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}

.skeleton-card {
  animation: sk-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
  /* Override border glow from .signal-card so it looks neutral */
  border-color: rgba(255, 255, 255, 0.07) !important;
  background: var(--bg-card) !important;
}

/* Sidebar strategy rows skeleton */
.skel-strategy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}


*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.app-wrapper {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.topbar-title span {
  color: var(--gold);
}

.topbar-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 600;
}

.live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.main-grid {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 0;
  height: calc(100vh - 65px);
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section-title {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 10px;
}

/* Stats cards */
.stat-block {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 3px;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-value.gold {
  color: var(--gold);
}

.stat-value.green {
  color: var(--green);
}

.stat-value.red {
  color: var(--red);
}

.stat-value.muted {
  color: var(--text-secondary);
}

/* Cooldown / risk status */
.risk-status {
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.risk-status.normal {
  background: var(--green-dim);
  border-color: rgba(34, 197, 94, 0.2);
}

.risk-status.cooldown {
  background: var(--red-dim);
  border-color: rgba(239, 68, 68, 0.2);
}

.risk-label {
  font-weight: 600;
  margin-bottom: 2px;
}

.risk-sub {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

/* Strategy breakdown */
.strategy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.strategy-row:last-child {
  border-bottom: none;
}

.strategy-name {
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.approaching-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gold);
  margin-left: 8px;
  box-shadow: 0 0 4px var(--gold);
  animation: pulse 2s infinite;
}

.strategy-count {
  font-family: 'JetBrains Mono', monospace;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
}

/* Date picker */
.date-ctrl {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-ctrl input {
  flex: 1;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #000;
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.content-area {
  position: relative;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.content-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.filter-tab.active {
  background: var(--bg-card2);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── SIGNAL CARDS ───────────────────────────────────────────── */
.signals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
}

.signal-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.signal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.signal-card.buy::before {
  background: linear-gradient(90deg, var(--green), transparent);
}

.signal-card.sell::before {
  background: linear-gradient(90deg, var(--red), transparent);
}

.signal-card.buy {
  border-left: 3px solid rgba(34, 197, 94, 0.5);
}

.signal-card.sell {
  border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.card-direction {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dir-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.dir-badge.buy {
  background: var(--green-dim);
  color: var(--green);
}

.dir-badge.sell {
  background: var(--red-dim);
  color: var(--red);
}

.strategy-badge {
  font-size: 0.65rem;
  color: var(--text-secondary);
  background: var(--bg-card2);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.status-badge.pending {
  background: var(--blue-dim);
  color: var(--blue);
}

.status-badge.active {
  background: var(--gold-glow);
  color: var(--gold);
}

.status-badge.tp1,
.status-badge.tp2,
.status-badge.tp3 {
  background: var(--green-dim);
  color: var(--green);
}

.status-badge.sl {
  background: var(--red-dim);
  color: var(--red);
}

.status-badge.expired {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}

.status-badge.cancelled {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}

/* price levels */
.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.price-row {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.price-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

.price-value.entry {
  color: var(--gold);
}

.price-value.tp {
  color: var(--green);
}

.price-value.sl {
  color: var(--red);
}

.signal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.footer-rr {
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple);
  font-weight: 600;
}

.footer-session {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-card2);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── ACTION BUTTONS ON CARD ─────────────────────────────────── */
.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.act-btn {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--text-secondary);
}

.act-btn:hover {
  transform: none;
}

.act-btn.tp:hover {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.3);
}

.act-btn.sl:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 0.8rem;
}

/* ── PREMIUM LOADER OVERLAY ─────────────────────────────────────── */
.premium-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 16, 0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  border-radius: var(--radius-lg);
  min-height: 400px;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-rings {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-icon {
  font-size: 1.8rem;
  z-index: 2;
  animation: pulse-icon 2s infinite ease-in-out;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring.outer {
  width: 100%;
  height: 100%;
  border-top-color: var(--gold);
  border-bottom-color: var(--gold);
  animation: spin-clockwise 2s linear infinite;
  opacity: 0.8;
}

.ring.middle {
  width: 75%;
  height: 75%;
  border-left-color: var(--green);
  border-right-color: var(--green);
  animation: spin-counter 1.5s linear infinite;
  opacity: 0.6;
}

.ring.inner {
  width: 50%;
  height: 50%;
  border-top-color: var(--blue);
  border-bottom-color: var(--blue);
  animation: spin-clockwise 1s linear infinite;
  opacity: 0.4;
}

.loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  animation: pulse-text 1.5s infinite;
}

.loader-subtext {
  font-size: 0.7rem;
  color: var(--text-secondary);
  max-width: 200px;
  text-align: center;
  line-height: 1.4;
}

@keyframes spin-clockwise {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin-counter {
  0% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes pulse-icon {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.85);
    opacity: 0.7;
  }
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.8rem;
  max-width: 280px;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--green);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--red);
}

@keyframes slideIn {
  from {
    transform: translateX(30px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── MACRO & NEWS SIDEBAR (RIGHT) ───────────────────────────── */
.right-sidebar {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.macro-box {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.macro-box-title {
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.macro-bias-text {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: lowercase;
}

.macro-bias-text.bullish {
  color: var(--green);
}

.macro-bias-text.bearish {
  color: var(--red);
}

.macro-bias-text.neutral {
  color: var(--text-secondary);
}

.macro-reason {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.4;
}

.news-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.news-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.news-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.news-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.news-impact-high {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--red);
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 6px;
}

.headline-card {
  padding: 12px 14px;
  border-bottom: 1px dashed var(--border);
  transition: background 0.2s;
}

.headline-card:last-child {
  border-bottom: none;
}

.headline-card:hover {
  background: var(--bg-hover);
}

.headline-source {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.headline-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  display: block;
  transition: color 0.15s;
}

.headline-link:hover {
  color: var(--blue);
}

/* ── HORIZON TABS ───────────────────────────────────────────── */
.horizon-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 0 16px 0;
}

.horizon-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.horizon-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.horizon-tab.active::before {
  opacity: 1;
}

.horizon-tab.scalp::before {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), transparent);
}

.horizon-tab.intraday::before {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), transparent);
}

.horizon-tab.swing::before {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), transparent);
}

.horizon-tab.scalp.active {
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.12);
}

.horizon-tab.intraday.active {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.12);
}

.horizon-tab.swing.active {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.12);
}

.horizon-tab.active:not(.scalp):not(.intraday):not(.swing) {
  border-color: rgba(255, 255, 255, 0.2);
}

.horizon-tab:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.horizon-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 4px;
}

.horizon-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.horizon-desc {
  font-size: 0.62rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.horizon-count {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
}

.horizon-tab.scalp.active .horizon-count {
  color: var(--gold);
  border-color: rgba(251, 191, 36, 0.3);
}

.horizon-tab.intraday.active .horizon-count {
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.3);
}

.horizon-tab.swing.active .horizon-count {
  color: var(--purple);
  border-color: rgba(167, 139, 250, 0.3);
}

/* ── HORIZON BADGE ON CARD ──────────────────────────────────── */
.horizon-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.horizon-badge.scalp {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
}

.horizon-badge.intraday {
  background: rgba(56, 189, 248, 0.15);
  color: var(--blue);
}

.horizon-badge.swing {
  background: rgba(167, 139, 250, 0.15);
  color: var(--purple);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 280px 1fr;
  }

  .right-sidebar {
    display: none;
  }

  /* Hide on small screens for now */
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .signals-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 16px;
  }
}

/* ── TRADINGVIEW OVERLAY ────────────────────────────────────── */
.tv-chart-container {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  background: var(--bg-card);
}

@media (max-width: 900px) {
  .tv-chart-container {
    height: 300px !important;
  }
}

/* ── MICRO-ANIMATIONS ─────────────────────────────────────── */
@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(2fb, 191, 36, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(2fb, 191, 36, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(2fb, 191, 36, 0);
  }
}

.animate-pulse-border {
  animation: pulse-border 2s infinite;
  border-color: var(--gold) !important;
}

@keyframes slide-in-fade {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast {
  animation: slide-in-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* ── HORIZON TOGGLE SWITCH ──────────────────────────────────── */
.horizon-toggle {
  position: absolute;
  left: 8px;
  top: 8px;
  transform: none;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: rgba(100, 116, 139, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  z-index: 10;
}

.horizon-toggle.on {
  background: rgba(34, 197, 94, 0.45);
  border-color: rgba(34, 197, 94, 0.5);
}

.horizon-toggle:hover {
  filter: brightness(1.25);
}

.toggle-knob {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.8);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s;
  flex-shrink: 0;
}

.horizon-toggle.on .toggle-knob {
  transform: translateX(16px);
  background: var(--green);
}

/* disabled tab styling */
.horizon-tab.horizon-disabled {
  opacity: 0.52;
  filter: grayscale(0.4);
}

.horizon-tab.horizon-disabled .horizon-label,
.horizon-tab.horizon-disabled .horizon-desc {
  color: var(--text-secondary);
}

/* extra left padding on tab so toggle doesn't overlap text */
.horizon-tab.scalp,
.horizon-tab.intraday,
.horizon-tab.swing {
  padding-left: 52px;
}

/* ── RESPONSIVE DESIGN (TABLET & MOBILE) ─────────────────────── */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 280px 1fr;
  }

  .sidebar {
    grid-column: 1 / 2;
  }

  .content-area {
    grid-column: 2 / 3;
    padding: 20px;
  }

  /* Shrink tradingview chart to fit better on tablet */
  .tradingview-widget-container,
  #tradingview_xau {
    height: 400px !important;
  }

  /* Two column signal cards */
  .signals-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Make sure news panel wraps or flows under content */
  .news-panel {
    display: none;
    /* Hide heavy sidebar on tablet unless expanded/collapsible implemented */
  }
}

/* ─── Floating Draggable Sessions Panel ───────────────────── */
.floating-session-panel {
  position: fixed;
  z-index: 9000;
  width: 860px;
  background: rgba(13, 17, 23, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: visible;
  user-select: none;
}

.session-drag-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: grab;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(59, 130, 246, 0.08));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px 14px 0 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.session-drag-handle:active {
  cursor: grabbing;
}

.tz-select-inline {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.float-hour-axis {
  display: flex;
  padding: 6px 20px 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* (keep old .session-widget for any legacy uses) */
.session-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.session-header {
  display: flex;
  align-items: flex-end;
  padding: 16px 20px 8px 0;
  border-bottom: 1px solid var(--border);
}

.timezone-select {
  width: 180px;
  min-width: 180px;
  padding-left: 20px;
  padding-bottom: 0;
}

.timezone-select select {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.hour-axis {
  display: flex;
  width: 100%;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.hour-axis span {
  width: 24px;
  text-align: center;
  position: relative;
}

.hour-axis span::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 1px;
  height: 4px;
  background: var(--border);
}

.session-grid {
  position: relative;
  padding: 50px 20px 0 0;
  /* session-info flex item provides the 180px offset naturally */
  overflow: visible;
}

.grid-lines {
  position: absolute;
  top: 0;
  left: 180px;
  right: 20px;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1;
}

.grid-line {
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
}

/* Inset overlay that spans only the timeline bars area (after the info column) */
.timeline-overlay {
  position: absolute;
  left: 180px;
  right: 20px;
  top: 0;
  bottom: 0;
  pointer-events: none;
  overflow: visible;
}

.current-time-line {
  position: absolute;
  top: -15px;
  bottom: 0;
  width: 2px;
  background: #a855f7;
  /* Purple */
  z-index: 20;
  pointer-events: none;
  transition: left 1s linear;
}

.time-bubble {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: #a855f7;
  color: #fff;
  padding: 6px 12px;
  border-radius: 12px 12px 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
  white-space: nowrap;
}

.time-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  border-left: 8px solid #a855f7;
  border-bottom: 8px solid transparent;
}

.bubble-icon {
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.bubble-time {
  font-size: 0.85rem;
  font-weight: 800;
}

.bubble-day {
  font-size: 0.6rem;
  opacity: 0.9;
  text-transform: uppercase;
}

.session-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 70px;
  position: relative;
}

.session-row:last-child {
  border-bottom: none;
}

.session-info {
  width: 180px;
  min-width: 180px;
  display: flex;
  align-items: center;
  padding-left: 20px;
  gap: 12px;
  background: var(--bg-card);
  z-index: 5;
  position: relative;
}

.session-flag {
  font-size: 1.5rem;
  background: var(--bg-card2);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.session-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.session-local-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.session-utc-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.session-timeline {
  flex: 1;
  position: relative;
  background: rgba(255, 255, 255, 0.01);
}

.session-status {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--text-secondary);
  z-index: 2;
}

.session-status.open {
  color: var(--green);
}

.session-bar {
  position: absolute;
  top: 25px;
  height: 24px;
  border-radius: 4px;
  z-index: 3;
  transition: left 0.5s, width 0.5s;
}

.session-bar.closed {
  opacity: 0.3;
  filter: grayscale(1);
}

.session-bar.sydney {
  background: #3b82f6;
}

/* Blue */
.session-bar.tokyo {
  background: #d946ef;
}

/* Fuchsia/Purple */
.session-bar.london {
  background: #0ea5e9;
}

/* Sky Blue */
.session-bar.ny {
  background: #22c55e;
}

/* Green */

.volume-section {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  gap: 20px;
  align-items: center;
}

.volume-title {
  width: 140px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.volume-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-card2);
}

.vol-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.volume-badge.high .vol-dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.volume-badge.medium .vol-dot {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.volume-badge.low .vol-dot {
  background: var(--text-secondary);
}

.volume-chart {
  flex: 1;
  height: 60px;
  position: relative;
  opacity: 0.8;
}

@media (max-width: 768px) {

  /* Stack everything vertically on mobile */
  .app-wrapper {
    display: flex;
    flex-direction: column;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 10px;
    gap: 10px;
    justify-content: center;
    position: relative;
    /* Unstick from top on mobile to save space */
  }

  .topbar-brand {
    width: 100%;
    justify-content: center;
    text-align: center;
    margin-bottom: 5px;
  }

  /* Hide live ticker metadata on navbar to save vertical space */
  .topbar-right span {
    display: none;
  }

  .main-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow-y: visible;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    max-height: none;
    /* remove auto overflow constraints */
    order: 2;
    /* Content goes above sidebar stats for immediate signal view */
  }

  /* Shift content above sidebar on mobile */
  .content-area {
    order: 1;
    padding: 14px;
  }

  .signals-grid,
  div[style*="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))"] {
    display: flex;
    flex-direction: column;
  }

  /* Reduce padding on signal cards for mobile */
  .signal-card {
    padding: 14px;
  }

  /* Allow Horizon Tabs to Scroll on X-axis */
  .horizon-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    /* space for scroll bar */
  }

  /* Compress price grid on mobile */
  .price-grid {
    grid-template-columns: repeat(3, 1fr);
    font-size: 0.8rem;
  }

  .price-value {
    font-size: 0.75rem;
  }

  /* Make TradingView very compact */
  .tradingview-widget-container,
  #tradingview_xau {
    height: 320px !important;
    min-height: 320px !important;
  }
}

/* ── Closed Signal Indicators ─────────────────────────────────── */

/* Win card — green left border glow */
.signal-card.card-win {
  border-color: rgba(34, 197, 94, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12), inset 2px 0 0 rgba(34, 197, 94, 0.6);
}

/* Loss card — red left border glow */
.signal-card.card-loss {
  border-color: rgba(239, 68, 68, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12), inset 2px 0 0 rgba(239, 68, 68, 0.6);
}

/* Closed cards — dim slightly so they feel "done" */
.signal-card.card-closed-dim {
  opacity: 0.72;
  transition: opacity 0.2s;
}

.signal-card.card-closed-dim:hover {
  opacity: 1;
}

/* ── Result Banner ─────────────────────────────────────────────── */
.result-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  margin: 8px 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-banner.result-win {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.result-banner.result-loss {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.result-icon {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.result-label {
  flex: 1;
}

.result-r {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0;
}