/* ============================================
   LEVERAGE - PREMIUM STOCK MARKET THEME
   Deep Black & High Contrast Design
   ============================================ */

/* Design tokens (:root) now live in tokens.css, loaded before this file on every page. */


/* 💀 Skeleton Loader */
@keyframes skeletonPulse {
  0% { opacity: 0.06; }
  50% { opacity: 0.2; }
  100% { opacity: 0.06; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}
.skeleton-line {
  height: 14px;
  width: 100%;
  margin-bottom: 10px;
}
.skeleton-line:last-child { width: 70%; }
.skeleton-card {
  height: 80px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-price {
  width: 80px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}
.skeleton-text-sm {
  width: 50px;
  height: 12px;
  display: inline-block;
}
.skeleton-mover-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
}
/* Mover card skeleton layout */
.skeleton-mover-row .skeleton-line {
  margin-bottom: 0;
}

/* Mover row entrance animation */
@keyframes moverSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.mover-row-enter {
  animation: moverSlideIn 0.3s ease-out both;
}
.mover-row-enter:nth-child(1) { animation-delay: 0.02s; }
.mover-row-enter:nth-child(2) { animation-delay: 0.06s; }
.mover-row-enter:nth-child(3) { animation-delay: 0.10s; }
.mover-row-enter:nth-child(4) { animation-delay: 0.14s; }
.mover-row-enter:nth-child(5) { animation-delay: 0.18s; }

/* Flash animations removed per user request */

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}


/* User dropdown, search-results dropdown styles now live only in nav.css (loaded on every
   page with this UI) — remove any duplicate .user-dropdown/.search-results block here. */

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  /* Almost opaque black */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  /* Subtle border */
  padding: 1.25rem 0;
  /* Removed horizontal padding to align with main container */
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0 2rem;
    position: relative;
}

/* Brand Logo */
.logo-container {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0px;
  /* Removed gap completely */
  text-decoration: none;
}

.brand-logo-full {
  height: 40px;
  width: auto;
  max-width: 260px;
  display: block;
  object-fit: contain;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.brand-logo-icon-only {
  display: none;
  height: 38px;
  width: 38px;
  object-fit: contain;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.logo-container:hover .brand-logo-full,
.logo-container:hover .brand-logo-icon-only {
  transform: scale(1.03);
  opacity: 0.95;
}

.logo-icon {
  height: 48px;
  width: auto;
  display: block;
  border-radius: 8px;
}

/* Brand Text Image Wrapper */
.brand-image-wrapper {
  height: 48px;
  width: auto;
  overflow: hidden;
  margin-left: 0px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-image {
  height: 100%;
  width: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.logo-container:hover .brand-image {
  transform: scale(1.05);
}

/* Search Panel */
.search-panel {
  flex: 1;
  margin: 0 24px;
  max-width: 600px;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #555;
  color: #ffffff;
  padding: 12px 16px 12px 48px;
  /* Room for icon */
  border-radius: 99px;
  /* Pill shape */
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Scrolling Placeholder Styles */
.placeholder-overlay {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: #71717a;
  white-space: nowrap;
  transition: opacity 0.2s ease, visibility 0.2s;
  z-index: 5;
}

/* Hide overlay only when input has value (placeholder is NOT shown) */
.search-input:not(:placeholder-shown)~.placeholder-overlay {
  opacity: 0;
  visibility: hidden;
}

.scrolling-wrapper {
  height: 1.4rem;
  overflow: hidden !important;
  margin-left: 5px;
  display: inline-block;
  vertical-align: middle;
}

.scrolling-content {
  display: flex;
  flex-direction: column;
  animation: scrollPlaceholder 12s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}

.scrolling-item {
  height: 1.4rem;
  line-height: 1.4rem;
  color: var(--accent-blue);
  font-weight: 700;
}

@keyframes scrollPlaceholder {
  0%, 16% { transform: translateY(0); }
  20%, 36% { transform: translateY(-1.4rem); }
  40%, 56% { transform: translateY(-2.8rem); }
  60%, 76% { transform: translateY(-4.2rem); }
  80%, 96% { transform: translateY(-5.6rem); }
  100% { transform: translateY(-7.0rem); }
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Search Results Dropdown — base .search-results/.result-item/.result-info/.result-name/
   .result-ticker/.search-launch-btn now live only in nav.css. These two are unique to
   index.js's richer search renderer (logo thumbnail + live price/change), which nav.css
   doesn't need, so they stay here. */
.result-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-right: 12px;
}

.result-meta {
  display: flex;
  align-items: center;
}

.search-launch-btn:hover {
  background: var(--accent-blue-hover);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: white;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-container {
  max-width: 1400px;
  margin: 0.5rem auto;
  /* Minimizing top margin */
  padding: 0 2rem;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.pill-indicator {
  width: 4px;
  height: 24px;
  background: var(--success);
  /* Or teal */
  margin-right: 12px;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
  /* Glow */
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

/* Market Grid */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

/* ============================================
   MARKET CARD DESIGN
   ============================================ */
.market-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem 1.5rem;
  /* Top padding larger for visual balance */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.market-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Card Header: Icon & Titles */
.card-icon {
  width: 64px;
  height: 64px;
  font-size: 2rem;
  background: #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  border: 1px solid #222;
}

.card-ticker-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.25rem;
}

.card-ticker {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.stock-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.card-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Price Section */
.card-price {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.price-change {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.price-change.positive {
  color: var(--success);
}

.price-change.negative {
  color: var(--danger);
}

.price-change.neutral {
  color: var(--text-muted);
}

/* Card Button */
.view-chart-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.view-chart-btn:hover {
  background: var(--accent-blue-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  .brand-logo-full {
    display: none !important;
  }

  .brand-logo-icon-only {
    display: block !important;
    height: 36px;
    width: 36px;
  }

  .search-panel {
    width: 100%;
    order: 2;
  }

  .nav-menu {
    gap: 1rem;
    font-size: 0.85rem;
    width: 100%;
    justify-content: space-between;
    order: 3;
  }
}

/* Image inside card icon */
/* Image inside card icon */
img.card-icon {
  object-fit: contain;
  /* Changed from cover to contain */
  background: white;
  padding: 4px;
  /* Added breathing room */
  border-radius: 50%;
  /* Ensure rounded */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  /* Glow */
}

/* Search Result Logo Image */
/* Search Result Logo Image */
.search-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  /* Changed from cover */
  background: #fff;
  border: 1px solid #333;
  padding: 2px;
  /* Added padding */
  display: block;
}

/* Ensure result-logo container fits */
.result-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

/* ============================================
   TOP 9 STOCKS TRACKER (3x3 GRID)
   ============================================ */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.tracker-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  color: white;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  text-align: left;
  /* Ensure left alignment for card info */
  position: relative;
  /* For the corner button */
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tracker-view-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 8px;
  background: var(--accent-blue);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tracker-view-btn:hover {
  background: var(--accent-blue-hover);
  color: white;
}

.tracker-symbol-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tracker-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  padding: 2px;
}

.tracker-logo-icon {
  font-size: 1.2rem;
}

.tracker-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tracker-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: #1f2937;
  border-radius: 4px;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
}

.tracker-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.tracker-symbol-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tracker-symbol {
  font-size: 1.1rem;
  font-weight: 800;
  /* Extra Bold Ticker */
  color: white;
  text-transform: uppercase;
}

.tracker-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.tracker-current-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
}

.tracker-change {
  font-size: 0.85rem;
  font-weight: 600;
}

.tracker-change.positive {
  color: var(--success);
}

.tracker-change.negative {
  color: var(--danger);
}

.tracker-open {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* Line Graph Container */
.tracker-chart-container {
  width: 100%;
  height: 160px;
  /* Increased Height */
  margin-top: 1rem;
  position: relative;
  background: #000;
  /* Graph background */
  border: 1px solid #1f2937;
  border-radius: 6px;
  overflow: visible;
}

.tracker-chart-point {
  fill: #000;
  stroke-width: 2;
}

.tracker-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tracker-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  border: 1px solid #374151;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  display: none;
  transform: translate(-50%, -120%);
  /* Position above point */
  transition: opacity 0.1s;
}

.tracker-chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tracker-grid-lines line {
  stroke: #374151;
  stroke-width: 0.5;
}

.tracker-axis-label {
  fill: #6b7280;
  font-size: 8px;
  font-family: var(--font-ui);
  font-weight: 500;
}

.tracker-axis-label.y-axis {
  text-anchor: start;
}

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

@media (max-width: 640px) {
  .tracker-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   AUTH BUTTONS
   ============================================ */
.auth-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-ui);
}

.login-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid #333;
}

.login-btn:hover {
  border-color: #666;
  background: rgba(255, 255, 255, 0.05);
}

.register-btn {
  background: var(--accent-blue);
  color: white;
}

.register-btn:hover {
  background: var(--accent-blue-hover);
}

.logout-btn {
  background: rgba(255, 82, 82, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 82, 82, 0.3);
}

.logout-btn:hover {
  background: rgba(255, 82, 82, 0.2);
}

/* User Info (logged in state) */
.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-balance {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--success);
  padding: 6px 12px;
  background: rgba(0, 200, 83, 0.1);
  border-radius: 6px;
}

.user-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   AUTH UI ENHANCEMENTS & MODALS
   ============================================ */
.input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #666666;
  pointer-events: none;
  font-size: 16px;
}

.form-input.has-icon {
  padding-left: 44px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666666;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: #ffffff;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.visible {
  display: flex;
}

.modal-content {
  background-color: #0a0a0a;
  border: 1px solid #333333;
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.btn-danger {
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  font-family: var(--font-ui);
}

.btn-danger:hover {
  background-color: #cc3333;
}

.btn-secondary {
  background-color: #1a1a1a;
  color: white;
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  font-family: var(--font-ui);
  margin-top: 12px;
}

.btn-secondary:hover {
  background-color: #2a2a2a;
}

/* ============================================
   NEWS SECTION (LIST VIEW)
   ============================================ */
.news-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.news-list-item {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.news-list-item:hover {
  transform: translateX(4px);
}

.news-list-item:last-child {
  border-bottom: none;
}

.news-item-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.news-item-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s;
}

.news-item-title:hover {
  color: var(--accent-blue);
}

.external-icon {
  color: var(--accent-blue);
  font-size: 0.8rem;
  opacity: 0.7;
}

.news-item-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.news-score-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.news-score-badge.positive { color: var(--success); border-color: rgba(8, 153, 129, 0.3); }
.news-score-badge.negative { color: var(--danger); border-color: rgba(242, 54, 69, 0.3); }

.news-sentiment-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-sentiment-badge.positive { background: rgba(8, 153, 129, 0.1); color: var(--success); }
.news-sentiment-badge.negative { background: rgba(242, 54, 69, 0.1); color: var(--danger); }
.news-sentiment-badge.neutral { background: rgba(161, 161, 170, 0.1); color: var(--text-secondary); }

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.news-item-dot {
  opacity: 0.5;
}

.news-item-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   NEW DASHBOARD STYLES
   ============================================ */
.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Index Ticker Strip */
.index-ticker-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 15, 20, 0.4);
  backdrop-filter: blur(16px);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.strip-scroll-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0; /* flex items default to min-width:auto, which blocks shrinking below content's
                   natural width and forces the page to overflow horizontally instead of this
                   container scrolling internally */
}
.strip-scroll-container::-webkit-scrollbar {
  display: none;
}
.strip-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px;
}
.strip-btn:hover {
  color: var(--text-primary);
}
.ticker-card {
  min-width: 165px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 108px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.ticker-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.ticker-card h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.ticker-card .price {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}
.ticker-card .change {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  margin-top: 4px;
  cursor: default;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.expiry-badge.expiry-today {
  background: rgba(242, 54, 69, 0.14) !important;
  color: #ff6b7a !important;
  border: 1px solid rgba(242, 54, 69, 0.28) !important;
}
.expiry-badge.expiry-tomorrow {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
}
.expiry-badge.expiry-future {
  color: var(--text-muted, #83838d) !important;
  font-size: 0.62rem !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  font-weight: 500 !important;
}

/* Hero Section (Chart + AI) */
.dashboard-hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.main-chart-container, .ai-insights-panel {
  background: rgba(15, 15, 20, 0.5);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.chart-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.chart-title-block h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.chart-price-block {
  display: flex;
  align-items: baseline;
  gap: 0;
}
.large-price {
  font-family: var(--font-mono, 'Space Grotesk', monospace);
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  line-height: 1.1;
}
.price-change {
  font-size: 1.1rem;
  font-weight: 600;
  margin-left: 12px;
  white-space: nowrap;
}
.chart-ticker-select {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 4px 28px 4px 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-ui, 'Inter', sans-serif);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  height: 32px;
  display: inline-flex;
  align-items: center;
}
.chart-ticker-select:hover,
.chart-ticker-select:focus {
  background-color: #0c0d10 !important;
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff !important;
}

/* Custom Dropdown for Minichart */
.custom-dropdown {
  position: relative;
  display: inline-block;
}
.custom-dropdown-btn {
  background-color: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-ui, 'Inter', sans-serif);
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  user-select: none;
}
.custom-dropdown-btn:hover,
.custom-dropdown-btn:focus {
  background-color: #0c0d10;
  border-color: rgba(255, 255, 255, 0.45);
}
.dropdown-chevron {
  transition: transform 0.2s ease;
  stroke: #ffffff;
}
.custom-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}
.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  min-width: 125px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 4px 0;
  overflow: hidden;
}
.custom-dropdown.open .custom-dropdown-menu {
  display: flex;
}
.custom-dropdown-item {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #d1d4dc;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.custom-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.custom-dropdown-item.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}
.chart-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   MOBILE RESPONSIVE OVERRIDES (< 900px)
   ============================================ */
@media (max-width: 900px) {
  .strip-btn {
    display: none;
  }
  .dashboard-main {
    padding: 6px 12px 16px 12px !important;
    gap: 8px !important;
  }
  .mobile-market-status-slot {
    display: flex !important;
    justify-content: flex-end !important;
    padding: 0 2px !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: auto !important;
  }
  .market-status-indicator {
    margin: 0 !important;
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
  }
  .index-ticker-strip {
    margin-right: -24px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 8px !important;
    gap: 8px !important;
  }
  .strip-scroll-container {
    margin-right: -12px;
    padding-right: 12px;
  }
  .ticker-card {
    min-width: 155px;
    min-height: 104px;
    padding: 10px 12px;
  }
  .ticker-card h4 {
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .ticker-card .price {
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .ticker-card .change {
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .dashboard-hero-section {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .main-chart-container {
    min-width: 0 !important;
    padding: 12px 14px !important;
  }
  .chart-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    width: 100% !important;
  }
  .chart-title-block {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .chart-price-block {
    order: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  .large-price {
    font-size: 1.35rem !important;
  }
  .price-change {
    font-size: 0.82rem !important;
    margin-left: 0 !important;
  }
  .custom-dropdown {
    order: 2 !important;
    flex-shrink: 0 !important;
  }
  .custom-dropdown-btn {
    padding: 2px 7px !important;
    font-size: 0.74rem !important;
    height: 24px !important;
    border-radius: 5px !important;
    gap: 4px !important;
  }
  .dropdown-chevron {
    width: 8px !important;
    height: 8px !important;
  }
  .custom-dropdown-menu {
    min-width: 105px !important;
    top: calc(100% + 3px) !important;
    border-radius: 5px !important;
    padding: 2px 0 !important;
  }
  .custom-dropdown-item {
    padding: 4px 8px !important;
    font-size: 0.72rem !important; /* Eye-friendly, perfectly proportioned mobile font */
    line-height: 1.35 !important;
  }
  .chart-actions {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .timeframe-selector {
    padding: 1px !important;
  }
  .tf-btn {
    padding: 3px 8px !important;
    font-size: 0.78rem !important;
  }
  .chart-footer-ohlc {
    flex-wrap: wrap !important;
    gap: 6px 12px !important;
    font-size: 0.78rem !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
  }
  .ai-insights-panel {
    display: none !important;
  }
}
.timeframe-selector {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 2px;
}
.tf-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
}
.tf-btn.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}
.lightweight-chart-box {
  flex: 1;
  min-height: 300px;
}
.chart-footer-ohlc {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.text-green { color: var(--success); }
.text-red { color: var(--danger); }

/* AI Insights */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-header h2 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-green {
  background: rgba(8, 153, 129, 0.15);
  color: var(--success);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.insights-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.insight-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
}
.insight-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(38, 166, 154, 0.1);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.insight-content h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.insight-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.view-all-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 16px;
  display: block;
}
.view-all-link:hover {
  color: var(--text-primary);
}

/* Market Movers */
.movers-container {
  margin-bottom: 24px;
}
.movers-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.movers-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.movers-filter-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.mover-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary, #9ca3af);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.mover-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}
.mover-tab.active {
  background: var(--accent-blue, #2962ff);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(41, 98, 255, 0.3);
}
.market-movers-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.05);
}
@media (max-width: 900px) {
  .market-movers-section {
    grid-template-columns: 1fr;
    /* The card's own background/border was stopping short of the screen edge (same as the
       scrollable list did) — bleed the whole card past .dashboard-main's 24px right padding,
       square off the right corners since they now sit flush against the edge, and shrink the
       right-side gutter so the header/"View All" link sits much closer to the edge too. */
    margin-right: -24px;
    padding-right: 16px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  /* Grid/flex items default to min-width:auto, which lets their content's natural width
     (5 non-shrinking cards side by side) stretch the column past the grid track — and past
     the viewport, forcing the WHOLE PAGE to scroll horizontally instead of just this list.
     min-width:0 is the fix: it lets .movers-column shrink to the 1fr track so .movers-list's
     own overflow-x:auto is what scrolls, not the page. */
  .movers-column {
    min-width: 0;
  }
  /* Each column (Gainers/Losers/Active) becomes a horizontally-scrollable row of compact
     cards instead of a tall vertical list — keeps all 3 sections short and contained.
     !important needed: the unconditional .movers-list/.mover-row/.mover-info-p base rules
     (defined later in this file) would otherwise win on source order at this width. */
  .movers-list {
    /* .market-movers-section now bleeds to the true edge itself (above) and keeps only a 16px
       right gutter — cancel just that remaining 16px so scrolling reaches the true edge too.
       Left edge stays aligned with the section header above it. */
    margin-right: -16px;
    padding-right: 16px;
    flex-direction: row !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .movers-list::-webkit-scrollbar {
    display: none;
  }
  .mover-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    min-width: 160px !important;
    max-width: 160px !important;
    flex-shrink: 0 !important;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    box-sizing: border-box;
    overflow: hidden; /* guard: nothing inside (e.g. a sector badge) can push the card,
                          and therefore the page, wider than this fixed size */
  }
  .mover-left,
  .mover-info {
    min-width: 0;
    width: 100%;
  }
  .mover-info h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mover-right {
    text-align: left !important;
    margin-top: 10px;
    width: 100%;
    min-width: 0;
  }
  /* Company name isn't needed in this compact card — ticker is the short name already shown. */
  .mover-info p {
    display: none !important;
  }
  .mv-change {
    font-size: 0.82rem !important;
    font-weight: 600;
    white-space: nowrap !important;
  }
  .mv-abs-change {
    font-size: 0.78rem !important;
    font-weight: 500;
    opacity: 0.85;
    white-space: nowrap !important;
  }
}
.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.column-header h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.movers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.mover-row:hover {
  background: rgba(255,255,255,0.05);
}
.mover-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mover-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
}
.mover-info h4 {
  font-size: 0.95rem;
  margin: 0;
}
.mover-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
.mover-right {
  text-align: right;
}
.mover-price {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.mover-change {
  font-size: 0.85rem;
}
.mover-prev {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.mv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.mv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}
.mv-change {
  font-size: 0.9rem;
  font-weight: 600;
}
.mv-volume {
  font-size: 0.9rem;
  font-weight: 600;
  color: #787b86;
}

/* Watchlist section */
.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.left-side {
  display: flex;
  align-items: center;
  gap: 12px;
}
.watchlist-cards-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 12px;
}
.watchlist-cards-container::-webkit-scrollbar { display: none; }
@media (max-width: 900px) {
  /* Same edge-bleed fix as .movers-list: cancel .dashboard-main's 24px right padding so
     scrolling to the end reaches near the true screen edge instead of stopping short of it. */
  .watchlist-cards-container {
    margin-right: -24px;
    padding-right: 16px;
  }
}

/* Watchlist card design */
.watchlist-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  min-width: 190px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.watchlist-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
}
.wl-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.wl-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wl-symbol {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  line-height: 1.2;
}
.wl-exchange {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wl-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
  line-height: 1.2;
}
.wl-change {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

/* News Section Full Width */
.news-section.full-width {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.05);
}
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.news-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 8px;
}
.news-row:hover {
  background: rgba(255,255,255,0.02);
}
.news-thumb {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.news-content {
  flex: 1;
}
.news-headline {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.sentiment-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.sentiment-bullish { background: rgba(8, 153, 129, 0.15); color: var(--success); }
.sentiment-bearish { background: rgba(242, 54, 69, 0.15); color: var(--danger); }
.sentiment-neutral { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }

/* Nav Links in Header */
.nav-links {
  display: flex;
  gap: 24px;
  margin-left: 32px;
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
}
.market-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  font-size: 0.85rem;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}
.pulse-dot.closed {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}
/* --- Chart Toggles --- */
.chart-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.tf-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.tf-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}
.tf-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* --- AI Sentiment Gauge --- */
.sentiment-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.gauge-svg {
  width: 100%;
  max-width: 250px;
  height: auto;
  overflow: visible;
}
.gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 12;
  stroke-linecap: round;
}
.gauge-fill {
  fill: none;
  stroke: url(#gaugeGradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * pi * r (r=45) */
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.gauge-needle {
  fill: white;
  transform-origin: 50px 50px;
  transform: rotate(-90deg);
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.sentiment-text {
  margin-top: 15px;
  text-align: center;
}
.sentiment-score-text {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}
.sentiment-label-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 5px;
}
.sentiment-label-text.bullish { color: var(--success); }
.sentiment-label-text.bearish { color: var(--danger); }
.sentiment-label-text.neutral { color: var(--text-secondary); }
.sentiment-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
  max-width: 80%;
}

/* ── Stock Page Header Polish ── */
.ticker-text-group h1 {
  letter-spacing: -0.3px;
}
#header-change {
  font-size: 15px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
#header-change.text-green {
  background: rgba(8, 153, 129, 0.1);
  color: var(--success);
}
#header-change.text-red {
  background: rgba(242, 54, 69, 0.1);
  color: var(--danger);
}
/* Live price movement tick animations */
@keyframes tickUpFlash {
  0% {
    color: #089981 !important;
    text-shadow: 0 0 10px rgba(8, 153, 129, 0.6);
    transform: scale(1.025);
  }
  40% {
    color: #089981 !important;
  }
  100% {
    color: inherit;
    text-shadow: none;
    transform: scale(1);
  }
}

@keyframes tickDownFlash {
  0% {
    color: #f23645 !important;
    text-shadow: 0 0 10px rgba(242, 54, 69, 0.6);
    transform: scale(1.025);
  }
  40% {
    color: #f23645 !important;
  }
  100% {
    color: inherit;
    text-shadow: none;
    transform: scale(1);
  }
}

.tick-up {
  display: inline-block;
  animation: tickUpFlash 0.7s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.tick-down {
  display: inline-block;
  animation: tickDownFlash 0.7s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

#ws-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}

/* Trade Panel & Positions */
.bottom-panel {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.trade-panel {
  flex: 0 0 340px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.05);
}
.trade-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.trade-panel .panel-header h2 {
  font-size: 1.1rem;
  margin: 0;
}
.available-balance {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.available-balance span {
  color: var(--success);
  font-weight: 600;
}
.trade-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trade-form .input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trade-form .input-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.trade-form .input-group input {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.trade-form .input-group input:focus {
  border-color: var(--accent-blue);
}
.trade-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 8px 0;
}
.trade-summary span {
  color: var(--text-primary);
  font-weight: 600;
}
.trade-actions {
  display: flex;
  gap: 12px;
}
.trade-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.trade-actions button:hover {
  transform: scale(1.02);
}
.btn-buy {
  background: linear-gradient(135deg, #00C853, #089981);
  color: #fff;
}
.btn-sell {
  background: linear-gradient(135deg, #FF1744, #FF5252);
  color: #fff;
}
.trade-message {
  font-size: 0.85rem;
  min-height: 20px;
}
.positions-panel {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  min-width: 0;
}
.positions-panel .panel-header {
  margin-bottom: 16px;
}
.positions-panel .panel-header h2 {
  font-size: 1.1rem;
  margin: 0;
}
.positions-table-wrapper {
  overflow-x: auto;
}
.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.positions-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.positions-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.positions-table tr:hover td {
  background: rgba(255,255,255,0.02);
}
.positions-table .type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.type-badge.long {
  background: rgba(0, 200, 83, 0.12);
  color: #089981;
}
.type-badge.short {
  background: rgba(255, 23, 68, 0.12);
  color: #FF5252;
}
.positions-table .pnl-positive {
  color: #089981;
  font-weight: 600;
}
.positions-table .pnl-negative {
  color: #FF5252;
  font-weight: 600;
}
.positions-table .action-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.positions-table .action-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.positions-table .action-btn.close-btn {
  border-color: rgba(255, 23, 68, 0.3);
  color: #FF5252;
}
.positions-table .action-btn.close-btn:hover {
  background: rgba(255, 23, 68, 0.1);
}
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Range Dropdown and Menu */
.range-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 1001;
}
.range-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 120px;
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  z-index: 999999 !important;
  display: none;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}
.range-menu.visible {
  display: block;
}
