/* Technical indicators overview — page-scoped visual refinement */
body:has(#stock-grid) {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(59, 130, 246, 0.07), transparent 34rem),
    var(--bg-secondary, #0a0e17);
}

body:has(#stock-grid) main.container,
body:has(#stock-grid) > .container.my-5 {
  width: min(100% - 2.5rem, 1440px);
  max-width: 1440px;
  padding-top: clamp(1.25rem, 2.7vw, 2.25rem);
}

body:has(#stock-grid) .page-header {
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  background: linear-gradient(112deg, rgba(20, 31, 49, 0.98), rgba(17, 29, 49, 0.94));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.035);
}

body:has(#stock-grid) .page-header::after {
  content: "";
  position: absolute;
  top: -145px;
  right: 9%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.11);
  filter: blur(52px);
  pointer-events: none;
}

body:has(#stock-grid) .page-header h1 {
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  letter-spacing: -0.035em;
}

body:has(#stock-grid) .page-header .header-illustration {
  position: relative;
  z-index: 1;
}

#ticker-search-wrapper {
  margin-top: 1.5rem;
  margin-bottom: 1.15rem !important;
}

#ticker-search-wrapper > .position-relative {
  width: min(100%, 370px);
  max-width: none !important;
}

#ticker-search {
  min-height: 44px;
  padding-left: 2.55rem !important;
  border-radius: 10px;
  background: rgba(21, 32, 51, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

#ticker-search:focus {
  border-color: rgba(0, 232, 157, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(0, 232, 157, 0.1);
}

#stock-grid {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 0.2rem;
}

#stock-grid > [class*="col-"] {
  display: flex;
  min-width: 0;
}

#stock-grid .indicator-card {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 132px;
  height: calc(100% - 1rem);
  margin-bottom: 1rem;
  overflow: hidden;
  border: 1px solid rgba(110, 139, 173, 0.2);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(21, 31, 49, 0.98), rgba(17, 27, 43, 0.98));
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.13), inset 0 1px rgba(255, 255, 255, 0.025);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#stock-grid .indicator-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(0, 232, 157, 0), rgba(0, 232, 157, 0.52), rgba(0, 232, 157, 0));
  opacity: 0;
  transition: opacity 180ms ease;
}

#stock-grid .indicator-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 232, 157, 0.36);
  background: linear-gradient(145deg, rgba(24, 38, 57, 0.99), rgba(18, 31, 47, 0.99));
  box-shadow: 0 15px 32px rgba(0, 0, 0, 0.24), 0 0 22px rgba(0, 232, 157, 0.055);
}

#stock-grid .indicator-card:hover::before,
#stock-grid .indicator-card:focus-visible::before { opacity: 1; }

#stock-grid .indicator-card:focus-visible {
  outline: 2px solid rgba(0, 232, 157, 0.65);
  outline-offset: 3px;
}

#stock-grid .indicator-card .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.05rem 0.85rem;
}

#stock-grid .indicator-card .card-body > .d-flex:first-child {
  min-height: 68px;
  align-items: center !important;
  gap: 0.5rem;
  margin-bottom: 0 !important;
}

#stock-grid .stock-symbol {
  min-width: 0;
  gap: 0.55rem;
  color: #edf4fb;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

#stock-grid .stock-symbol .stock-logo {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-right: 0 !important;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: #f8fafc;
  object-fit: contain;
}

#stock-grid .best-indicator-badge {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 58px;
  justify-content: flex-end;
}

#stock-grid .indicator-result {
  align-items: flex-end;
  gap: 0.2rem;
  padding: 0.35rem 0;
  text-align: right;
}

#stock-grid .indicator-name {
  max-width: 124px;
  color: #9bacc0;
  font-size: 0.65rem;
  letter-spacing: 0.075em;
  line-height: 1.25;
}

#stock-grid .indicator-return {
  gap: 0.25rem;
  font-size: 1.18rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

#stock-grid .indicator-return.success { color: #34d399; }
#stock-grid .indicator-return.danger { color: #fb7185; }
#stock-grid .indicator-return i { font-size: 0.82rem; }

#stock-grid .indicator-label {
  color: #718198;
  font-size: 0.57rem;
  letter-spacing: 0.11em;
}

#stock-grid .indicator-card .card-body > .d-flex:last-child {
  min-height: 28px;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.11);
}

#stock-grid .indicator-card .card-body > .d-flex:last-child small {
  color: #8697ac !important;
  font-size: 0.73rem;
}

#stock-grid .indicator-card .bi-arrow-right {
  display: inline-block;
  color: #73849a !important;
  font-size: 0.88rem;
  transition: transform 180ms ease, color 180ms ease;
}

#stock-grid .indicator-card:hover .bi-arrow-right {
  color: #34d399 !important;
  transform: translateX(3px);
}

@media (max-width: 575px) {
  body:has(#stock-grid) > .container.my-5 { width: calc(100% - 1.25rem); }
  #stock-grid { --bs-gutter-x: 0.7rem; }
  #stock-grid .indicator-card { min-height: 124px; }
  #stock-grid .indicator-card .card-body { padding: 0.85rem 0.8rem 0.75rem; }
  #stock-grid .stock-symbol { font-size: 0.98rem; }
  #stock-grid .stock-symbol .stock-logo { flex-basis: 28px; width: 28px; height: 28px; }
  #stock-grid .best-indicator-badge { min-width: 78px; }
  #stock-grid .indicator-name { max-width: 96px; font-size: 0.59rem; }
  #stock-grid .indicator-return { font-size: 1.04rem; }
}

@media (prefers-reduced-motion: reduce) {
  #stock-grid .indicator-card,
  #stock-grid .indicator-card::before,
  #stock-grid .indicator-card .bi-arrow-right { transition: none; }
  #stock-grid .indicator-card:hover { transform: none; }
}
