/* ═══════════════════════════════════════════════════════════
   CLASPER ULTRA POLISH — Premium Visual Layer
   Adds glassmorphism, advanced animations, micro-interactions,
   particle effects, and professional-grade UI refinements.
   ═══════════════════════════════════════════════════════════ */

/* ── Smooth Scroll ─────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Skip Link (accessibility — hidden unless focused) ── */
.skip-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  background: var(--warm-accent);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 100000;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ── Premium Card Glassmorphism ────────────────────────── */
.card:not([style*="linear-gradient"]),
.widget,
.reunion-card,
.safe-card,
.feature-card,
.drop-card,
.pet-card,
.recipe-card,
.memory-card,
.msg-list,
.msg-window,
.form-box,
.notif-item,
.tl-card,
.add-pet-form {
  background: rgba(40, 28, 18, 0.6) !important;
  background-image: radial-gradient(rgba(201,184,168,0.03) 1px, transparent 1px) !important;
  background-size: 14px 14px !important;
  backdrop-filter: blur(14px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2) !important;
  border: 1px solid rgba(201,184,168,0.18) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), inset 0 1px 0 rgba(201,184,168,0.06) !important;
  color: #e8d5c0 !important;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.3s ease;
}
.card:not([style*="linear-gradient"]):hover,
.widget:hover,
.reunion-card:hover,
.feature-card:hover {
  border-color: rgba(160,113,78,0.35) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2), inset 0 1px 0 rgba(201,184,168,0.08) !important;
}
.card h3, .card h4, .widget h3, .widget h4, .reunion-card h3 { color: #f0e0c8 !important; }
.card p, .widget p, .reunion-card p { color: rgba(232,213,183,0.6) !important; }
.card strong, .widget strong { color: #e8d5c0 !important; }
.card a:not(.btn), .widget a:not(.btn) { color: var(--warm-accent) !important; }

/* Feed items match */
.feed-item {
  background: rgba(40, 28, 18, 0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-color: rgba(201,184,168,0.12) !important;
  color: #e8d5c0 !important;
}
/* Feed post cards — disable backdrop-filter and hover transform to prevent GPU line artifacts */
#feedContainer .card {
  background: rgba(40, 28, 18, 0.75) !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(201,184,168,0.12) !important;
  transform: none !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}
#feedContainer .card:hover {
  transform: none !important;
  border-color: rgba(181,112,58,0.2) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}
#feedContainer .card img {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.feed-body p { color: rgba(232,213,183,0.8) !important; }
.feed-meta strong { color: #e8d5c0 !important; }
.feed-meta span { color: rgba(232,213,183,0.5) !important; }

/* Messages match */
.msg-list, .msg-window {
  background: rgba(40, 28, 18, 0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-color: rgba(201,184,168,0.12) !important;
  color: #e8d5c0 !important;
}
.msg-list-header { color: #f0e0c8 !important; border-bottom-color: rgba(201,184,168,0.1) !important; }
.msg-thread { border-bottom-color: rgba(201,184,168,0.06) !important; }
.msg-thread:hover, .msg-thread.active { background: rgba(201,184,168,0.08) !important; }
.msg-thread-info strong { color: #e8d5c0 !important; }
.msg-thread-info span { color: rgba(232,213,183,0.5) !important; }
.msg-window-header { border-bottom-color: rgba(201,184,168,0.1) !important; }
.msg-window-header strong { color: #f0e0c8 !important; }
.msg-input-row { border-top-color: rgba(201,184,168,0.1) !important; }
.msg-input-row input {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(201,184,168,0.2) !important;
  color: #e8d5c0 !important;
}

/* Keep heroes and gradient cards unaffected */
.page-hero, .dashboard-bg, .lp-hero { color: white; }

body.dark-mode .card:not([style*="linear-gradient"]),
body.dark-mode .widget,
body.dark-mode .reunion-card,
body.dark-mode .feature-card,
body.dark-mode .drop-card,
body.dark-mode .pet-card,
body.dark-mode .recipe-card,
body.dark-mode .memory-card,
body.dark-mode .msg-list,
body.dark-mode .msg-window,
body.dark-mode .form-box,
body.dark-mode .notif-item,
body.dark-mode .tl-card,
body.dark-mode .add-pet-form,
body.dark-mode .feed-item,
body.dark-mode .drop-compose,
body.dark-mode .drop-tab {
  background: rgba(15, 10, 5, 0.85) !important;
  border-color: rgba(201,184,168,0.1) !important;
}

/* ── Dark Mode: Drops & Gifts font fixes ───────────────── */
body.dark-mode .drop-text { color: #e8d5c0 !important; }
body.dark-mode .drop-to { color: #a88868 !important; }
body.dark-mode .drop-meta { color: #8a6a4a !important; }
body.dark-mode .drop-compose h3 { color: #f0e0c8 !important; }
body.dark-mode .drop-empty { color: #7a5a3a !important; }
body.dark-mode .gift-card { background: rgba(15, 10, 5, 0.85) !important; border-color: rgba(201,184,168,0.1) !important; }
body.dark-mode .gift-card h4,
body.dark-mode .gift-name { color: #e8d5c0 !important; }
body.dark-mode .gift-price,
body.dark-mode .gift-from { color: #a88868 !important; }
body.dark-mode .gift-notes { color: #8a6a4a !important; }

/* ── Dark Mode: Ensure headings and body text are readable ── */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 { color: #f0e0c8 !important; }
body.dark-mode .section-label { color: #ddb892 !important; }
/* Font clarity — prevent Playfair/Lato from blending into dark backgrounds */
body.dark-mode p, body.dark-mode span, body.dark-mode li, body.dark-mode td, body.dark-mode th { color: #e0d0b8; }
body.dark-mode a:not(.btn-primary):not(.btn-outline) { color: #d4a574; }
body.dark-mode .btn-primary { color: #fff !important; }
body.dark-mode strong, body.dark-mode b { color: #f5e6d0; }
/* Drop-specific tab active state */
body.dark-mode .drop-tab.active { background: var(--warm-accent) !important; color: white !important; border-color: var(--warm-accent) !important; }

/* ── Dark Mode: Message bubbles ────────────────────────── */
body.dark-mode .msg-bubble-row:not(.mine) .msg-bubble {
  background: #2e1e10 !important;
  color: #f0e0c8 !important;
  border-color: rgba(221,184,146,0.12);
}
body.dark-mode .msg-bubble-row:not(.mine) .msg-bubble p { color: #f0e0c8 !important; }
body.dark-mode .msg-bubble-row.mine .msg-bubble { color: #fff !important; }
body.dark-mode .msg-bubble small { color: #a88868 !important; opacity: 1 !important; }
body.dark-mode .msg-input-row { border-top-color: #3a2a1a !important; }
body.dark-mode .msg-input-row input { background: #1e1208 !important; color: #e8d5b7 !important; border-color: #5a3820 !important; }
body.dark-mode .msg-window-header { border-bottom-color: rgba(221,184,146,0.1) !important; }
body.dark-mode .msg-window-header strong { color: #f0e0c8 !important; }
body.dark-mode .msg-thread-name { color: #e8d5b7 !important; }
body.dark-mode .msg-thread-preview { color: #a88868 !important; }

/* ── Refined Focus State ───────────────────────────────── */
input:focus,
textarea:focus,
select:focus {
  border-color: var(--warm-accent) !important;
  box-shadow: 0 0 0 3px rgba(181,112,58,0.15), 0 2px 10px rgba(181,112,58,0.12) !important;
}

/* ── Premium Button Effects ────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--warm-accent) 0%, #c4813a 50%, var(--warm-brown) 100%) !important;
  background-size: 200% 200% !important;
  animation: gradientShift 4s ease infinite;
  box-shadow: 0 4px 20px rgba(181, 112, 58, 0.35),
              0 0 0 0 rgba(181, 112, 58, 0) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.btn-primary:hover {
  background-size: 200% 200% !important;
  box-shadow: 0 8px 32px rgba(181, 112, 58, 0.45),
              0 0 40px rgba(181, 112, 58, 0.15) !important;
  transform: translateY(-2px) scale(1.02) !important;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Interactive Card Tilt (subtle) ────────────────────── */
.feature-card,
.lp-fcard {
  transform-style: preserve-3d;
  perspective: 1000px;
}
.feature-card:hover {
  transform: translateY(-6px) rotateX(2deg) rotateY(-1deg) !important;
}

/* ── Smooth Page Entry Animations ──────────────────────── */
@keyframes smoothEntry {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
.page-hero-content,
.container,
section > .container {
  animation: smoothEntry 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ── Stagger Load Animation ────────────────────────────── */
@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.cards-grid > *,
.features-grid > *,
.photo-grid > * {
  animation: staggerIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.cards-grid > *:nth-child(1), .features-grid > *:nth-child(1), .photo-grid > *:nth-child(1) { animation-delay: 0.05s; }
.cards-grid > *:nth-child(2), .features-grid > *:nth-child(2), .photo-grid > *:nth-child(2) { animation-delay: 0.1s; }
.cards-grid > *:nth-child(3), .features-grid > *:nth-child(3), .photo-grid > *:nth-child(3) { animation-delay: 0.15s; }
.cards-grid > *:nth-child(4), .features-grid > *:nth-child(4), .photo-grid > *:nth-child(4) { animation-delay: 0.2s; }
.cards-grid > *:nth-child(5), .features-grid > *:nth-child(5), .photo-grid > *:nth-child(5) { animation-delay: 0.25s; }
.cards-grid > *:nth-child(6), .features-grid > *:nth-child(6), .photo-grid > *:nth-child(6) { animation-delay: 0.3s; }

/* ── Premium Nav Glassmorphism ─────────────────────────── */
nav, .site-nav {
  background: linear-gradient(135deg, rgba(44, 24, 16, 0.92) 0%, rgba(62, 39, 35, 0.88) 50%, rgba(90, 56, 37, 0.92) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(221, 184, 146, 0.12);
}

/* ── Mobile: nav should NOT be sticky (bottom nav handles navigation) ── */
@media (max-width: 768px) {
  nav, .site-nav {
    position: relative !important;
    top: auto !important;
    z-index: 50 !important;
  }
}
@media (max-width: 1024px) {
  nav, .site-nav {
    position: relative !important;
    top: auto !important;
  }
}

/* ── Clasper Logo Glow — Subtle ambient warmth ─────────── */
@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4))
            drop-shadow(0 0 12px rgba(181,112,58,0.25));
  }
  50% {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4))
            drop-shadow(0 0 22px rgba(181,112,58,0.45))
            drop-shadow(0 0 40px rgba(221,184,146,0.12));
  }
}

.nav-logo img,
.site-nav .nav-logo img {
  animation: logoGlow 4s ease-in-out infinite !important;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4))
          drop-shadow(0 0 12px rgba(181,112,58,0.25)) !important;
}

.nav-logo img:hover,
.site-nav .nav-logo img:hover {
  animation: none !important;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4))
          drop-shadow(0 0 28px rgba(181,112,58,0.55))
          drop-shadow(0 0 50px rgba(221,184,146,0.2)) !important;
  transform: scale(1.08) rotate(-2deg);
}

/* Landing page hero logo */
.lp-logo-row img {
  animation: logoGlow 4s ease-in-out infinite !important;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5))
          drop-shadow(0 0 14px rgba(181,112,58,0.3)) !important;
}
.lp-logo-row img:hover {
  animation: none !important;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5))
          drop-shadow(0 0 30px rgba(181,112,58,0.6))
          drop-shadow(0 0 50px rgba(221,184,146,0.2)) !important;
}

/* ── Premium Hero Parallax Feel ────────────────────────── */
.page-hero {
  transform-style: preserve-3d;
}
.page-hero-bg {
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.page-hero:hover .page-hero-bg {
  transform: scale(1.03);
}

/* ── Floating Particle Background (subtle) ─────────────── */
@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.4; }
  25% { transform: translateY(-20px) translateX(10px); opacity: 0.7; }
  50% { transform: translateY(-35px) translateX(-5px); opacity: 0.5; }
  75% { transform: translateY(-15px) translateX(15px); opacity: 0.6; }
}

/* ── Premium Feed Items ────────────────────────────────── */
.feed-item,
.reunion-post {
  border-radius: 18px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  position: relative;
  overflow: hidden;
}
.feed-item::before,
.reunion-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--warm-accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.feed-item:hover::before,
.reunion-post:hover::before {
  opacity: 1;
}

/* ── Avatar Glow Ring ──────────────────────────────────── */
.feed-avatar,
.reunion-post-avatar,
.msg-thread-avatar,
.tree-node img,
.whos-here-avatar {
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(181, 112, 58, 0.2);
}
.feed-avatar:hover,
.reunion-post-avatar:hover,
.tree-node img:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 0 0 3px rgba(181, 112, 58, 0.3),
              0 4px 16px rgba(181, 112, 58, 0.25) !important;
}

/* ── Premium Toast Notification — slide from right with icon ── */
.clasper-toast {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(181, 112, 58, 0.1) !important;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@keyframes toastSlideIn {
  0% { transform: translateX(100px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100px); opacity: 0; }
}
.clasper-toast--exit {
  animation: toastSlideOut 0.3s ease forwards !important;
}
.clasper-toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Smooth Section Transitions ────────────────────────── */
.section-nav-btn {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  position: relative;
  overflow: hidden;
}
.section-nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--warm-accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}
.section-nav-btn.active::after {
  width: 60%;
}
.section-nav-btn:hover {
  transform: translateY(-1px);
}

/* ── Premium Photo Grid — Staggered Masonry ────────────── */
.photo-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  grid-auto-rows: 10px !important;
  gap: 0.75rem !important;
}
.photo-item,
.photo-grid-item {
  border-radius: 14px !important;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  /* Varying spans for masonry look */
  grid-row-end: span 22;
}
.photo-item:nth-child(3n+1),
.photo-grid-item:nth-child(3n+1) {
  grid-row-end: span 26;
}
.photo-item:nth-child(3n+2),
.photo-grid-item:nth-child(3n+2) {
  grid-row-end: span 20;
}
.photo-item:nth-child(5n),
.photo-grid-item:nth-child(5n) {
  grid-row-end: span 28;
}
.photo-item img,
.photo-grid-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.photo-item:hover,
.photo-grid-item:hover {
  transform: scale(1.03) translateY(-4px) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
  z-index: 2;
}

/* ── Premium Empty States ──────────────────────────────── */
.empty-state {
  position: relative;
  padding: 4rem 2rem !important;
}
.empty-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 112, 58, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.empty-state .empty-icon {
  animation: floatParticle 4s ease-in-out infinite;
}

/* ── Interactive Widget Headers ────────────────────────── */
.widget h3,
.card h4,
.reunion-card h3 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.widget h3::after,
.reunion-card h3::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--warm-accent), transparent);
  transition: width 0.3s ease;
}
.widget:hover h3::after,
.reunion-card:hover h3::after {
  width: 100%;
}

/* ── Premium Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(181, 112, 58, 0.3), rgba(127, 79, 36, 0.2));
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(181, 112, 58, 0.5), rgba(127, 79, 36, 0.4));
  background-clip: padding-box;
}

/* ── Counter Animation ─────────────────────────────────── */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.count-animate {
  animation: countPulse 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Premium Footer ────────────────────────────────────── */
footer {
  position: relative;
  overflow: hidden;
}
footer::after {
  content: '' !important;
  display: block !important;
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--warm-accent), var(--warm-tan), var(--warm-accent), transparent);
  animation: shimmerLine 4s linear infinite;
}
@keyframes shimmerLine {
  to { transform: translateX(50%); }
}

/* ── Interactive Quick Access Cards ────────────────────── */
/* Handled by .qa-link-item in style.css — no overrides needed */

/* ── Pulse Notification Badge ──────────────────────────── */
@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}
.nav-badge,
.section-nav-badge {
  animation: badgePulse 2s ease-in-out infinite;
}

/* ── Modernize Browns: softer taupe tones ───────────────── */
:root {
  --warm-tan: #c9b8a8;
  --warm-brown: #5c4a3a;
  --warm-dark: #2e2420;
  --warm-accent: #a0714e;
}

.dashboard-bg {
  border-radius: 0 0 32px 32px !important;
  overflow: hidden;
  position: relative;
}
.dashboard-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--warm-cream), transparent);
  pointer-events: none;
  z-index: 2;
}
body.dark-mode .dashboard-bg::after {
  background: linear-gradient(to top, #1a1008, transparent);
}

/* ── Smooth Mood Button Interactions ───────────────────── */
#moodPicker button {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  border-radius: 12px !important;
  padding: 6px !important;
}
#moodPicker button:hover {
  transform: scale(1.3) rotate(-5deg) !important;
  background: rgba(181, 112, 58, 0.1) !important;
}
#moodPicker button:active {
  transform: scale(0.9) !important;
}

/* ── Bottom Nav Premium Glass ──────────────────────────── */
/* Base styles now handle the glass effect — just add active glow */
.bottom-nav-item.active .bottom-nav-icon,
.mobile-bottom-nav a.active .nav-icon {
  filter: drop-shadow(0 0 8px rgba(221, 184, 146, 0.5));
}

/* ── Smooth More Sheet ─────────────────────────────────── */
.mobile-more-sheet,
.more-sheet {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

/* ── Premium Page Hero Vignette ────────────────────────── */
.page-hero-bg {
  filter: brightness(0.35) saturate(1.2);
}

/* ── Smooth Image Loading ──────────────────────────────── */
img {
  opacity: 1;
  transition: opacity 0.3s ease;
}
img[src=""] {
  opacity: 0;
}

/* ── Premium Reaction Buttons ──────────────────────────── */
.reaction-btn {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.reaction-btn:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(181, 112, 58, 0.2);
}
.reaction-btn:active {
  transform: scale(0.9) !important;
}

/* ── Premium Message Bubbles ───────────────────────────── */
.msg-bubble {
  transition: transform 0.15s ease !important;
}
.msg-bubble:active {
  transform: scale(0.97);
}
.msg-bubble-row.mine .msg-bubble {
  background: linear-gradient(135deg, var(--warm-accent), #c4813a) !important;
}

/* ── Sidebar Promo Cards Shine ─────────────────────────── */
.card[style*="linear-gradient"] {
  position: relative;
  overflow: hidden;
}
.card[style*="linear-gradient"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}
.card[style*="linear-gradient"]:hover::after {
  left: 100%;
}

/* ── Premium Feed Post Card ────────────────────────────── */
.feed-item {
  border-radius: 20px !important;
  border: 1px solid rgba(181, 112, 58, 0.06) !important;
  transition: all 0.3s ease !important;
}
.feed-item:hover {
  border-color: rgba(181, 112, 58, 0.15) !important;
}

/* ── Smooth Shopping Item Check + Haptic Feedback ─────── */
.shopping-item {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  position: relative;
}
.shopping-item.checked {
  transform: translateX(4px);
}
.shop-check {
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  position: relative;
}
.shop-check.done {
  transform: scale(1.1);
}
/* Haptic ✓ float on check */
.haptic-check {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.9rem;
  pointer-events: none;
  animation: hapticFloat 0.7s ease forwards;
  z-index: 10;
}
@keyframes hapticFloat {
  0% { opacity: 1; transform: translateY(0) scale(0.5); }
  50% { transform: translateY(-12px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-20px) scale(1); }
}
/* Haptic ✨ float on message send */
.haptic-sparkle {
  position: absolute;
  top: -6px;
  right: 4px;
  font-size: 0.85rem;
  pointer-events: none;
  animation: hapticFloat 0.7s ease forwards;
  z-index: 10;
}

/* ── Premium Profile Avatar ────────────────────────────── */
#navAvatar {
  transition: all 0.3s ease !important;
}
#navAvatar:hover {
  transform: scale(1.12) !important;
  box-shadow: 0 0 0 3px rgba(221, 184, 146, 0.4),
              0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

/* ── Smooth Bottom Nav Transitions ─────────────────────── */
.bottom-nav-item,
.mobile-bottom-nav a {
  transition: color 0.2s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.bottom-nav-item:active,
.mobile-bottom-nav a:active {
  transform: scale(0.88) !important;
}

/* ── Premium Search Input ──────────────────────────────── */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(181, 112, 58, 0.12),
              0 4px 16px rgba(181, 112, 58, 0.06) !important;
}

/* ── Smooth Page Section Padding ───────────────────────── */
.reunion-card,
.reunion-post {
  border-radius: 18px !important;
  transition: all 0.25s ease !important;
}
.reunion-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 31, 14, 0.1);
}

/* ── Premium Event Cards ───────────────────────────────── */
.ev-card,
[style*="border-left:3px solid"] {
  transition: all 0.25s ease;
}
[style*="border-left:3px solid"]:hover {
  transform: translateX(3px);
}

/* ── Premium Notification Items ────────────────────────── */
.notif-item {
  transition: all 0.25s ease !important;
  border-radius: 14px !important;
}
.notif-item:hover {
  transform: translateX(3px);
  background: rgba(181, 112, 58, 0.04);
}

/* ── Smooth Dark Mode Toggle ───────────────────────────── */
body {
  transition: background-color 0.4s ease !important;
}

/* ── Premium Link Hover (pill style) ───────────────────── */
.more-link:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 4px 16px rgba(181, 112, 58, 0.12) !important;
}

/* ── Gift Card Premium ─────────────────────────────────── */
.gift-card {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.gift-card:hover {
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: 0 8px 24px rgba(181, 112, 58, 0.15) !important;
}
.gift-card .gift-emoji {
  transition: transform 0.3s ease;
}
.gift-card:hover .gift-emoji {
  transform: scale(1.2) rotate(-5deg);
}

/* ── Premium Loading States ────────────────────────────── */
@keyframes premiumShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton,
.skeleton-pulse {
  background: linear-gradient(90deg,
    rgba(181, 112, 58, 0.05) 25%,
    rgba(181, 112, 58, 0.12) 50%,
    rgba(181, 112, 58, 0.05) 75%) !important;
  background-size: 200% 100% !important;
  animation: premiumShimmer 2s ease-in-out infinite !important;
}

/* ── Interactive Link Underline ────────────────────────── */
a:not(.btn):not(.nav-links a):not(.qa-grid a):not(.more-link) {
  position: relative;
}

/* ── Premium Modal/Overlay ─────────────────────────────── */
.photo-modal,
.photo-lightbox,
.day-panel,
.ob-walkthrough-overlay {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* ── Smooth Tab Transitions ────────────────────────────── */
.gift-tab,
.filter-tab {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.gift-tab:hover,
.filter-tab:hover {
  transform: translateY(-2px);
}
.gift-tab.active,
.filter-tab.active {
  box-shadow: 0 4px 12px rgba(181, 112, 58, 0.25);
}

/* ── Page Hero Premium Overlay ─────────────────────────── */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(62, 39, 35, 0.3) 0%,
    rgba(181, 112, 58, 0.1) 50%,
    rgba(62, 39, 35, 0.4) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ── Heartbeat Widget Glow ─────────────────────────────── */
#heartbeat {
  transition: all 0.3s ease;
}
#heartbeat:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.1);
}

/* ── Premium Form Inputs ───────────────────────────────── */
.form-group input,
.form-group select,
.form-group textarea {
  transition: all 0.3s ease !important;
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(181, 112, 58, 0.4) !important;
  box-shadow: 0 2px 8px rgba(181, 112, 58, 0.08);
}

/* ── Reunion Family Chip Interactive ───────────────────── */
.reunion-family-chip {
  transition: all 0.2s ease !important;
  cursor: default;
}
.reunion-family-chip:hover {
  transform: scale(1.05);
  background: rgba(181, 112, 58, 0.15) !important;
}

/* ── Smooth Stat Counter ───────────────────────────────── */
#countMembers, #countPhotos, #countRecipes, #countEvents {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Premium Selection ─────────────────────────────────── */
::selection {
  background: rgba(181, 112, 58, 0.25) !important;
  color: var(--warm-dark);
}

/* ── Reduce Motion Preference ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  /* Kill the looping !important ambient animations that the universal
     reset above can't override (higher-specificity class + !important). */
  .nav-logo img, .site-nav .nav-logo img, .lp-logo-row img,
  .page-hero-bg, .nav-badge, .btn-primary,
  input:focus, textarea:focus, select:focus,
  .empty-state .empty-icon {
    animation: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════
   SUBTLE DETAILS v3 — The touches people notice
   ═══════════════════════════════════════════════════════════ */

/* ── Page Hero: slow zoom on load (Netflix style) ──────── */
.page-hero-bg {
  animation: heroZoom 20s ease-out forwards !important;
}
@keyframes heroZoom {
  from { transform: scale(1.12); }
  to { transform: scale(1.0); }
}

/* ── Reaction emoji pop on tap ─────────────────────────── */
.reaction-btn:active,
.drop-react button:active {
  animation: emojiPop 0.3s ease !important;
}
@keyframes emojiPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4) rotate(-8deg); }
  70% { transform: scale(0.9) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── Shopping check: sparkle on complete ───────────────── */
.shop-check.done {
  animation: checkSparkle 0.4s ease !important;
}
@keyframes checkSparkle {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(88,129,87,0.4); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 8px rgba(88,129,87,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(88,129,87,0); }
}

/* ── Message send button pulse ─────────────────────────── */
#msgSendBtn:active,
.dm-send-btn:active {
  animation: sendPulse 0.3s ease !important;
}
@keyframes sendPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

/* ── Typing indicator dots ─────────────────────────────── */
.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 0.4rem 0.8rem;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(201,184,168,0.5);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Photo grid hover: slight rotate + depth ───────────── */
.photo-item:nth-child(odd):hover,
.photo-grid-item:nth-child(odd):hover {
  transform: scale(1.03) rotate(-0.5deg) translateY(-3px) !important;
}
.photo-item:nth-child(even):hover,
.photo-grid-item:nth-child(even):hover {
  transform: scale(1.03) rotate(0.5deg) translateY(-3px) !important;
}

/* ── Live timestamp pulse ──────────────────────────────── */
.feed-meta span[data-live],
.reunion-post-time {
  position: relative;
}

/* ── Toast notification premium ────────────────────────── */
.clasper-toast {
  border-left: 4px solid var(--warm-accent) !important;
  border-radius: 14px !important;
  padding-left: 1.2rem !important;
}

/* ── Confetti keyframes (triggered via JS) ─────────────── */
@keyframes confettiDrop {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti {
  position: fixed;
  top: -10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 99999;
  animation: confettiDrop linear forwards;
}

/* ── Gift card wiggle on hover ─────────────────────────── */
.gift-card:hover .gift-emoji {
  animation: giftWiggle 0.5s ease !important;
}
@keyframes giftWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

/* ── Milestone card entrance ───────────────────────────── */
.milestone-card,
[id*="milestone"] .card {
  animation: milestoneSlide 0.5s ease both;
}
@keyframes milestoneSlide {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Smooth vibe picker interaction ────────────────────── */
#moodPicker button {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
#moodPicker button:active {
  transform: scale(0.7) !important;
}

/* ── Premium section dividers ──────────────────────────── */
.shop-category-header {
  position: relative;
  overflow: hidden;
}
.shop-category-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--warm-accent), transparent);
}

/* ── Smooth accordion expand ───────────────────────────── */
.qa-collapsible {
  transition: max-height 0.3s ease, opacity 0.3s ease !important;
  overflow: hidden;
}
.qa-collapsed .qa-collapsible {
  max-height: 0 !important;
  opacity: 0 !important;
}

/* ── Premium badge glow ────────────────────────────────── */
.nav-badge {
  animation: badgeGlow 2s ease-in-out infinite !important;
}
@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}

/* ── Pull-to-Refresh — kept for reference but not active ── */

/* ── Smooth Number Counter Transitions ─────────────────── */
.counter-animate {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease;
}
.counter-animate--up {
  animation: counterUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.counter-animate--down {
  animation: counterDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes counterUp {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes counterDown {
  0% { transform: translateY(-8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ── Double-tap to ❤️ heart overlay ─────────────────────── */
.double-tap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 5rem;
  pointer-events: none;
  z-index: 100;
  animation: heartBurst 0.9s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards;
  filter: drop-shadow(0 4px 20px rgba(231, 76, 60, 0.5));
}
@keyframes heartBurst {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 1; }
  25% { transform: translate(-50%, -50%) scale(1.3) rotate(5deg); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.2) rotate(0deg); opacity: 0; }
}

/* ── Emoji Reaction Pop + Scale ────────────────────────── */
.reaction-pop {
  animation: reactionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@keyframes reactionPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.5) rotate(-8deg); }
  60% { transform: scale(0.85) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── Emoji Rain (gifts & drops celebration) ────────────── */
.emoji-rain {
  position: fixed;
  top: -40px;
  pointer-events: none;
  z-index: 99999;
  animation: emojiRainFall linear forwards;
  will-change: transform;
}
@keyframes emojiRainFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(0.6);
    opacity: 1;
  }
  20% {
    opacity: 1;
    transform: translateY(20vh) translateX(var(--drift, 10px)) rotate(60deg) scale(1);
  }
  80% {
    opacity: 0.8;
    transform: translateY(80vh) translateX(calc(var(--drift, 10px) * -0.5)) rotate(280deg) scale(0.9);
  }
  100% {
    transform: translateY(105vh) translateX(var(--drift, 10px)) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

/* ── Gift received card glow entrance ──────────────────── */
.gift-received-glow {
  animation: giftGlow 1.5s ease-out;
}
@keyframes giftGlow {
  0% { box-shadow: 0 0 0 0 rgba(181, 112, 58, 0.6), 0 4px 20px rgba(0,0,0,0.15); }
  30% { box-shadow: 0 0 30px 10px rgba(181, 112, 58, 0.3), 0 4px 20px rgba(0,0,0,0.15); }
  100% { box-shadow: 0 0 0 0 rgba(181, 112, 58, 0), 0 4px 20px rgba(0,0,0,0.15); }
}

/* ── Drop received card entrance ───────────────────────── */
.drop-received-entrance {
  animation: dropEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dropEntrance {
  0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
