:root {
  --background: #1B3C53;
  --foreground: #D2C1B6;
  --card: #234C6A;
  --card-foreground: #F5EFEA;
  --primary: #D2C1B6;
  --primary-foreground: #1B3C53;
  --secondary: #234C6A;
  --secondary-foreground: #D2C1B6;
  --muted: #456882;
  --muted-foreground: #D2C1B6;
  --accent: #D2C1B6;
  --accent-foreground: #1B3C53;
  --border: rgba(69, 104, 130, 0.45);
  --input: #234C6A;
  --ring: #D2C1B6;
  --radius: 0.75rem;
  --bg-pattern: rgba(210, 193, 182, 0.08);
  --market-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23D2C1B6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 40 h50 M30 55 h50 M30 40 c25 0, 35 12, 22 25 M30 40 c25 15, 10 30, -5 45 M45 68 l 25 35' stroke-width='2' opacity='0.4'/%3E%3Cpath d='M20 180 h160 M20 20 v160' stroke-width='1' opacity='0.3' stroke-dasharray='3 3'/%3E%3Cpath d='M20 160 Q 50 140, 70 110 T 120 90 T 150 50 T 180 30' stroke-width='3'/%3E%3Cpath d='M180 30 l 3 -8 l 3 8 l 8 3 l -8 3 l -3 8 l -3 -8 l -8 -3 z' fill='%23D2C1B6' stroke='none'/%3E%3Cpath d='M60 120 v-30 M60 110 h6 v10 h-6 z' opacity='0.6'/%3E%3Cpath d='M100 100 v-40 M100 80 h6 v20 h-6 z' opacity='0.6' fill='%23D2C1B6'/%3E%3Cpath d='M140 70 v-45 M140 55 h6 v15 h-6 z' opacity='0.6'/%3E%3C/svg%3E");
}

html.light, body.light, .light {
  --background: #faf6ea;
  --foreground: #030805;
  --card: #f4ebd4;
  --card-foreground: #030805;
  --primary: #030805;
  --primary-foreground: #faf6ea;
  --secondary: #e7dfc7;
  --secondary-foreground: #030805;
  --muted: #e7dfc7;
  --muted-foreground: #0c2b18;
  --accent: #d4af37;
  --accent-foreground: #030805;
  --border: rgba(3, 8, 5, 0.12);
  --input: #e7dfc7;
  --ring: #030805;
  --bg-pattern: rgba(3, 8, 5, 0.08);
  --market-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%230c2b18' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M30 40 h50 M30 55 h50 M30 40 c25 0, 35 12, 22 25 M30 40 c25 15, 10 30, -5 45 M45 68 l 25 35' stroke-width='2' opacity='0.4'/%3E%3Cpath d='M20 180 h160 M20 20 v160' stroke-width='1' opacity='0.3' stroke-dasharray='3 3'/%3E%3Cpath d='M20 160 Q 50 140, 70 110 T 120 90 T 150 50 T 180 30' stroke-width='3'/%3E%3Cpath d='M180 30 l 3 -8 l 3 8 l 8 3 l -8 3 l -3 8 l -3 -8 l -8 -3 z' fill='%230c2b18' stroke='none'/%3E%3Cpath d='M60 120 v-30 M60 110 h6 v10 h-6 z' opacity='0.6'/%3E%3Cpath d='M100 100 v-40 M100 80 h6 v20 h-6 z' opacity='0.6' fill='%230c2b18'/%3E%3Cpath d='M140 70 v-45 M140 55 h6 v15 h-6 z' opacity='0.6'/%3E%3C/svg%3E");
}

body {
  background-color: var(--background);
  background-image: radial-gradient(var(--bg-pattern) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--foreground);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

.brand-watermark {
  background-image: url("/images/logo-horizontal.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.05;
}

.market-watermark {
  color: var(--primary);
  opacity: 0.08;
}

.light .brand-watermark,
html.light .brand-watermark {
  opacity: 0.08;
}

.light .market-watermark,
html.light .market-watermark {
  color: var(--muted-foreground);
  opacity: 0.12;
}

.bg-background:not(body):not(nav):not(header):not([class*="w-72"]):not([class*="bg-background/"]) {
  background-color: transparent !important;
}

.glass-panel {
  background: rgba(35, 76, 106, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(69, 104, 130, 0.45);
  border-radius: var(--radius);
  color: #D2C1B6;
}

.glass-panel-hover {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-hover:hover {
  background: rgba(35, 76, 106, 0.95);
  border-color: #D2C1B6;
  box-shadow: 0 10px 30px rgba(15, 33, 46, 0.5), 0 0 20px rgba(210, 193, 182, 0.15);
  transform: translateY(-4px);
}

.text-gold {
  color: #D2C1B6 !important;
}

.text-gold-gradient {
  background: linear-gradient(135deg, #FFFFFF 0%, #D2C1B6 50%, #B8A598 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-gold-gradient {
  background: linear-gradient(135deg, #E6D8CF 0%, #D2C1B6 50%, #B8A598 100%);
  color: #1B3C53 !important;
}

.bg-gold-gradient-hover:hover {
  background: linear-gradient(135deg, #fff 0%, #e5c158 50%, #af8b36 100%);
}

::selection {
  background-color: rgba(212, 175, 55, 0.3);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: 3s;
}

/* ==========================================================================
   DAY / LIGHT THEME OVERRIDES FOR HARDCODED UTILITIES
   ========================================================================== */
.light {
  background-color: var(--background);
  color: var(--foreground);
}

.light .bg-\[\#030805\] {
  background-color: var(--background) !important;
}

.light .bg-\[\#08100c\] {
  background-color: var(--card) !important;
}
.light .bg-\[\#050f0a\] {
  background-color: var(--muted) !important;
}
.light .bg-\[\#0a1f14\] {
  background-color: var(--secondary) !important;
}
.light .bg-\[\#06140e\] {
  background-color: var(--secondary) !important;
}
.light .bg-\[\#081810\] {
  background-color: var(--card) !important;
}
.light .bg-\[\#040e09\] {
  background-color: var(--muted) !important;
}
.light .bg-\[\#05110a\] {
  background-color: var(--muted) !important;
}
.light .bg-\[\#0a2316\] {
  background-color: var(--card) !important;
}

.light .text-white {
  color: var(--foreground) !important;
}
.light .text-\[\#d4af37\] {
  color: #9b7617 !important;
}
.light .text-gold {
  color: #9b7617 !important;
}
.light .text-\[\#a8d0b9\] {
  color: var(--muted-foreground) !important;
}
.light .text-\[\#f2f9f5\] {
  color: var(--foreground) !important;
}
.light .text-\[\#a8d0b9\]\/90 {
  color: var(--muted-foreground) !important;
  opacity: 0.9 !important;
}
.light .text-\[\#a8d0b9\]\/85 {
  color: var(--muted-foreground) !important;
  opacity: 0.85 !important;
}
.light .text-\[\#a8d0b9\]\/80 {
  color: var(--muted-foreground) !important;
  opacity: 0.8 !important;
}
.light .text-\[\#a8d0b9\]\/75 {
  color: var(--muted-foreground) !important;
  opacity: 0.75 !important;
}
.light .text-\[\#a8d0b9\]\/70 {
  color: var(--muted-foreground) !important;
  opacity: 0.7 !important;
}
.light .text-\[\#a8d0b9\]\/65 {
  color: var(--muted-foreground) !important;
  opacity: 0.65 !important;
}
.light .text-\[\#a8d0b9\]\/60 {
  color: var(--muted-foreground) !important;
  opacity: 0.6 !important;
}

.light .border-\[\#d4af37\]\/10,
.light .border-\[\#d4af37\]\/15,
.light .border-\[\#d4af37\]\/20,
.light .border-\[\#d4af37\]\/25,
.light .border-\[\#d4af37\]\/30,
.light .border-\[\#d4af37\]\/35 {
  border-color: var(--border) !important;
}
.light .border-white\/5 {
  border-color: var(--border) !important;
}

.light .glass-panel {
  background: var(--card) !important;
  border-color: var(--border) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.light .glass-panel-hover:hover {
  background: var(--secondary) !important;
  border-color: var(--border) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.light .text-gold-gradient {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  color: var(--foreground) !important;
}

.light input, .light select, .light textarea {
  background-color: var(--background) !important;
  border-color: var(--border) !important;
  color: var(--foreground) !important;
}
.light input:focus, .light select:focus, .light textarea:focus {
  border-color: var(--foreground) !important;
}

.light .bg-\[\#d4af37\]\/5,
.light .bg-\[\#0a2f1a\]\/10,
.light .bg-\[\#0a2f1a\]\/15,
.light .bg-\[\#d4af37\]\/30 {
  opacity: 0.1 !important;
}

.light .bg-gold-gradient {
  background: linear-gradient(135deg, #ebd18c 0%, #c49e29 50%, #9c7b28 100%) !important;
}
.light .bg-gold-gradient text,
.light .bg-gold-gradient span {
  color: #030805 !important;
}

.light .filter.brightness-100.invert-0 {
  filter: brightness(0) saturate(100%) invert(3%) sepia(16%) saturate(1469%) hue-rotate(97deg) brightness(97%) contrast(97%) !important;
}

.light .bg-\[\#050e09\] {
  background-color: var(--muted) !important;
}
.light .bg-\[\#0b140f\] {
  background-color: var(--card) !important;
}
.light .bg-\[\#081b11\] {
  background-color: var(--secondary) !important;
}
.light .bg-\[\#0a2f1a\]\/10,
.light .bg-\[\#0a2f1a\]\/15,
.light .bg-\[\#0a2f1a\] {
  opacity: 0.1 !important;
}
.light .text-\[\#8aa899\] {
  color: var(--muted-foreground) !important;
}
.light .text-\[\#e5c158\] {
  color: var(--foreground) !important;
}

.light [class*="text-[#a8d0b9]"] {
  color: var(--muted-foreground) !important;
  opacity: 1 !important;
}
.light [class*="text-[#d4af37]"] {
  color: #9b7617 !important;
  opacity: 1 !important;
}
.light [class*="text-[#f2f9f5]"] {
  color: var(--foreground) !important;
  opacity: 1 !important;
}
.light [class*="text-[#e5c158]"] {
  color: var(--foreground) !important;
  opacity: 1 !important;
}
.light [class*="text-[#8aa899]"] {
  color: var(--muted-foreground) !important;
  opacity: 1 !important;
}

/* Financial Dashboard Blue + White + Green Styling variables */
.financial-dashboard {
  --primary-blue: #0f172a;
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --neutral-white: #ffffff;
}

/* Contrast and legibility fixes for input fields in dark/light modes */
.form-control, .form-select, .form-control:focus, .form-select:focus {
  background-color: #0a1f14 !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  color: #f2f9f5 !important;
}
.form-control::placeholder {
  color: rgba(168, 208, 185, 0.5) !important;
}
select option {
  background-color: #08100c !important;
  color: #f2f9f5 !important;
}
body:not(.light) .text-muted {
  color: #a8d0b9 !important;
  opacity: 0.75;
}

.light .form-control, .light .form-select, .light .form-control:focus, .light .form-select:focus {
  background-color: #faf6ea !important;
  border: 1px solid rgba(3, 8, 5, 0.2) !important;
  color: #030805 !important;
}
.light .form-control::placeholder {
  color: rgba(12, 43, 24, 0.6) !important;
}
.light select option {
  background-color: #faf6ea !important;
  color: #030805 !important;
}

/* Footer theme-adaptive styling */
footer {
  background-color: #030805 !important;
  border-top: 1px solid rgba(212, 175, 55, 0.15) !important;
  position: relative !important;
  z-index: 99999 !important; /* Force footer above all overlays */
}
footer,
footer p,
footer span,
footer li,
footer div {
  color: #a8d0b9 !important;
}
footer a {
  color: #a8d0b9 !important;
  position: relative !important;
  z-index: 100000 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  display: inline-block !important;
}
footer a:hover {
  color: #d4af37 !important;
}
footer h3,
footer h1,
footer h2,
footer h4,
footer .text-white {
  color: #ffffff !important;
}
footer .text-gold {
  color: #d4af37 !important;
}
footer hr {
  border-color: rgba(212, 175, 55, 0.15) !important;
}
footer .bg-\[\#08100c\] {
  background-color: #08100c !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
}
footer .bg-\[\#050f0a\] {
  background-color: #050f0a !important;
  border-color: rgba(212, 175, 55, 0.15) !important;
}
footer .bg-\[\#0a1f14\] {
  background-color: #0a1f14 !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
}
footer .btn {
  background-color: #0a1f14 !important;
  color: #d4af37 !important;
}
footer .btn:hover {
  background-color: #d4af37 !important;
  color: #030805 !important;
}

/* Light mode footer overrides */
.light footer {
  background-color: #faf6ea !important;
  border-top: 1px solid rgba(3, 8, 5, 0.1) !important;
}
.light footer,
.light footer a,
.light footer p,
.light footer span,
.light footer li,
.light footer div {
  color: #0c2b18 !important;
}
.light footer a:hover {
  color: #9b7617 !important;
}
.light footer h3,
.light footer h1,
.light footer h2,
.light footer h4,
.light footer .text-white {
  color: #030805 !important;
}
.light footer .text-gold {
  color: #9b7617 !important;
}
.light footer .bg-\[\#08100c\] {
  background-color: var(--card) !important;
  border-color: rgba(3, 8, 5, 0.1) !important;
}
.light footer .bg-\[\#050f0a\] {
  background-color: var(--muted) !important;
  border-color: rgba(3, 8, 5, 0.1) !important;
}
.light footer .bg-\[\#0a1f14\] {
  background-color: var(--secondary) !important;
  border-color: rgba(3, 8, 5, 0.1) !important;
}
.light footer .btn {
  background-color: var(--secondary) !important;
  color: #9b7617 !important;
}
.light footer .btn:hover {
  background-color: #9b7617 !important;
  color: #faf6ea !important;
}

/* Specificity overrides for header nav links in dark and light modes */
/* Navigation bar dynamic scroll styling for Day/Night themes */
#main-nav {
  padding-top: 12px;
  padding-bottom: 12px;
  transition: all 0.3s ease;
}

/* SVG Vector Animations */
@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pulse {
  0% {
    r: 6px;
    opacity: 1;
    stroke-width: 1px;
    stroke: rgba(212, 175, 55, 0.8);
  }
  100% {
    r: 16px;
    opacity: 0;
    stroke-width: 4px;
    stroke: rgba(212, 175, 55, 0);
  }
}
.pulse-glow {
  transform-origin: center;
  stroke: rgba(212, 175, 55, 0.4);
  stroke-width: 2px;
}

/* Fix Bootstrap Modal backdrop and header overlap bugs */
.modal {
  z-index: 100005 !important;
}
.modal-backdrop {
  z-index: 100001 !important;
}
