/* ==========================================================================
   DLS FUTURE FUNDS | Core Design System & Styling
   Fintech & Trading Typography Guidelines Applied
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Dynamic Theme Tokens (Light & Dark Mode CSS Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Font Family & Typography Scale */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --font-xs: 12px;
  --font-sm: 13px;
  --font-md: 14px;
  --font-lg: 16px;
  --font-xl: 18px;
  --font-2xl: 20px;
  --font-3xl: 24px;
  --font-4xl: 32px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --line-tight: 1.2;
  --line-normal: 1.5;
  --line-relaxed: 1.7;

  /* Text Color Hierarchy (Light Theme) */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-disabled: #9CA3AF;

  /* Executive Day Operations (Light Mode Defaults) */
  --bg-rgb: 255, 255, 255;
  --surface-rgb: 255, 255, 255;
  --surface-dim-rgb: 248, 250, 252;
  --surface-bright-rgb: 241, 245, 249;
  --surface-container-lowest-rgb: 255, 255, 255;
  --surface-container-low-rgb: 248, 250, 252;
  --surface-container-rgb: 241, 245, 249;
  --surface-container-high-rgb: 226, 232, 240;
  --surface-container-highest-rgb: 203, 213, 225;
  --on-surface-rgb: 17, 24, 39;
  --on-surface-variant-rgb: 75, 85, 99;
  --outline-rgb: 148, 163, 184;
  --outline-variant-rgb: 226, 232, 240;
  --inverse-surface-rgb: 17, 24, 39;
  --inverse-on-surface-rgb: 248, 250, 252;
  --secondary-rgb: 0, 83, 219;
  --tertiary-rgb: 8, 145, 178;
}

html.dark {
  /* Text Color Hierarchy (Dark Theme) */
  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-tertiary: #9CA3AF;
  --text-disabled: #6B7280;

  /* Night Operations Mode (Default Sovereign Ledger) */
  --bg-rgb: 13, 19, 31;
  --surface-rgb: 13, 19, 31;
  --surface-dim-rgb: 13, 19, 31;
  --surface-bright-rgb: 51, 57, 70;
  --surface-container-lowest-rgb: 8, 14, 25;
  --surface-container-low-rgb: 22, 28, 39;
  --surface-container-rgb: 26, 32, 43;
  --surface-container-high-rgb: 36, 42, 54;
  --surface-container-highest-rgb: 47, 53, 65;
  --on-surface-rgb: 249, 250, 251;
  --on-surface-variant-rgb: 209, 213, 219;
  --outline-rgb: 134, 148, 138;
  --outline-variant-rgb: 60, 74, 66;
  --inverse-surface-rgb: 249, 250, 251;
  --inverse-on-surface-rgb: 42, 48, 61;
  --secondary-rgb: 180, 197, 255;
  --tertiary-rgb: 76, 215, 246;
}

/* --------------------------------------------------------------------------
   2. Base & Reset Rules with Typography Guidelines
   -------------------------------------------------------------------------- */
html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family) !important;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive Headings & Letter Spacing Hierarchy */
h1 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.25;
}

/* Global SVG Safety Reset - Guarantees SVGs never blow up unconstrained */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: 100%;
}
svg:not([class*="w-"]):not([width]) {
  width: 1.25rem;
  height: 1.25rem;
}

h3 {
  letter-spacing: -0.01em;
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  letter-spacing: -0.005em;
  font-weight: 600;
  line-height: 1.4;
}

/* Small uppercase labels */
.font-label-tag {
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   2.1 Financial & Trading Tabular Numbers
   -------------------------------------------------------------------------- */
.numeric,
.tabular-nums,
[data-numeric="true"],
.font-label-numeric-md,
.font-label-numeric-lg {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.symbol {
  font-size: 14px;
  font-weight: 600;
}

.price {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.change {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

body {
  overscroll-behavior: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

main> :first-child {
  margin-top: 0 !important;
}

main> :last-child {
  margin-bottom: 0 !important;
}

::-webkit-scrollbar {
  display: none;
}

html {
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   3. Custom Component & Utility Styles
   -------------------------------------------------------------------------- */

/* Action Button Gradient (#652cb1 -> #3f6feb) */
.btn-action-gradient {
  background: linear-gradient(135deg, #652cb1 0%, #3f6feb 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(101, 44, 177, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action-gradient:hover {
  background: linear-gradient(135deg, #7535ca 0%, #4f7df5 100%) !important;
  box-shadow: 0 6px 26px rgba(101, 44, 177, 0.55);
  transform: translateY(-2px);
}

/* Brand Gradient Text (Company Name Theme: #652cb1 -> #3f6feb) */
.brand-gradient-text {
  background: linear-gradient(135deg, #652cb1 0%, #3f6feb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  width: fit-content;
  max-width: 100%;
}

html.dark .brand-gradient-text {
  background: linear-gradient(135deg, #b388ff 0%, #82b1ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Dark mode primary contrast adaptation */
html.dark .text-primary {
  color: #7986cb !important;
}

html.dark .bg-primary\/10 {
  background-color: rgba(121, 134, 203, 0.15) !important;
}

html.dark .bg-primary\/20 {
  background-color: rgba(121, 134, 203, 0.25) !important;
}

/* TradingView Ticker Tape Section & Scale */
#tradingview-ticker-section {
  background-color: #ffffff;
  border: none !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

html.dark #tradingview-ticker-section {
  background-color: #131722 !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

#tradingview-ticker-container {
  transform: scale(1.15);
  transform-origin: center center;
  width: calc(100% / 1.15);
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   4. Interactive Products Master-Detail Showcase Styles
   -------------------------------------------------------------------------- */
.product-item-card {
  will-change: transform, box-shadow, border-color;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-item-card.is-active {
  border-color: #1A237E !important;
  box-shadow: 0 4px 18px rgba(26, 35, 126, 0.16);
  transform: translateY(-1px);
}

html.dark .product-item-card.is-active {
  border-color: #7986CB !important;
  box-shadow: 0 4px 20px rgba(121, 134, 203, 0.22);
}

.product-item-card:hover:not(.is-active) {
  border-color: rgba(148, 163, 184, 0.45) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.product-item-card.is-active .active-arrow {
  opacity: 1 !important;
  transform: translateX(2px);
}

.product-item-card:not(.is-active) .active-arrow {
  opacity: 0 !important;
}

.product-item-card:hover:not(.is-active) .active-arrow {
  opacity: 0.6 !important;
  transform: translateX(2px);
}

/* Smooth transition for details container */
#product-details-container {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.details-transitioning {
  opacity: 0.35;
  transform: translateY(6px);
}

/* Real-Time Price Flash Effects */
.price-flash-up {
  color: #10b981 !important;
  transition: color 0.25s ease;
}

.price-flash-down {
  color: #f43f5e !important;
  transition: color 0.25s ease;
}

/* Custom scrollspy link hover transitions */
.nav-link {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   5. Market News & Wisdom Quote Cards Styles
   -------------------------------------------------------------------------- */
.wisdom-quote-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(var(--outline-rgb), 0.15);
}

.wisdom-quote-card:hover {
  transform: translateY(-3px);
  border-color: rgba(101, 44, 177, 0.4);
  box-shadow: 0 12px 30px -8px rgba(101, 44, 177, 0.18);
}

html.dark .wisdom-quote-card:hover {
  border-color: rgba(121, 134, 203, 0.5);
  box-shadow: 0 12px 30px -8px rgba(121, 134, 203, 0.22);
}

.wisdom-slider-card {
  min-width: 290px;
  width: 290px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .wisdom-slider-card {
    min-width: 315px;
    width: 315px;
  }
}

@media (min-width: 1024px) {
  .wisdom-slider-card {
    min-width: calc((100% - 3 * 1rem) / 4);
    width: calc((100% - 3 * 1rem) / 4);
  }
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}

.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tradingview-widget-box {
  min-height: 460px;
  overflow: hidden;
  border-radius: 0.75rem;
}

/* --------------------------------------------------------------------------
   6. Single-Page Tab Viewport System Styles
   -------------------------------------------------------------------------- */
.tab-pane {
  display: none !important;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  min-height: calc(100vh - 5rem);
}

.tab-pane.active {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start !important;
  align-items: stretch;
  opacity: 1;
  transform: translateY(0);
}