/* ==========================================================================
   PBD AGENCY — APPLE-GRADE DESIGN SYSTEM & CUSTOM ANIMATIONS
   Colors: Obsidian (#09090B), Crimson Red (#DC2626 / #EF4444), Crisp White
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-obsidian: #09090B;
  --bg-surface: #111114;
  --bg-card: rgba(18, 18, 24, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(220, 38, 38, 0.35);
  --red-primary: #DC2626;
  --red-bright: #EF4444;
  --red-glow: rgba(220, 38, 38, 0.35);
  --red-subtle: rgba(220, 38, 38, 0.12);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  overflow-x: hidden;
  selection-background-color: var(--red-primary);
  selection-color: #ffffff;
}

::selection {
  background: var(--red-primary);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #09090B;
}
::-webkit-scrollbar-thumb {
  background: #27272A;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #DC2626;
}

/* Ambient Cursor Spotlight Glow */
#spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.10) 0%, rgba(220, 38, 38, 0.02) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Glassmorphism Card System (Clean, Rock-Solid, Zero Tilt) */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  pointer-events: none;
  z-index: 2;
}

.glass-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px -8px rgba(220, 38, 38, 0.2);
}

/* Magnetic Interaction Physics (Buttons) */
.magnetic-btn {
  display: inline-flex;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

/* Tabular Numbers for Animated Metric Counters */
.counter-num {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* Number Pulse Animation */
@keyframes numberPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); text-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1); }
}

.value-pulsing {
  animation: numberPulse 0.25s ease-out;
}

/* Premium Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, #FFFFFF 20%, #CBD5E1 70%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-red {
  background: linear-gradient(135deg, #FFFFFF 10%, #F87171 50%, #DC2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glowing Primary Button */
.btn-primary {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 60%, #B91C1C 100%);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px -2px rgba(220, 38, 38, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: all 0.6s ease;
}

.btn-primary:hover::after {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px 2px rgba(220, 38, 38, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #F8FAFC;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Pulsing Status Dot */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #FCA5A5;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #EF4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #EF4444;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Range Slider Styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #27272A;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #EF4444;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  border: 2px solid #FFFFFF;
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.9);
}

/* Dropdown Menu Styling */
.currency-select-container {
  position: relative;
}

.searchable-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  z-index: 50;
  display: none;
  backdrop-filter: blur(20px);
}

.searchable-dropdown.open {
  display: block;
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.dropdown-item:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #FFFFFF;
}

.dropdown-item.active {
  background: rgba(220, 38, 38, 0.25);
  color: #F87171;
  font-weight: 600;
}

/* Custom Select & Option Styling */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

select option {
  background-color: #141418;
  color: #F8FAFC;
  padding: 10px;
}

#appCountrySelect {
  padding-right: 64px !important;
  background-position: right 10px center;
}

/* ==========================================================================
   THEME TOGGLE BUTTON STYLING (Apple-Grade Glassmorphic Pill)
   ========================================================================== */
.theme-toggle-btn {
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.theme-toggle-btn:hover {
  border-color: rgba(220, 38, 38, 0.6);
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   LIGHT MODE THEME INVERSION ENGINE
   Inverts Black to White & White to Black. Red Colors & Logo Unchanged.
   ========================================================================== */
html.light-mode {
  color-scheme: light;
  --bg-obsidian: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.95);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(220, 38, 38, 0.4);
  --text-main: #0F172A;
  --text-muted: #475569;
}

html.light-mode body {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
}

/* Navbar */
html.light-mode header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04) !important;
}

html.light-mode header nav a {
  color: #475569 !important;
}

html.light-mode header nav a:hover {
  color: #DC2626 !important;
}

/* Theme Toggle Button in Light Mode */
html.light-mode .theme-toggle-btn {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0F172A !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

html.light-mode .theme-toggle-btn:hover {
  border-color: rgba(220, 38, 38, 0.6) !important;
  box-shadow: 0 4px 18px rgba(220, 38, 38, 0.2) !important;
}

html.light-mode #themeToggleText {
  color: #0F172A !important;
}

/* Typography Inversions (White to Black) */
html.light-mode .text-white {
  color: #0F172A !important;
}

html.light-mode .text-slate-100 {
  color: #0F172A !important;
}

html.light-mode .text-slate-200 {
  color: #1E293B !important;
}

html.light-mode .text-slate-300 {
  color: #334155 !important;
}

html.light-mode .text-slate-400 {
  color: #475569 !important;
}

html.light-mode .text-slate-500 {
  color: #64748B !important;
}

/* Gradient Headlines in Light Mode */
html.light-mode .text-gradient {
  background: linear-gradient(135deg, #0F172A 20%, #1E293B 70%, #475569 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

html.light-mode .text-gradient-red {
  background: linear-gradient(135deg, #7F1D1D 0%, #DC2626 50%, #EF4444 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Glassmorphic Cards (Obsidian to Crisp White) */
html.light-mode .glass-card {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.05) !important;
}

html.light-mode .glass-card::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent) !important;
}

html.light-mode .glass-card:hover {
  border-color: rgba(220, 38, 38, 0.35) !important;
  box-shadow: 0 14px 36px -8px rgba(220, 38, 38, 0.12) !important;
}

/* Background Inversions for Dark Blocks and Surfaces */
html.light-mode .bg-\[\#09090B\],
html.light-mode .bg-\[\#111114\],
html.light-mode .bg-\[\#121216\]\/90,
html.light-mode .bg-\[\#141418\],
html.light-mode .bg-\[\#16161C\],
html.light-mode .bg-black\/40 {
  background-color: #F8FAFC !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Borders */
html.light-mode .border-white\/10,
html.light-mode .border-white\/15,
html.light-mode .border-white\/\[0\.08\],
html.light-mode .border-white\/\[0\.06\] {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Form Fields & Interactive Inputs */
html.light-mode input[type="text"],
html.light-mode input[type="tel"],
html.light-mode select {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

html.light-mode input[type="text"]::placeholder,
html.light-mode input[type="tel"]::placeholder {
  color: #94A3B8 !important;
}

html.light-mode input[type="text"]:focus,
html.light-mode input[type="tel"]:focus,
html.light-mode select:focus {
  border-color: #DC2626 !important;
  background-color: #FFFFFF !important;
}

html.light-mode select option {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
}

/* Dropdown Menu In Light Mode */
html.light-mode .searchable-dropdown {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12) !important;
}

html.light-mode .searchable-dropdown > div.sticky {
  background: #FFFFFF !important;
  border-bottom-color: #E2E8F0 !important;
}

html.light-mode #currencySearchInput {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

html.light-mode .dropdown-item {
  color: #0F172A !important;
}

html.light-mode .dropdown-item:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #DC2626 !important;
}

html.light-mode .dropdown-item.active {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #DC2626 !important;
}

/* Secondary Button In Light Mode */
html.light-mode .btn-secondary {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0F172A !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

html.light-mode .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(220, 38, 38, 0.4) !important;
}

/* Range Slider Track In Light Mode */
html.light-mode input[type="range"] {
  background: #CBD5E1 !important;
}

/* Deep Red Trust & Info Badges In Light Mode (Crisp & High Contrast) */
html.light-mode .bg-red-950\/30,
html.light-mode .bg-red-950\/40 {
  background-color: rgba(254, 226, 226, 0.75) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #7F1D1D !important;
}

html.light-mode .bg-red-950\/30 strong,
html.light-mode .bg-red-950\/40 strong {
  color: #991B1B !important;
}

/* Section 5 Calculator: Big Recovery Banner In Light Mode */
html.light-mode .from-red-950\/60 {
  --tw-gradient-from: #FEF2F2 !important;
}

html.light-mode .to-black {
  --tw-gradient-to: #FEE2E2 !important;
}

html.light-mode #outMonthlyRecovered {
  color: #991B1B !important;
}

html.light-mode #outAnnualRecovered {
  color: #065F46 !important;
}

/* Spotlight In Light Mode */
html.light-mode #spotlight {
  background: radial-gradient(circle, rgba(220, 38, 38, 0.07) 0%, rgba(220, 38, 38, 0.01) 45%, transparent 70%) !important;
}

/* Scrollbar In Light Mode */
html.light-mode ::-webkit-scrollbar-track {
  background: #F1F5F9 !important;
}

html.light-mode ::-webkit-scrollbar-thumb {
  background: #CBD5E1 !important;
}

html.light-mode ::-webkit-scrollbar-thumb:hover {
  background: #DC2626 !important;
}

/* ==========================================================================
   MODULE 11: IN-PAGE 24/7 AUTONOMOUS SOVEREIGN REVENUE OS CHAT WIDGET
   ========================================================================== */
.pbd-chat-launcher {
  background: linear-gradient(135deg, #0F172A 0%, #0284C7 60%, #00F0FF 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 10px 30px -5px rgba(0, 240, 255, 0.35), 0 0 20px rgba(15, 23, 42, 0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.pbd-chat-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 40px -4px rgba(0, 240, 255, 0.5), 0 0 28px rgba(2, 132, 199, 0.5);
  border-color: rgba(255, 255, 255, 0.6);
}

.pbd-chat-launcher:active {
  transform: translateY(0px) scale(0.98);
}

#pbdChatTeaserBubble {
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#pbdChatTeaserBubble.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#pbdChatTeaserBubble.dismissed {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* Chat Window Transitions */
#pbdChatWindow {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#pbdChatWindow.open {
  display: flex !important;
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
  pointer-events: auto !important;
}

/* Custom Scrollbar for Chat Messages */
#pbdChatMessages::-webkit-scrollbar {
  width: 5px;
}

#pbdChatMessages::-webkit-scrollbar-track {
  background: transparent;
}

#pbdChatMessages::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 9999px;
}

#pbdChatMessages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.45);
}

/* User Message Bubble */
.pbd-user-bubble {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

/* Formatted Text in Bot Bubbles */
.pbd-bot-bubble p {
  margin-bottom: 0.5rem;
}
.pbd-bot-bubble p:last-child {
  margin-bottom: 0;
}
.pbd-bot-bubble strong {
  color: #00F0FF;
  font-weight: 700;
}
.pbd-bot-bubble ul {
  list-style-type: disc;
  margin-left: 1.25rem;
  margin-bottom: 0.5rem;
}
.pbd-bot-bubble li {
  margin-bottom: 0.25rem;
}
.pbd-bot-bubble a {
  color: #38BDF8;
  text-decoration: underline;
  font-weight: 600;
}
.pbd-bot-bubble a:hover {
  color: #00F0FF;
}

/* ==========================================================================
   LIGHT MODE OVERRIDES FOR WEB CHAT WIDGET
   ========================================================================== */
html.light-mode #pbdChatTeaserBubble {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.12), 0 0 20px rgba(0, 240, 255, 0.15) !important;
}

html.light-mode #pbdChatTeaserBubble .text-white {
  color: #0F172A !important;
}

html.light-mode #pbdChatTeaserBubble .text-slate-200 {
  color: #334155 !important;
}

html.light-mode #pbdChatTeaserBubble .text-slate-400 {
  color: #64748B !important;
}

html.light-mode #pbdChatTeaserBubble .pbd-teaser-chip {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  color: #1E293B !important;
}

html.light-mode #pbdChatTeaserBubble .pbd-teaser-chip:hover {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  color: #0284C7 !important;
}

html.light-mode #pbdChatWindow {
  background: rgba(255, 255, 255, 0.99) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15), 0 0 30px rgba(2, 132, 199, 0.12) !important;
}

html.light-mode .pbd-chat-header {
  background: linear-gradient(to right, #F8FAFC, #F1F5F9, #F8FAFC) !important;
  border-bottom-color: #E2E8F0 !important;
}

html.light-mode .pbd-chat-header .text-white {
  color: #0F172A !important;
}

html.light-mode #pbdChatMessages {
  background: #FFFFFF !important;
}

html.light-mode .pbd-bot-bubble {
  background: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
  color: #1E293B !important;
}

html.light-mode .pbd-bot-bubble strong {
  color: #0284C7 !important;
}

html.light-mode .pbd-chat-chip {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #0369A1 !important;
}

html.light-mode .pbd-chat-chip:hover {
  background: #E0F2FE !important;
  border-color: #38BDF8 !important;
  color: #0284C7 !important;
}

html.light-mode #pbdChatForm {
  background: #F8FAFC !important;
  border-top-color: #E2E8F0 !important;
}

html.light-mode #pbdChatInput {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

html.light-mode #pbdChatInput::placeholder {
  color: #94A3B8 !important;
}




