/* CashNaija Ceremony - Premium Interactive Canvas Style System */

/* Reset & Viewport Constraints (Locked fixed positioning to prevent iOS elastic bounce scroll) */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
}

/* Ambient Radial Micro-glow background for luxury projector look */
body.bg-cnBgLight, #mobile-viewport.bg-cnBgLight {
  background: radial-gradient(circle at 50% 32%, #FAFCFC 0%, #EFF3F1 100%) !important;
}

* {
  box-sizing: border-box;
}

#mobile-viewport {
  height: 100vh !important;
  height: 100dvh !important;
}

/* Safe Area Environment Adjustments for iOS Notch & Bottom Gesture Indicator */
#demographic-container {
  top: calc(1.25rem + env(safe-area-inset-top, 0px)) !important;
}

#bottom-panel {
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
}

@media (min-width: 768px) {
  #mobile-viewport {
    height: min(820px, 90vh) !important;
    width: calc(min(820px, 90vh) * 420 / 820) !important;
  }
}

::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CDD7D2;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #A6AEAA;
}

/* West Africa SVG Map Layer Styling */
.otherCountries {
  fill: #F5F7F6;
  stroke: #E6EAE8;
  stroke-width: 0.8;
  opacity: 0.8;
  transition: all 1000ms ease;
}

/* Nigeria is ALWAYS highlighted in theme green to maintain its protagonist status */
.country {
  fill: #EAFCF5;
  stroke: #BCE5D6;
  stroke-width: 0.9;
  transition: all 1000ms ease;
}

/* When map is active (disbursement running), make the country glow or turn slightly richer green */
.map-active .country {
  fill: #DFFDF1;
  stroke: #07BA77;
  stroke-width: 1.0;
}

.lake {
  fill: #E0EFFF;
  stroke: #CBD9E8;
  stroke-width: 0.8;
}

.coastline {
  fill: none;
  stroke: #CBD4D0;
  stroke-width: 1.0;
}

.iBoundaries {
  fill: none;
  stroke: #CBD3D0;
  stroke-width: 0.8;
}

[id="10m_admin_0_boundary_lines_land.109"],
[id="10m_admin_0_boundary_lines_land.226"],
[id="10m_admin_0_boundary_lines_land.125"],
[id="10m_admin_0_boundary_lines_land.225"],
[id="nigeria-coastline-red"] {
  stroke: #FF494B;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.rBoundaries {
  fill: none;
  stroke: #CBD3D0;
  stroke-width: 0.6;
}

/* Faint rivers to prevent map clutter */
.river1, .river2, .river3 {
  display: none;
}

/* Static connecting routes on the map */
.map-path {
  transition: all 800ms ease;
}

.map-path.flow-active {
  stroke: #07BA77;
  stroke-width: 2.0;
  stroke-dasharray: 4 4;
  opacity: 1;
  animation: routeFlowPulse 20s linear infinite;
}

/* Dynamic capital connection paths in Stage 2 */
.connection-line {
  stroke: #A6AEAA;
  stroke-dasharray: 4 4;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  transition: all 600ms ease;
}

.connection-line.active {
  stroke: #07BA77;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  opacity: 1 !important;
  stroke-dasharray: 8 6;
  animation: activeCapitalFlow 5s linear infinite;
}

/* State-specific hub node flashes */
.city-node {
  transition: all 600ms ease;
}

.city-node.expansion-active {
  opacity: 1 !important;
}

.city-node.expansion-active circle {
  fill: #07BA77;
  filter: drop-shadow(0 0 4px rgba(7, 186, 119, 0.4));
}

.city-node.expansion-active text {
  fill: #122C1F;
  font-weight: bold;
}

/* Stage 2 Borrower card styles */
.user-card {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(205, 215, 210, 0.6) !important;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.user-card:hover {
  border-color: #07BA77 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(18, 44, 31, 0.05) !important;
}

.user-card.selected {
  border-color: #07BA77 !important;
  background: rgba(7, 186, 119, 0.08) !important;
  box-shadow: 0 4px 15px rgba(7, 186, 119, 0.12) !important;
}

.user-card.disbursed {
  background: rgba(244, 246, 245, 0.5) !important;
  border-color: rgba(230, 234, 232, 0.6) !important;
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* Keyframes animations */
@keyframes routeFlowPulse {
  to {
    stroke-dashoffset: -200px;
  }
}

@keyframes activeCapitalFlow {
  to {
    stroke-dashoffset: -100px;
  }
}

.lagos-glow-pulse-custom {
  animation: lagosGlowCustom 3s ease-in-out infinite alternate;
}

@keyframes lagosGlowCustom {
  0% {
    r: 12px;
    opacity: 0.35;
  }
  100% {
    r: 22px;
    opacity: 0.65;
  }
}

/* Incorrect Password Shake Animation */
.shake-anim {
  animation: shake 0.45s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-6px); }
  30%, 60%, 90% { transform: translateX(6px); }
}

/* Tactile Dialer Buttons active scaling */
.keypad-btn {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.keypad-btn:active {
  background-color: #EAFCF5 !important;
  border-color: #07BA77 !important;
  transform: scale(0.92);
}

/* Radar ripple animations for nodes */
.ripple-ring {
  transform-origin: center;
  pointer-events: none;
}
.ripple-active #ripple-lagos-1,
.ripple-active #ripple-abuja-1,
.ripple-active #ripple-ibadan-1 {
  animation: rippleWave 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
.ripple-active #ripple-lagos-2,
.ripple-active #ripple-abuja-2,
.ripple-active #ripple-ibadan-2 {
  animation: rippleWave 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) 0.4s forwards;
}

@keyframes rippleWave {
  0% {
    r: 6px;
    opacity: 1;
    stroke-width: 3px;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    r: 50px;
    opacity: 0;
    stroke-width: 0.5px;
  }
}

/* Stage 4 Nationwide States Loop & Highlight Styles */
.country.state-highlight {
  fill: rgba(52, 211, 153, 0.88) !important; /* Lighter glowing mint green (#34D399) */
  stroke: #34D399 !important;
  stroke-width: 1.5 !important;
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.6)) drop-shadow(0 0 3px rgba(52, 211, 153, 0.3));
  transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#nigeria-svg.stage4-active .city-node,
#nigeria-svg.stage4-active .map-path,
#nigeria-svg.stage4-active .connection-line {
  opacity: 0 !important;
  pointer-events: none;
  transition: all 800ms ease !important;
}

/* Floating Card Dashed Green Border Flow Styles */
.card-border-flow {
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  x: 1px;
  y: 1px;
  rx: 15px; /* Matches rounded-2xl border radius */
  ry: 15px;
  fill: none;
  stroke: #07BA77;
  stroke-width: 2px; /* Matches connection-line.active exactly */
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 8 6; /* Matches connection-line.active exactly */
  animation: cardBorderFlow 5s linear infinite; /* Matches activeCapitalFlow speed */
  filter: drop-shadow(0 0 4px rgba(7, 186, 119, 0.4));
}

@keyframes cardBorderFlow {
  to {
    stroke-dashoffset: 100px;
  }
}

/* Stage 1 Sleeping Heartbeat Radar Ripple on Lagos */
.sleeping-ripple {
  animation: sleepingRippleAnimation 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes sleepingRippleAnimation {
  0% {
    r: 6px;
    opacity: 0.45;
    stroke: #878F8B; /* Starts grey */
    stroke-width: 1.5px;
  }
  50% {
    opacity: 0.2;
    stroke: #07BA77; /* Subtle green glow midway */
    stroke-width: 1.2px;
  }
  100% {
    r: 35px;
    opacity: 0;
    stroke: #07BA77;
    stroke-width: 0.5px;
  }
}

/* Stage 1 Passcode Empty Dots: Slow Micro-Prompt Pulse on the First Dot Only */
.pin-dot-first-prompt {
  animation: firstDotPrompt 1.5s ease-in-out infinite alternate;
}

@keyframes firstDotPrompt {
  0% {
    border-color: rgba(166, 174, 170, 0.6); /* Standard gray */
    box-shadow: none;
  }
  100% {
    border-color: #07BA77; /* Brand theme green */
    box-shadow: 0 0 5px rgba(7, 186, 119, 0.2);
  }
}

/* Premium Glassmorphism Card Style with Forest Green Ambient Shadow & Apple-style Inner Gloss Border */
.premium-glass-card {
  background-color: rgba(255, 255, 255, 0.65) !important; /* 65% opacity for bottom panel stability */
  backdrop-filter: blur(24px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  box-shadow: 0 12px 40px -10px rgba(18, 44, 31, 0.15), 
              0 0 1px 1px rgba(255, 255, 255, 0.65) inset !important;
}

/* Floating Shard Glassmorphism Card (More transparent for open map view) */
.floating-glass-card {
  background-color: rgba(255, 255, 255, 0.45) !important; /* 45% opacity for open view */
  backdrop-filter: blur(18px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 12px 35px -10px rgba(18, 44, 31, 0.12), 
              0 0 1px 1px rgba(255, 255, 255, 0.7) inset !important;
}

/* Enhanced contrast text rules for glass readability */
.text-cnGrayDark {
  color: #2E453A !important;
}
.text-cnGrayLight {
  color: #4C5E55 !important;
}

/* Glassmorphism Keypad buttons - Removed shadows to prevent double-floating overlay effect */
.keypad-btn {
  background-color: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(230, 234, 232, 0.8) !important;
  color: #122C1F !important;
  font-weight: 800 !important;
  box-shadow: none !important;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.keypad-btn:hover {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: #07BA77 !important;
}

.keypad-btn:active {
  background-color: #07BA77 !important;
  border-color: #07BA77 !important;
  color: #ffffff !important;
  transform: scale(0.92) !important;
  box-shadow: none !important;
}
