/* ==========================================================================
   APK0X SECURITY HUB — BESPOKE SWISS CYBER MOTION & ARCHITECTURAL SYSTEM
   Inspired by International Typographic Style (Notiune) & Cyber Intelligence
   ========================================================================== */

:root {
  --bg:          #FAF9F5;
  --bg-alt:      #F2EFEB;
  --panel:       #FFFFFF;
  --panel-warm:  #F5F3ED;
  --line:        #E2DDD2;
  --line-soft:   #ECE8DF;
  --ink:         #111111;
  --ink-light:   #34312B;
  --muted:       #6B6559;
  --muted-2:     #968E7E;
  --burgundy:    #111111;
  --burgundy-soft:#2E2E2E;
  --burgundy-bg: #EAE6DC;
  --gold:        #7D621C;
  --gold-soft:   #A88832;
  --gold-bg:     #F3EDE0;
  --safe:        #15803D;   --safe-bg:   #E8F5E9;
  --medium:      #B45309;   --medium-bg: #FEF3C7;
  --danger:      #B91C1C;   --danger-bg: #FEE2E2;
}

/* 1. Global Reading / Scroll Progress Bar */
#scrollProgressBarContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(220, 208, 178, 0.3);
  z-index: 99999;
  pointer-events: none;
}

#scrollProgressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--burgundy) 0%, var(--gold) 50%, var(--safe) 100%);
  box-shadow: 0 0 10px rgba(161, 122, 41, 0.6), 0 0 4px var(--burgundy);
  transition: width 0.08s ease-out;
  position: relative;
}

#scrollProgressBar::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px 2px var(--gold);
}

/* 2. Cyber Telemetry Ticker Bar */
.cyber-ticker-wrap {
  overflow: hidden;
  background: rgba(34, 26, 16, 0.95);
  color: #E8DFC7;
  border-bottom: 1px solid rgba(161, 122, 41, 0.3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 0;
  white-space: nowrap;
  user-select: none;
  position: relative;
  z-index: 39;
}

.cyber-ticker-track {
  display: inline-flex;
  gap: 3rem;
  animation: tickerSlide 38s linear infinite;
}

.cyber-ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.cyber-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cyber-ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 8px var(--safe);
  animation: radarBlink 1.6s ease-in-out infinite;
}

.cyber-ticker-dot.warn {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.cyber-ticker-dot.danger {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes radarBlink {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 3. Interactive Dynamic Spotlight Cards */
.spotlight-card {
  position: relative;
  overflow: hidden;
  --mouse-x: 50%;
  --mouse-y: 50%;
  --spotlight-color: rgba(122, 35, 51, 0.08);
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    550px circle at var(--mouse-x) var(--mouse-y),
    var(--spotlight-color),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

/* 4. 3D Gyro Tilt Physics */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease;
}

/* 5. Smooth Staggered Scroll Reveal */
.reveal-init {
  opacity: 0;
  transform: translateY(32px) scale(0.985);
  filter: blur(5px);
  transition: 
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.reveal-init.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.delay-1 { transition-delay: 0.08s !important; }
.delay-2 { transition-delay: 0.16s !important; }
.delay-3 { transition-delay: 0.24s !important; }
.delay-4 { transition-delay: 0.32s !important; }
.delay-5 { transition-delay: 0.40s !important; }

/* 6. Dynamic Laser Scan Sweep (Triggered when calculating) */
.scan-container {
  position: relative;
  overflow: hidden;
}

.scan-laser-beam {
  position: absolute;
  top: -120px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(122,35,51,0.2) 20%, #7A2333 50%, rgba(161,122,41,0.8) 75%, transparent 100%);
  box-shadow: 0 0 16px 2px rgba(122, 35, 51, 0.7);
  pointer-events: none;
  z-index: 25;
  opacity: 0;
}

.scanning .scan-laser-beam {
  animation: scanSweepLaser 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

@keyframes scanSweepLaser {
  0% {
    top: 0%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* 7. Live Security HUD Scanner Indicator */
.hud-terminal-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--panel-warm);
  color: var(--ink);
  transition: all 0.25s ease;
}

.hud-terminal-pill.scanning {
  border-color: var(--burgundy);
  background: var(--burgundy-bg);
  color: var(--burgundy);
  animation: hudPulse 0.8s ease-in-out infinite alternate;
}

@keyframes hudPulse {
  0% { box-shadow: 0 0 0 0 rgba(122, 35, 51, 0.3); }
  100% { box-shadow: 0 0 0 6px rgba(122, 35, 51, 0); }
}

/* 8. Gauge Dynamic Glow Filters */
.gauge-svg-wrap {
  position: relative;
  transition: filter 0.5s ease;
}

.gauge-glow-safe {
  filter: drop-shadow(0 4px 18px rgba(47, 125, 82, 0.28));
}

.gauge-glow-warning {
  filter: drop-shadow(0 4px 20px rgba(178, 117, 0, 0.35));
}

.gauge-glow-danger {
  filter: drop-shadow(0 4px 24px rgba(178, 58, 50, 0.48));
  animation: dangerThrob 1.2s infinite ease-in-out;
}

@keyframes dangerThrob {
  0%, 100% { filter: drop-shadow(0 4px 16px rgba(178, 58, 50, 0.35)); }
  50% { filter: drop-shadow(0 4px 28px rgba(178, 58, 50, 0.65)); }
}

/* 9. Needle Physics Dynamic Bounce */
.gauge-needle {
  transform-origin: 100px 100px;
  transition: transform 0.85s cubic-bezier(0.34, 1.45, 0.64, 1);
  will-change: transform;
}

/* 10. Shiver Shake for Dangerous Flag Detection */
.danger-shiver {
  animation: shiverAnim 0.45s ease-in-out;
}

@keyframes shiverAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-0.5deg); }
  40% { transform: translateX(4px) rotate(0.5deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* 11. Emerald Victory Glow when 100% Safe */
.safe-burst {
  animation: safeBurstAnim 0.6s ease-out;
}

@keyframes safeBurstAnim {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(47, 125, 82, 0.6); }
  50% { transform: scale(1.02); box-shadow: 0 0 24px 6px rgba(47, 125, 82, 0.3); }
  100% { transform: scale(1); box-shadow: none; }
}

/* 12. Permission Chips Tactile Micro-Interactions */
.perm-item {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.perm-item:active {
  transform: scale(0.975);
}

.perm-item:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px -4px rgba(34, 26, 16, 0.08);
}

.perm-item.checked-danger {
  box-shadow: 0 4px 14px -3px rgba(178, 58, 50, 0.25);
}

.perm-item.checked-warning {
  box-shadow: 0 4px 14px -3px rgba(178, 117, 0, 0.2);
}

.perm-item.checked-safe {
  box-shadow: 0 4px 14px -3px rgba(47, 125, 82, 0.2);
}

/* 13. Ripple Effect on Click */
.cyber-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: cyberRippleAnim 0.55s ease-out;
  background: rgba(122, 35, 51, 0.18);
  pointer-events: none;
}

@keyframes cyberRippleAnim {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* 14. Button Shimmer Beam */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -120%;
  width: 70%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
}

.btn-shimmer:hover::after {
  animation: shimmerPass 0.85s ease forwards;
}

@keyframes shimmerPass {
  0% { left: -120%; }
  100% { left: 160%; }
}

/* 15. Preset Chip Micro-State */
.preset-chip {
  position: relative;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.preset-chip:active {
  transform: scale(0.94);
}

.preset-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -2px rgba(122, 35, 51, 0.2);
}

.preset-chip.active {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(122, 35, 51, 0.35);
}

/* 16. Floating Elements Physics (Sinusoidal Easing) */
.float-subtle {
  animation: floatAnim 4.5s ease-in-out infinite;
}

.float-delayed {
  animation: floatAnim 5.5s ease-in-out 1.2s infinite;
}

@keyframes floatAnim {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-7px) rotate(0.4deg);
  }
}

/* 17. Subtle Ambient Canvas in Hero */
#ambientRadarCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

/* 18. Stat Strip Counter Animation */
.stat-counter-val {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* 19. Back To Top Floating Action Button */
#backToTopBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(34, 26, 16, 0.15);
  color: var(--burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 45;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
}

#backToTopBtn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#backToTopBtn:hover {
  background: var(--burgundy);
  color: #FBF3EC;
  border-color: var(--burgundy);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 28px rgba(122, 35, 51, 0.3);
}

/* 20. Modal Backdrop Smooth Spring */
.modal-spring-in {
  animation: modalSpring 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSpring {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 21. Live Pulse Ring Indicator */
.pulse-ring {
  position: relative;
}

.pulse-ring::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0.6;
  animation: pulseRingAnim 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulseRingAnim {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* 22. Respect Accessibility Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-init {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .tilt-card {
    transform: none !important;
  }
  #ambientRadarCanvas {
    display: none !important;
  }
}

/* ==========================================================================
   23. CYBER DARK MODE SYSTEM
   Deep Obsidian / Matrix Palette with High Contrast Cyber Accents
   ========================================================================== */
[data-theme="dark"] {
  --bg:          #0A0A0A;
  --bg-alt:      #121212;
  --panel:       #171717;
  --panel-warm:  #141414;
  --line:        #262626;
  --line-soft:   #1E1E1E;
  --ink:         #EDEDED;
  --ink-light:   #A1A1A1;
  --muted:       #737373;
  --muted-2:     #525252;
  --burgundy:    #EDEDED;
  --burgundy-soft:#FFFFFF;
  --burgundy-bg: #262626;
  --gold:        #D4A843;
  --gold-soft:   #E8BF5D;
  --gold-bg:     #2B2313;
  --safe:        #22C55E;   --safe-bg:   #052E16;
  --medium:      #F59E0B;   --medium-bg: #451A03;
  --danger:      #EF4444;   --danger-bg: #450A0A;
}

[data-theme="dark"] body {
  background-color: var(--bg);
  color: var(--ink);
}

[data-theme="dark"] .nav-blur {
  background: rgba(10, 10, 10, 0.92);
}

[data-theme="dark"] .btn-primary {
  background: #EDEDED;
  color: #0A0A0A;
}

[data-theme="dark"] .btn-primary:hover {
  background: #FFFFFF;
}

[data-theme="dark"] .mock-phone {
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .dash-card {
  box-shadow: 0 12px 36px -15px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .grain::before {
  background-image: radial-gradient(circle at 1px 1px, rgba(237, 237, 237, 0.03) 1px, transparent 1px);
}

/* Theme Switcher Button */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-warm);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--burgundy);
  background: var(--panel);
  transform: translateY(-1px);
}

/* Drag and Drop APK Zone */
.apk-dropzone {
  border: 2px dashed var(--line);
  background: var(--panel-warm);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.apk-dropzone:hover,
.apk-dropzone.dragover {
  border-color: var(--burgundy);
  background: var(--burgundy-bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(122, 35, 51, 0.25);
}

.apk-dropzone.analyzing {
  border-style: solid;
  border-color: var(--gold);
}

.telemetry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

/* ==========================================================================
   REVBID AD MONETIZATION SYSTEM & RESPONSIVE FRAMES
   ========================================================================== */
.editorial-ad-frame {
  border: 1px solid var(--line);
  background: var(--panel-warm);
  border-radius: 8px;
  padding: 10px;
  position: relative;
  margin: 20px auto;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.editorial-ad-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 6px;
  text-align: center;
}

div[data-placement-id] {
  max-width: 100% !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

div[data-placement-id] iframe {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 520px) {
  div[data-placement-id] {
    min-width: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }
}


