/* ===================================================================
   NEXORA 4D — Next-Gen Multipurpose Frosted Glass Theme
   Built with HTML5, CSS3, Bootstrap 5 & Vanilla JavaScript
   Features: 3D/4D Scroll-Driven Animation & Spatial Parallax
   =================================================================== */

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

:root {
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Frosted Glass Color System */
  --bg-dark: #05050a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-hover: rgba(255, 255, 255, 0.25);
  
  --primary-purple: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --scroll-progress: 0%;
}

[data-bs-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-hover: rgba(139, 92, 246, 0.3);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  perspective: 1200px;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* ===================================================================
   3D / 4D Scroll Progress Bar (Top Luminous Neon Tracker)
   =================================================================== */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #a855f7 0%, #3b82f6 50%, #06b6d4 100%);
  z-index: 1060;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.8), 0 0 8px rgba(6, 182, 212, 0.6);
  pointer-events: none;
  transition: width 0.08s linear;
  will-change: width;
}

/* Ambient Frosted Background Orbs (4D Parallax Spatial Depth) */
.bg-ambient-lights {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.35;
  animation: floatOrb 12s ease-in-out infinite alternate;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.orb-1 {
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #581c87 0%, #1e1b4b 70%, transparent 100%);
}

.orb-2 {
  bottom: -10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #1e3a8a 0%, #0c4a6e 70%, transparent 100%);
  animation-delay: -4s;
}

.orb-3 {
  top: 45%;
  left: 25%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #4338ca 0%, transparent 70%);
  opacity: 0.2;
  animation-delay: -8s;
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(-30px) scale(1.08) rotate(3deg); }
  100% { transform: translateY(20px) scale(0.95) rotate(-3deg); }
}

/* Canvas Particle Grid Background */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ===================================================================
   3D / 4D Scroll-Driven Reveal & Spatial Depth Classes
   =================================================================== */
.perspective-container {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.scroll-reveal-3d {
  opacity: 0;
  transform: perspective(1200px) rotateX(18deg) translateY(50px) scale(0.94) translateZ(-30px);
  transform-origin: center bottom;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal-3d.is-visible {
  opacity: 1;
  transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1) translateZ(0);
}

.scroll-reveal-left-3d {
  opacity: 0;
  transform: perspective(1200px) rotateY(-20deg) translateX(-50px) scale(0.92);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal-left-3d.is-visible {
  opacity: 1;
  transform: perspective(1200px) rotateY(0deg) translateX(0) scale(1);
}

.scroll-reveal-right-3d {
  opacity: 0;
  transform: perspective(1200px) rotateY(20deg) translateX(50px) scale(0.92);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal-right-3d.is-visible {
  opacity: 1;
  transform: perspective(1200px) rotateY(0deg) translateX(0) scale(1);
}

.scroll-reveal-zoom-3d {
  opacity: 0;
  transform: perspective(1200px) scale(0.85) translateZ(-80px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-reveal-zoom-3d.is-visible {
  opacity: 1;
  transform: perspective(1200px) scale(1) translateZ(0);
}

/* Stagger Delays for Cascade Scroll Entrances */
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }

/* Dynamic 3D Center-Viewport Elevation Reactor */
.scroll-depth-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

.scroll-depth-card.depth-active {
  transform: perspective(1000px) translateZ(15px) scale(1.02);
  border-color: rgba(168, 85, 247, 0.4) !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 35px rgba(139, 92, 246, 0.22) !important;
}

/* 4D Spatial Floating Badge */
.floating-4d-badge {
  animation: float4DBadge 6s ease-in-out infinite alternate;
  transform-style: preserve-3d;
}

@keyframes float4DBadge {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translateY(-8px) rotateX(6deg) rotateY(-6deg); }
  100% { transform: translateY(4px) rotateX(-4deg) rotateY(4deg); }
}

/* Parallax Depth Helper Layers */
.parallax-layer-slow {
  will-change: transform;
}
.parallax-layer-fast {
  will-change: transform;
}

/* Frosted Glass Utilities */
.frosted-glass {
  background: var(--bg-card) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid var(--border-glass) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.frosted-glass:hover {
  border-color: var(--border-glass-hover) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 30px rgba(139, 92, 246, 0.15) !important;
}

.frosted-glass-subtle {
  background: rgba(255, 255, 255, 0.025) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.frosted-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(139, 92, 246, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #c084fc 0%, #60a5fa 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-purple {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation Bar */
.navbar-nexora {
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-glass);
  padding: 1rem 0;
  transition: all 0.3s ease;
  z-index: 1030;
}

.navbar-nexora.scrolled {
  padding: 0.75rem 0;
  background: rgba(5, 5, 10, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.15);
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #a855f7, #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.nav-link {
  color: #cbd5e1 !important;
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-menu-glass {
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  padding: 0.75rem;
}

.dropdown-menu-glass .dropdown-item {
  color: #94a3b8;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.dropdown-menu-glass .dropdown-item:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

/* Custom Buttons */
.btn-nexora-primary {
  background: #7c3aed;
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.8rem 1.75rem;
  border: none;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nexora-primary:hover {
  background: #6d28d9;
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.6);
  transform: translateY(-2px);
}

.btn-nexora-white {
  background: #ffffff;
  color: #000000 !important;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.65rem 1.6rem;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.btn-nexora-white:hover {
  background: #e2e8f0;
  transform: scale(1.03);
}

.btn-nexora-glass {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 0.8rem 1.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nexora-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* 3D Tilt Card Effects (Hardware Accelerated) */
.tilt-card-wrapper {
  perspective: 1000px;
}

.tilt-card {
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Top Marketplace Bar */
.marketplace-topbar {
  background: rgba(5, 5, 10, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  padding: 0.4rem 0;
  z-index: 1040;
}

/* Section Spacing */
.section-py {
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
  position: relative;
  z-index: 1;
}

/* Code & Spec Box */
.terminal-card {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  font-family: var(--font-mono);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Footer */
.footer-nexora {
  background: rgba(5, 5, 10, 0.9);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-glass);
  padding-top: 4.5rem;
  padding-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.footer-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #c084fc;
}

/* Global Command Palette Modal */
.command-palette-modal .modal-content {
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(5, 5, 10, 0.9);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Floating 3D Back-to-Top Button with Circular SVG Progress Ring */
.btn-scroll-top-3d {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c084fc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.3);
}

.btn-scroll-top-3d.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.btn-scroll-top-3d:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: rgba(168, 85, 247, 0.6);
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(139, 92, 246, 0.5);
}

.btn-scroll-top-3d svg.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.btn-scroll-top-3d svg.progress-ring circle {
  fill: none;
  stroke: #a855f7;
  stroke-width: 2.5;
  stroke-dasharray: 138;
  stroke-dashoffset: 138;
  transition: stroke-dashoffset 0.1s linear;
}

/* Modern Image Cards & Zoom Effects */
.img-zoom-wrapper {
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}

.img-zoom-wrapper img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-zoom-wrapper:hover img {
  transform: scale(1.06);
}

.img-glass-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 5, 10, 0.88) 100%);
  pointer-events: none;
}

/* Author & Buyer Badge */
.author-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.author-pill:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.6);
}

.buyer-license-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.buyer-license-card:hover, .buyer-license-card.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
}

.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #05050a;
  margin-left: -10px;
}

.avatar-group img:first-child {
  margin-left: 0;
}

/* Modern Image Cards & Zoom Effects */
.img-zoom-wrapper {
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}

.img-zoom-wrapper img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-zoom-wrapper:hover img {
  transform: scale(1.06);
}

.img-glass-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 5, 10, 0.88) 100%);
  pointer-events: none;
}

/* Author & Buyer Badge */
.author-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.author-pill:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.6);
}

.buyer-license-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.buyer-license-card:hover, .buyer-license-card.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
}

.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #05050a;
  margin-left: -10px;
}

.avatar-group img:first-child {
  margin-left: 0;
}

