/* --- GLOBAL AMBIENT CANVAS --- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 0% 10%, rgba(209, 58, 99, 0.06) 0%, transparent 65%),
    radial-gradient(ellipse 500px 500px at 100% 90%, rgba(227, 179, 77, 0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* --- 5. AUTH / LOGIN SCREEN OVERHAUL --- */

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 25px rgba(209, 58, 99, 0.25); }
  100% { transform: scale(1.06); box-shadow: 0 0 45px rgba(209, 58, 99, 0.5); }
}

/* --- 8. MATCHES SCREEN & BADOO / TANGO STORIES RAIL --- */

@keyframes rotateRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- 9. LUXURY GLASS BOTTOM NAVIGATION --- */

body.keyboard-visible #globalFloatingSearchBtn,
body.keyboard-open #globalFloatingSearchBtn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* --- 10. CONVERSATION LIST SKELETON LOADING STATE --- */
@keyframes hmbs-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ================================================================
   ULTRA-LUXURY WHITE / LIGHT THEME SYSTEM
   High contrast, crisp typography, pearl glassmorphism
   ================================================================ */

body[data-theme="light"] {
  background: radial-gradient(circle at 50% 0%, #FFF5FA 0%, #F5F1FA 60%, #EFEAF5 100%) !important;
  color: #140C1D !important;
}

body[data-theme="light"]::before {
  background:
    radial-gradient(ellipse 600px 600px at 0% 10%, rgba(255, 46, 112, 0.06) 0%, transparent 65%),
    radial-gradient(ellipse 500px 500px at 100% 90%, rgba(244, 197, 80, 0.05) 0%, transparent 65%),
    radial-gradient(ellipse 400px 400px at 50% 50%, rgba(0, 162, 255, 0.03) 0%, transparent 70%) !important;
}

/* Profile & Settings (Light) */

#editBio,
#signupBio {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

#editBio::-webkit-scrollbar,
#signupBio::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Candidate Target Grid */

.ai-picker-item {
  cursor: pointer !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.ai-picker-item:hover { transform: scale(1.08) !important; }

.ai-picker-item span {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: var(--txt-secondary, #E4E0EE) !important;
}
.ai-picker-item.selected span {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

/* Light Mode Overrides for AI Studio & Profile */

[data-theme="light"] .ai-picker-item span {
  color: #4A3E5C !important;
}
[data-theme="light"] .ai-picker-item.selected span {
  color: #140C1D !important;
}

/* Upgrade to Gold Paywall Modal (Light Mode) */

[data-theme="light"] #paywallReason {
  color: #5A5068 !important;
}

/* Subtle shimmer animation on accent btn */

@keyframes shimmerBtn {
  0% { left: -100%; }
  60%, 100% { left: 150%; }
}

/* Empty state — centered, premium */

@keyframes floatEmptyEmoji {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* --- PROGRESS DOTS (signup) --- */

@keyframes progressGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Ensure body ambient background shows on desktop */
@media (min-width: 500px) {

  body {
    background:
      radial-gradient(ellipse 700px 500px at 20% 20%, rgba(255,46,112,0.1) 0%, transparent 70%),
      radial-gradient(ellipse 600px 600px at 80% 80%, rgba(244,197,80,0.07) 0%, transparent 70%),
      #060409 !important;
  }

}

/* Paywall gem pulse animation */
@keyframes paywallGemPulse {
  0% {
    filter: drop-shadow(0 0 14px rgba(244, 197, 80, 0.5));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 32px rgba(244, 197, 80, 0.9));
    transform: scale(1.07);
  }
}

/* Success screen gem: rose-gold pulse */
@keyframes successGemPulse {
  0% { filter: drop-shadow(0 0 12px rgba(255, 46, 112, 0.4)); transform: scale(1) rotate(0deg); }
  50% { filter: drop-shadow(0 0 28px rgba(255, 46, 112, 0.7)); transform: scale(1.06) rotate(5deg); }
  100% { filter: drop-shadow(0 0 12px rgba(255, 46, 112, 0.4)); transform: scale(1) rotate(0deg); }
}

/* ================================================================
   TOP PICK SPOTLIGHT / STORY VIEWER MODAL
   Full-screen luxury profile card with auto-timer & quick interactions
   ================================================================ */

.story-viewer-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 150 !important;
  background: #08060E !important;
  display: none;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: hidden !important;
  border-radius: inherit !important;
  animation: storyFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes storyFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.story-bg-img {
  position: absolute !important;
  inset: 0 !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-color: #000 !important;
  z-index: 1 !important;
  transition: background-image 0.2s ease !important;
}

#storyVideo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background-color: #000 !important;
  z-index: 1 !important;
}

.story-vignette {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.65) 0%,
    transparent 18%,
    transparent 82%,
    rgba(0, 0, 0, 0.75) 100%
  ) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

/* Header & Progress */
.story-header-area {
  position: relative !important;
  z-index: 10 !important;
  padding: 16px 16px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  transition: opacity 0.15s ease !important;
}

.story-progress-bars {
  display: flex !important;
  gap: 4px !important;
  width: 100% !important;
}

.story-progress-bar {
  flex: 1 !important;
  height: 3px !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border-radius: 3px !important;
  overflow: hidden !important;
  position: relative !important;
}

.story-progress-bar .story-progress-fill {
  height: 100% !important;
  width: 0% !important;
  background: #FFFFFF !important;
  border-radius: 3px !important;
}

.story-progress-bar.completed .story-progress-fill {
  width: 100% !important;
}

.story-progress-bar.active .story-progress-fill {
  animation: storyProgressTimer 6s linear forwards !important;
}

@keyframes storyProgressTimer {
  from { width: 0%; }
  to { width: 100%; }
}

.story-top-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.story-user-info {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.story-user-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  border: 2px solid #FF2E70 !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: 0 0 12px rgba(255, 46, 112, 0.4) !important;
}

.story-user-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.story-user-name-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.story-user-name {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  color: #FFFFFF !important;
  letter-spacing: -0.2px !important;
}

.story-user-age {
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 600 !important;
}

.story-user-loc {
  font-size: 0.74rem !important;
  color: rgba(255, 255, 255, 0.65) !important;
}

.story-close-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, background 0.2s ease !important;
}

.story-close-btn.is-hidden,
.story-close-btn[style*="display: none"],
.story-close-btn[style*="display:none"],
#storyDeleteBtn.is-hidden,
#storyAddMoreBtn.is-hidden {
  display: none !important;
}

.story-close-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  transform: scale(1.08) !important;
}

/* Touch Zones for Left/Right navigation & Tap-and-hold pause */
.story-nav-zones {
  position: absolute !important;
  top: 75px !important;
  bottom: 75px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 5 !important;
  display: flex !important;
  touch-action: none !important;
}

.story-zone-left,
.story-zone-right {
  flex: 1 !important;
  cursor: pointer !important;
}

/* Optional subtle caption */
.story-caption-overlay {
  position: absolute !important;
  bottom: 80px !important;
  left: 16px !important;
  right: 16px !important;
  text-align: center !important;
  z-index: 12 !important;
  pointer-events: none !important;
  color: #fff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85) !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  transition: opacity 0.15s ease !important;
}

/* Bottom Actions */
.story-bottom-area {
  position: relative !important;
  z-index: 10 !important;
  padding: 10px 16px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  transition: opacity 0.15s ease !important;
}

/* Tap and hold pause state */
.story-viewer-overlay.story-paused .story-header-area,
.story-viewer-overlay.story-paused .story-bottom-area,
.story-viewer-overlay.story-paused .story-caption-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}
.story-viewer-overlay.story-paused .story-progress-bar.active .story-progress-fill {
  animation-play-state: paused !important;
}

/* Action Row */
.story-action-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.story-reply-wrap {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 28px !important;
  padding: 4px 6px 4px 16px !important;
  transition: border-color 0.2s ease, background 0.2s ease !important;
}

.story-reply-wrap:focus-within {
  border-color: #FF2E70 !important;
  background: rgba(255, 46, 112, 0.08) !important;
}

.story-reply-input {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #FFFFFF !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
}

.story-reply-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.story-send-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: #FF2E70 !important;
  border: none !important;
  color: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.story-send-btn:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 0 12px rgba(255, 46, 112, 0.6) !important;
}

.story-like-btn {
  width: 46px !important;
  height: 46px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #FF2E70 0%, #D13A63 100%) !important;
  border: none !important;
  color: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 20px rgba(255, 46, 112, 0.6) !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  flex-shrink: 0 !important;
}

.story-like-btn:hover {
  transform: scale(1.12) !important;
  box-shadow: 0 6px 26px rgba(255, 46, 112, 0.8) !important;
}

/* 1. Universal Light Mode Root & Canvas */
html[data-theme="light"],
body[data-theme="light"],
[data-theme="light"] {
  --bg: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(0, 0, 0, 0.04);
  --txt-primary: #140C1D;
  --txt-secondary: #524760;
  --txt-muted: #7E738C;
  --border: #E5DFEC;
  --border-subtle: #EFEAF4;
  --border-active: rgba(255, 46, 112, 0.5);
  --shadow-sm: 0 2px 8px rgba(70, 40, 90, 0.04);
  --shadow-md: 0 8px 24px rgba(70, 40, 90, 0.08);
  --shadow-xl: 0 20px 50px rgba(70, 40, 90, 0.12);
}

body[data-theme="light"] {
  background: radial-gradient(circle at 50% 0%, #FFF5FA 0%, #FAF7F2 60%, #F3EEF8 100%) !important;
  color: #140C1D !important;
}

/* Profile Strength Meter */

[data-theme="light"] .hk-strength-link {
  color: #D13A63 !important;
}

/* 6. Chat Screen Polish */

[data-theme="light"] #chatEditBar {
  background: #F4EFFB !important;
  border-bottom: 1px solid #DDD3E8 !important;
}

/* 7. Settings Screen Polish */

[data-theme="light"] .ai-picker-item {
  background: #F8F5FC !important;
  border: 1px solid #DDD5E7 !important;
  color: #140C1D !important;
}

[data-theme="light"] .ai-picker-item.selected span {
  color: #140C1D !important;
}

/* Universal centering of App Shell & Core Layout */
body {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  background: var(--bg) !important;
  overflow: hidden !important;
}

/* ── PROFILE SCREEN: Perfect Center & Elastic Card Fit ── */
#profileScreen {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  width: 100% !important;
}

#profileScreen.active {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

/* --- 8. PROFILE SCREEN & BADGES --- */

[data-theme="light"] .hk-strength-link {
  color: #9C1045 !important;
  font-weight: 800 !important;
}
[data-theme="light"] #profilePreviewBtn {
  color: #8E1538 !important;
  border-color: #E8BFCD !important;
  background: #FFF5F8 !important;
}

/* --- 9. VIP & PAYWALL GOLD POLISH --- */

[data-theme="light"] #tgCountdownTimer {
  color: #7A5300 !important;
  font-weight: 800 !important;
}

/* --- 11. FINISHING CONTRAST REFINEMENTS (DARK & LIGHT) --- */

.filter-age-val {
  color: #FF6584 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .filter-age-val {
  color: #9C1045 !important;
  font-weight: 800 !important;
}

[data-theme="light"] #profilePreviewBtn {
  background: #FFF0F4 !important;
  border: 1.5px solid #D13A63 !important;
  color: #7A1638 !important;
}
[data-theme="light"] #profilePreviewBtn span {
  color: #7A1638 !important;
  font-weight: 700 !important;
}

/* Card Voice Intro Button (Floating on Photo)
   Sits under the distance badge (top-right). It used to be anchored to the
   bottom-right of the photo area, which is exactly where .card-info draws the
   bio, so the pill covered the end of the bio text. */

@keyframes voiceWaveAnim {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* ==========================================================
   TAP-TO-RETRY FOR FAILED MESSAGES & VOICE NOTES
   ========================================================== */

@keyframes retryPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 1; }
}

/* ==========================================================
   IN-CHAT AI CONVERSATION ASSISTANT
   ========================================================== */

@keyframes slideUpAiPanel {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   LIVE NETWORK CONNECTIVITY BANNER
   ========================================================== */

@keyframes bannerSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes netShake {
  0%, 100% { transform: translate(-50%, 0); }
  20%, 60% { transform: translate(calc(-50% - 6px), 0); }
  40%, 80% { transform: translate(calc(-50% + 6px), 0); }
}
