/* ==========================================================================
   SmartLinkFlow Native Stylesheet & Resilient Fallback Engine
   Ensures 100% visual fidelity on mobile browsers (iOS Safari, Chrome Mobile,
   WhatsApp WKWebView, Instagram, TikTok in-app browsers) even if external
   CDNs are delayed or blocked.
   ========================================================================== */

/* --- Core Resets & Dark Canvas --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: #09090b !important;
  color: #f4f4f5 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  vertical-align: middle;
  display: block;
}

button, input {
  font-family: inherit;
}

/* --- Layout & Flexbox Utilities --- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; -webkit-user-select: none; }
.-z-10 { z-index: -10; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* --- Spacing & Gap Utilities --- */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-3\.5 { gap: 0.875rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* --- Typography & Rounding --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-zinc-400 { color: #a1a1aa; }
.text-zinc-500 { color: #71717a; }
.text-emerald-400 { color: #34d399; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* --- Ambient Artwork & Glassmorphism --- */
.glass-panel {
  background: rgba(18, 18, 22, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-panel-subtle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

.object-cover {
  object-fit: cover;
}

/* --- Mobile Ergonomics & Tap Feedback --- */
html, body {
  -webkit-tap-highlight-color: transparent;
}

/* --- Smart Link Card & Responsive Sizing --- */
.custom-slf-card {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .custom-slf-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    border-radius: 1.25rem !important;
  }
  
  .platform-row {
    padding: 0.625rem 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .platform-row .custom-slf-btn-primary,
  .platform-row .custom-slf-btn-secondary {
    min-height: 38px;
    padding: 0.5rem 0.875rem !important;
  }
}

@media (max-width: 380px) {
  .custom-slf-card {
    padding: 0.875rem !important;
  }
}

/* --- Platform Rows & Conversion CTA Buttons --- */
.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.platform-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.platform-row:active {
  transform: translateY(0) scale(0.99);
}

.custom-slf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.custom-slf-btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.custom-slf-btn-primary:active {
  transform: translateY(1px);
}

.custom-slf-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.custom-slf-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.18) !important;
}

/* --- Pulse & Audio Wave Animations --- */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.4), 0 0 30px rgba(29, 185, 84, 0.15);
  }
  50% {
    box-shadow: 0 0 25px rgba(29, 185, 84, 0.7), 0 0 45px rgba(29, 185, 84, 0.3);
  }
}

@keyframes waveBounce {
  0%, 100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

.spotify-glow-btn {
  background: linear-gradient(135deg, #1ed760 0%, #1db954 100%);
  animation: pulseGlow 3s infinite ease-in-out;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wave-bar {
  display: inline-block;
  width: 3px;
  background-color: #a1a1aa;
  border-radius: 2px;
  transform-origin: bottom;
}

.is-playing .wave-bar {
  background-color: #10b981;
  animation: waveBounce 1.2s ease-in-out infinite;
}

.is-playing .wave-bar:nth-child(1) { animation-delay: 0.1s; height: 16px; }
.is-playing .wave-bar:nth-child(2) { animation-delay: 0.3s; height: 22px; }
.is-playing .wave-bar:nth-child(3) { animation-delay: 0.15s; height: 28px; }
.is-playing .wave-bar:nth-child(4) { animation-delay: 0.4s; height: 18px; }
.is-playing .wave-bar:nth-child(5) { animation-delay: 0.25s; height: 24px; }
.is-playing .wave-bar:nth-child(6) { animation-delay: 0.35s; height: 14px; }
.is-playing .wave-bar:nth-child(7) { animation-delay: 0.05s; height: 20px; }
.is-playing .wave-bar:nth-child(8) { animation-delay: 0.45s; height: 26px; }

/* --- Admin Builder Phone Mockup --- */
.phone-mockup {
  width: 380px;
  height: 740px;
  border: 12px solid #27272a;
  border-radius: 44px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  background: #09090b;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 20px;
  background: #18181b;
  border-radius: 20px;
  z-index: 50;
}

/* --- Inline Helper Tooltips --- */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-trigger {
  color: #71717a;
  cursor: pointer;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.tooltip-trigger:hover {
  color: #34d399;
}

.tooltip-box {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d4d4d8;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 60;
  pointer-events: none;
}

.tooltip-wrap:hover .tooltip-box,
.tooltip-wrap:focus-within .tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --- Confetti Celebration Modal --- */
@keyframes celebrationPop {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.celebration-modal-card {
  animation: celebrationPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes confettiRain {
  0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-particle {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confettiRain 3s linear infinite;
}
