/* ============================================================
   pnfTrading — Institutional Technical Analysis & Trading Platform
   Design System: altFINS-inspired Institutional Fintech
   Primary Palette: Slate + Mint/Teal (Brand) + Amber/Orange (CTA)
   Theme: Full Light & Dark Mode support with smooth transitions
   ============================================================ */

/* ---------- Design Tokens (Light Theme by default) ---------- */
:root {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --panel: #ffffff;
  --panel-border: rgba(15, 30, 25, 0.08);
  --panel-hover: #f1f5f9;
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(15, 30, 25, 0.08);
  --topbar-bg: #ffffff;

  --line: rgba(15, 30, 25, 0.08);
  --line-mid: rgba(15, 30, 25, 0.14);
  --line-strong: rgba(15, 30, 25, 0.24);

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

  /* Brand Colors */
  --brand: #0e9c7c;
  --brand-light: #10b981;
  --brand-bright: #22c7a0;
  --brand-dark: #0a4f3e;
  --brand-wash: rgba(14, 156, 124, 0.08);
  --brand-wash-hover: rgba(14, 156, 124, 0.14);

  /* CTAs & Accents */
  --amber: #f2661c;
  --amber-hover: #db540d;
  --amber-wash: rgba(242, 102, 28, 0.1);

  /* P&F Indicators */
  --x: #10b981; /* X column — Bullish / Up */
  --o: #ef4444; /* O column — Bearish / Down */
  --x-wash: rgba(16, 185, 129, 0.1);
  --o-wash: rgba(239, 68, 68, 0.1);

  --blue: #2563eb;
  --blue-wash: rgba(37, 99, 235, 0.1);
  --purple: #8b5cf6;
  --purple-wash: rgba(139, 92, 246, 0.1);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);

  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1240px;
  --sidebar-w: 250px;
  --topbar-h: 40px;
  --header-h: 62px;

  color-scheme: light;
}

/* ---------- Dark Theme ---------- */
body.dark-mode {
  --bg: #0b0f17;
  --bg-alt: #111827;
  --panel: #131d2e;
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-hover: #1b263b;
  --sidebar-bg: #0d1422;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --topbar-bg: #090e18;

  --line: rgba(255, 255, 255, 0.08);
  --line-mid: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.28);

  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;

  --brand: #10b981;
  --brand-bright: #34d399;
  --brand-dark: #065f46;
  --brand-wash: rgba(16, 185, 129, 0.14);
  --brand-wash-hover: rgba(16, 185, 129, 0.22);

  --panel-shadow: 0 4px 20px rgba(0,0,0,0.35);

  color-scheme: dark;
}

/* ---------- CSS Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Cố định khung ngoài, chỉ cuộn khung nội dung bên phải */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Layout Structure (altFINS App Shell) ---------- */
.shell {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  max-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  top: 0;
  left: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-content {
  flex: 1;
  height: 100vh;
  max-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-y: auto; /* Chỉ mỗi khung bên phải này cuộn khi xem nội dung */
  overflow-x: hidden;
  scroll-behavior: smooth;
  position: relative;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top Live Market Ticker Bar ---------- */
.top-ticker-bar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  height: var(--topbar-h);
  overflow: hidden;
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
  animation: ticker-marquee 45s linear infinite;
  will-change: transform;
}

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

@keyframes ticker-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-wash);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ticker-pill:hover {
  background: var(--brand-wash-hover);
  transform: translateY(-1px);
}

.ticker-sym {
  font-weight: 700;
}

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

.ticker-chg {
  font-weight: 600;
  font-size: 11px;
}

.ticker-chg.up {
  color: var(--x);
}

.ticker-chg.down {
  color: var(--o);
}

/* ---------- Top App Header / Bar ---------- */
.app-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-search {
  position: relative;
  width: 280px;
}

.header-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.header-search input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.header-search .search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-3);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2px;
}

.lang-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 14px;
  color: var(--text-2);
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--brand);
  color: #ffffff;
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--brand-wash);
  color: var(--brand);
}

/* ---------- Buttons & Badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: var(--radius);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--amber);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(242, 102, 28, 0.25);
}

.btn-primary:hover {
  background: var(--amber-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(242, 102, 28, 0.35);
}

.btn-brand {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 156, 124, 0.25);
}

.btn-brand:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--line-mid);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--panel-hover);
  border-color: var(--brand);
  color: var(--brand);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.badge-bullish {
  background: var(--x-wash);
  color: var(--x);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-bearish {
  background: var(--o-wash);
  color: var(--o);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-neutral {
  background: var(--blue-wash);
  color: var(--blue);
}

.badge-vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

/* ---------- Left Sidebar Navigation (altFINS Style) ---------- */
.sidebar-header {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.sidebar-collapse-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-collapse-btn:hover {
  background: var(--brand-wash);
  color: var(--brand);
  border-color: var(--brand);
}

.sidebar-collapse-btn svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0e9c7c, #22c7a0);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  padding: 12px 10px 6px;
  transition: opacity 0.2s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.nav-item:hover svg {
  color: var(--brand);
}

.nav-item.active {
  background: var(--brand-wash);
  color: var(--brand);
  font-weight: 600;
}

.nav-item.active svg {
  color: var(--brand);
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 600;
}

/* Collapsed Sidebar Mode */
.sidebar.collapsed {
  width: 68px;
}

.sidebar.collapsed .sidebar-header {
  padding: 20px 8px 16px;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.sidebar.collapsed .brand-text {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 1px;
  padding: 0;
  margin: 6px 6px;
  background: var(--line);
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  padding: 10px 0;
  justify-content: center;
}

.sidebar.collapsed .nav-item span {
  display: none;
}

.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar.collapsed .vip-promo-box {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 8px;
}

.sidebar.collapsed .sidebar-footer .btn-brand {
  padding: 10px 0;
  width: 100%;
  justify-content: center;
}

.sidebar.collapsed .sidebar-footer .btn-brand span {
  display: none;
}

/* Floating tooltip when sidebar is collapsed */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: fixed;
  left: 76px;
  background: var(--text);
  color: var(--bg);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  animation: fadeIn 0.15s ease;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-collapse-btn {
    display: none;
  }
  .mobile-only {
    display: flex;
  }
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vip-promo-box {
  background: linear-gradient(135deg, rgba(14, 156, 124, 0.1), rgba(34, 199, 160, 0.15));
  border: 1px solid rgba(14, 156, 124, 0.2);
  border-radius: var(--radius);
  padding: 12px;
}

.vip-promo-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 6px;
}

.vip-promo-desc {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

/* Mobile Sidebar Trigger & Bar */
.mobile-top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.burger-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 45;
}

/* ---------- Typography & Section Headers ---------- */
.sec-head {
  margin-bottom: 24px;
}

.sec-head.center {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand);
  margin-bottom: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-bright);
  box-shadow: 0 0 0 3px rgba(34, 199, 160, 0.25);
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 199, 160, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 199, 160, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 199, 160, 0); }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: clamp(30px, 4.5vw, 46px);
  letter-spacing: -0.5px;
}

h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.3px;
}

h3 {
  font-size: 18px;
}

p.lede {
  font-size: clamp(15px, 1.8vw, 17px);
  color: var(--text-2);
  margin-top: 12px;
  max-width: 680px;
}

/* ---------- Hero Section (altFINS Institutional Hub) ---------- */
.hero-section {
  padding: 28px 0 36px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}

.hero-content h1 span {
  display: block;
}

.hero-content h1 em {
  font-style: normal;
  color: var(--brand);
}

.hero-stats-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.hero-stat-item b {
  font-size: 22px;
  font-family: var(--font-mono);
  color: var(--text);
  display: block;
}

.hero-stat-item span {
  font-size: 12px;
  color: var(--text-3);
}

.hero-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

/* ---------- Hero Tabbed Interactive Widget (altFINS Terminal Preview) ---------- */
.hero-widget {
  background: var(--panel);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.widget-tabs-header {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 4px 6px;
  gap: 4px;
  overflow-x: auto;
}

.widget-tab-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.widget-tab-btn:hover {
  color: var(--text);
  background: var(--panel);
}

.widget-tab-btn.active {
  background: var(--panel);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.widget-body {
  padding: 16px;
  min-height: 380px;
}

.widget-tab-pane {
  display: none;
}

.widget-tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Widget: Live Signals List */
.signal-mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.15s ease;
  cursor: pointer;
}

.signal-mini-card:hover {
  border-color: var(--brand);
  transform: translateX(2px);
  background: var(--panel-hover);
}

.signal-sym-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signal-sym-wrap strong {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

.signal-pattern-name {
  font-size: 12px;
  color: var(--text-2);
}

.signal-target-gain {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--x);
}

/* ---------- Market Overview & Sentiment Pulse (`#overview`) ---------- */
.section-pad {
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}

.market-pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.pulse-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pulse-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pulse-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pulse-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.pulse-trend {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Sentiment Bar */
.sentiment-bar-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 30px;
}

.sentiment-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

.sentiment-meter {
  height: 12px;
  background: var(--o);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.sentiment-fill {
  height: 100%;
  background: var(--x);
  border-radius: 6px 0 0 6px;
  transition: width 0.6s ease;
}

/* ---------- Automated P&F Chart Patterns (`#patterns`) (altFINS AI Patterns) ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--brand);
}

.filter-btn.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.patterns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.pattern-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pattern-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pattern-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pattern-ticker {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.pattern-market-tag {
  font-size: 11px;
  color: var(--text-3);
}

.pattern-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.pattern-metrics-table {
  width: 100%;
  margin-bottom: 16px;
  font-size: 12px;
}

.pattern-metrics-table tr {
  border-bottom: 1px solid var(--line);
}

.pattern-metrics-table td {
  padding: 6px 0;
  color: var(--text-2);
}

.pattern-metrics-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.pattern-target-val {
  color: var(--x) !important;
}

/* ---------- Curated Trade Setups Hub (`#setups`) (altFINS Trade Ideas) ---------- */
.trade-setups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.setup-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.setup-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.setup-card-top {
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--panel) 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setup-sym-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-sym-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
}

.setup-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.setup-strategy-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.setup-key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}

.setup-key-item span {
  font-size: 11px;
  color: var(--text-3);
  display: block;
}

.setup-key-item b {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--text);
}

.setup-key-item.target b {
  color: var(--x);
}

.setup-key-item.sl b {
  color: var(--o);
}

.setup-card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}

.setup-rr-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
}

/* ---------- Multi-Market PnF Screener (`#screener`) ---------- */
.screener-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.screener-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
}

.screener-select {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
}

.screener-table-wrap {
  overflow-x: auto;
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.screener-table th {
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line-mid);
  color: var(--text-3);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.screener-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}

.screener-table tbody tr {
  transition: background 0.15s ease;
}

.screener-table tbody tr:hover {
  background: var(--panel-hover);
}

.screener-sym {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ---------- Interactive P&F Lab (`#lab`) ---------- */
.lab-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.lab-controls-pane {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lab-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lab-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.lab-slider-label b {
  font-family: var(--font-mono);
  color: var(--brand);
}

.lab-slider-input {
  width: 100%;
  accent-color: var(--brand);
  cursor: pointer;
}

.lab-metrics-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lab-metrics-item span {
  font-size: 11px;
  color: var(--text-3);
  display: block;
}

.lab-metrics-item b {
  font-size: 18px;
  font-family: var(--font-mono);
  color: var(--text);
}

.lab-chart-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lab-pane-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.lab-pane-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.lab-pane-head b {
  font-family: var(--font-mono);
  color: var(--brand);
}

.lab-svg-wrap {
  flex: 1;
  min-height: 280px;
}

/* ---------- PnF Academy & Education Hub (`#academy`) ---------- */
.academy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.academy-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.academy-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.academy-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 16px;
}

.academy-card h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

.academy-card p {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 18px;
}

/* ---------- Pricing Plans Matrix (`#pricing`) ---------- */
.pricing-cycle-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 4px 6px;
  border-radius: 30px;
  margin-bottom: 36px;
}

.cycle-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  color: var(--text-2);
  transition: all 0.2s ease;
}

.cycle-btn.active {
  background: var(--brand);
  color: #ffffff;
}

.cycle-discount-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--x-wash);
  color: var(--x);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.pricing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 8px 30px rgba(14, 156, 124, 0.12);
}

.featured-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  border-radius: 12px;
}

.pricing-card-top h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.pricing-amount {
  font-size: 34px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  margin: 16px 0;
}

.pricing-amount small {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-3);
}

.pricing-features-list {
  list-style: none;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.pricing-features-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.pricing-features-list li.check svg {
  color: var(--x);
  flex-shrink: 0;
}

.pricing-features-list li.cross {
  color: var(--text-3);
  text-decoration: line-through;
}

.pricing-features-list li.cross svg {
  color: var(--text-3);
  flex-shrink: 0;
}

/* ---------- FAQ Accordion (`#faq`) ---------- */
.faq-wrap {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-family: var(--font-mono);
  color: var(--text-3);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 20px 20px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ---------- Modal Dialog ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 80vh;
}

.modal-close-btn {
  font-size: 20px;
  color: var(--text-3);
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text);
}

/* ---------- Institutional Footer ---------- */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 60px 0 30px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about p {
  color: var(--text-2);
  margin-top: 12px;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  color: var(--text-2);
  transition: color 0.15s ease;
}

.footer-col ul a:hover {
  color: var(--brand);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .lab-container {
    grid-template-columns: 1fr;
  }
  .plans-grid {
    grid-template-columns: 1fr;
  }
  .market-pulse-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
  }
  .shell {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .main-content {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .mobile-top-bar {
    display: flex;
  }
  .header-search {
    display: none;
  }
  .lab-chart-panes {
    grid-template-columns: 1fr;
  }
  .market-pulse-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
