/* Implexity Tweaker — spring.ceo-inspired Design System (adapted for Windows Utility) */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-base: #0e0e11;
  --bg-panel: rgba(24, 24, 27, 0.6);
  --bg-panel-solid: #18181b;
  --bg-input: rgba(24, 24, 27, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --primary: #7c6cf0;
  --primary-hover: #6c5ce7;
  --primary-light: #a78bfa;
  --accent-cyan: #22d3ee;
  --accent-lime: #a3e635;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary) !important;
  font-family: 'Inter Tight', 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

body:not(.profile-background-enabled) {
  background-color: var(--bg-base) !important;
  background-image:
    radial-gradient(ellipse 65% 45% at 50% 0%, rgba(124, 108, 240, 0.16) 0%, transparent 70%),
    radial-gradient(ellipse 45% 35% at 85% 25%, rgba(34, 211, 238, 0.06) 0%, transparent 65%) !important;
  background-attachment: fixed !important;
}

h1, h2, .hero-title {
  letter-spacing: -0.03em;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', Consolas, monospace !important;
}

/* Remove old heavy neon blobs */
.hero-glow-blob {
  display: none !important;
}

/* Keep 3D canvas atmospheric & subtle */
#three-canvas-container {
  opacity: 0.35 !important;
}

/* spring.ceo dark glass panels */
.glass-panel,
.glass,
.mica-strong {
  background: rgba(24, 24, 27, 0.6) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.5) !important;
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease !important;
}

.glass-panel:hover,
.card-hover:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: rgba(24, 24, 27, 0.82) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.65) !important;
}

.glass-strong,
.glass-card {
  background: rgba(18, 18, 22, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.8) !important;
}

/* spring.ceo Floating Pill Navbar */
.spring-nav-pill {
  background: rgba(14, 14, 17, 0.82) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 35px -10px rgba(0, 0, 0, 0.7) !important;
}

.glass-nav-pill {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

/* Primary Pill CTA (spring.ceo #7c6cf0 + focused glow) */
.btn-purple-glow,
.btn-primary {
  background: var(--primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 0 24px -4px rgba(124, 108, 240, 0.45) !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease !important;
}

.btn-purple-glow:hover,
.btn-primary:hover {
  background: var(--primary-hover) !important;
  box-shadow: 0 0 32px -2px rgba(124, 108, 240, 0.65) !important;
  transform: translateY(-1px) !important;
}

.btn-purple-glow:active,
.btn-primary:active {
  transform: translateY(0) !important;
}

.btn-glass-subtle,
.btn-ghost {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}

.btn-glass-subtle:hover,
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

/* Signature spring.ceo multi-color gradient text */
.text-purple-gradient,
.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #818cf8 35%, #38bdf8 70%, #a3e635 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Inputs */
.input-dark {
  background: var(--bg-input) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: var(--text-primary) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.input-dark:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.2) !important;
}

/* Section borders */
.border-purple-900\/20,
.border-purple-500\/20,
.border-purple-500\/15 {
  border-color: rgba(255, 255, 255, 0.06) !important;
}

.shadow-glow-purple,
.shadow-glow-purple-lg {
  box-shadow: 0 0 24px -4px rgba(124, 108, 240, 0.45) !important;
}

/* Footer */
footer {
  background-color: #0b0b0e !important;
  border-top-color: rgba(255, 255, 255, 0.06) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0e0e11;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ===== 1:1 Implexity Tweaker Desktop App Window (DesignSystem.xaml + MainWindow.xaml) ===== */
#hero-tweaker-window {
  font-family: 'Inter Tight', 'Inter', 'Segoe UI Variable', 'Segoe UI', sans-serif;
}

#hero-tweaker-window .app-surface {
  background-color: #0e1729;
  border: 1px solid #1e2d48;
}

#hero-tweaker-window .app-surface-alt {
  background-color: #142038;
  border: 1px solid #1e2d48;
}

#hero-tweaker-window .fluent-toggle {
  width: 36px;
  height: 18px;
  background: #142038 !important;
  border: 1px solid #1e2d48 !important;
}

#hero-tweaker-window .fluent-toggle::after {
  width: 12px;
  height: 12px;
  top: 2px;
  left: 2px;
}

#hero-tweaker-window .fluent-toggle.active {
  background: #6366f1 !important;
  border-color: #818cf8 !important;
  box-shadow: none !important;
}

#hero-tweaker-window .fluent-toggle.active::after {
  transform: translateX(18px);
}

#hero-tweaker-window .app-btn-primary {
  background: #6366f1;
  border: 1px solid #818cf8;
  color: #ffffff;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

#hero-tweaker-window .app-btn-primary:hover {
  background: #4f46e5;
}

#hero-tweaker-window .app-btn-secondary {
  background: #142038;
  border: 1px solid #1e2d48;
  color: #f8fafc;
  border-radius: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#hero-tweaker-window .app-btn-secondary:hover {
  background: #1a2947;
  border-color: #6366f1;
}

/* ===== Crisp Resting State + Interactive 3D Tilt on Hover for #hero-tweaker-window ===== */
.tweaker-3d-stage {
  perspective: 1200px;
}

#hero-tweaker-window {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#hero-tweaker-window.is-tilting {
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out;
  transition-delay: 0ms !important;
}

#hero-tweaker-window img {
  image-rendering: auto;
}

#hero-tweaker-window .tweaker-3d-frame {
  box-shadow:
    0 28px 75px -15px rgba(0, 0, 0, 0.85),
    0 0 44px -10px rgba(255, 55, 95, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ===== spring.ceo Smooth Animations ===== */
.spring-reveal {
  opacity: 0;
  transform: translate3d(var(--reveal-x, 0px), var(--reveal-y, 28px), 0) scale(0.975);
  filter: blur(5px);
  transition:
    opacity 0.72s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.72s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.72s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.spring-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.glass-panel {
  transition:
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    box-shadow 0.32s ease,
    opacity 0.72s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.72s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.glass-panel.spring-reveal.is-visible:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 40px -15px rgba(124, 108, 240, 0.22);
  transition-delay: 0ms !important;
}

@media (prefers-reduced-motion: reduce) {
  .spring-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ===== Smooth Auth Modal Animation ===== */
#auth-modal {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
}

#auth-modal > div {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.36s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}

#auth-modal.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#auth-modal.hidden > div {
  opacity: 0;
  transform: translateY(22px) scale(0.94);
  filter: blur(5px);
}

/* ===== Global Footer & Floating Widgets Unification ===== */
footer {
  background: #09090b !important;
  border-top-color: rgba(255, 255, 255, 0.06) !important;
}

#dm-panel,
#support-panel {
  background: rgba(18, 18, 22, 0.92) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 20px !important;
}

/* Sequential pulsing 3 dots (spring.ceo style) */
.spring-dots span {
  display: inline-block;
  animation: spring-dot-pulse 1.5s ease-in-out infinite;
  opacity: 0.3;
}
.spring-dots span:nth-child(2) { animation-delay: 0.25s; }
.spring-dots span:nth-child(3) { animation-delay: 0.5s; }

@keyframes spring-dot-pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); color: #a3e635; }
}

/* Lime squiggle draw animation */
.spring-squiggle path {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: squiggle-draw 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

@keyframes squiggle-draw {
  to { stroke-dashoffset: 0; }
}

/* Subtle icon micro-interaction inside feature cards */
.glass-panel:hover svg {
  transform: scale(1.08);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  #hero-tweaker-window,
  .spring-dots span,
  .spring-squiggle path {
    animation: none !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
  .spring-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

