/* ═══════════════════════════════════════════════════════ */
/*  SCENT ORB — Floating Glass Droplet UI Component       */
/* ═══════════════════════════════════════════════════════ */

/* ─── BREATHING FLOAT KEYFRAME ──────────────────────── */
@keyframes scent-orb-float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-6px); }
}

/* ─── SHIMMER ROTATION ──────────────────────────────── */
@keyframes scent-orb-shimmer {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ─── GLOW PULSE ────────────────────────────────────── */
@keyframes scent-orb-glow-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.7; }
}

/* ─── CLICK RIPPLE ──────────────────────────────────── */
@keyframes scent-orb-ripple {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ─── CONTAINER ─────────────────────────────────────── */
.scent-orb {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;

  /* Breathing float */
  animation: scent-orb-float 4s ease-in-out infinite;

  /* Reset */
  border: none;
  outline: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: transparent;

  /* No text selection */
  user-select: none;
  -webkit-user-select: none;
}

/* ─── INNER ORB (the glass bead) ────────────────────── */
.scent-orb__bead {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 100px;
  overflow: hidden;

  /* Richer gold/beige gradient */
  background: linear-gradient(145deg, #ecd8c0, #dcb793);

  /* Glass effect */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Border: translucent white edge */
  border: 1px solid rgba(255, 255, 255, 0.4);

  /* Outer shadow */
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -1px 3px rgba(0, 0, 0, 0.04);

  /* Liquid-feel transition */
  transition:
    width 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-radius 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── NOISE TEXTURE OVERLAY ─────────────────────────── */
.scent-orb__bead::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  pointer-events: none;
  z-index: 2;
}

/* ─── GLASS HIGHLIGHT (radial reflection) ───────────── */
.scent-orb__bead::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 8px;
  width: 18px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.4s ease;
}

/* ─── INNER GLOW LAYER ──────────────────────────────── */
.scent-orb__glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(220, 183, 147, 0.45) 0%,
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
  animation: scent-orb-glow-pulse 4s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

/* ─── SHIMMER (slow rotating highlight) ─────────────── */
.scent-orb__shimmer {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.12) 40deg,
    transparent 80deg,
    transparent 360deg
  );
  animation: scent-orb-shimmer 8s linear infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

/* ─── TEXT LABEL ─────────────────────────────────────── */
.scent-orb__text {
  position: relative;
  z-index: 4;
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  color: #3a342f;
  letter-spacing: 0.02em;
  white-space: nowrap;

  /* Hidden by default */
  opacity: 0;
  filter: blur(4px);
  transform: translateX(-4px);
  transition:
    opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0.08s,
    filter 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0.08s,
    transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0.08s;

  pointer-events: none;
}

/* ─── CLICK RIPPLE ELEMENT ──────────────────────────── */
.scent-orb__ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(158, 140, 120, 0.3);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.scent-orb__ripple.is-active {
  animation: scent-orb-ripple 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* ═══════════════════════════════════════════════════════ */
/*  HOVER STATE (Desktop)                                 */
/* ═══════════════════════════════════════════════════════ */
@media (hover: hover) and (pointer: fine) {
  .scent-orb:hover .scent-orb__bead {
    width: 152px;
    border-radius: 100px;
    transform: scale(1.08);
    box-shadow:
      0 15px 40px rgba(0, 0, 0, 0.2),
      0 5px 15px rgba(0, 0, 0, 0.12),
      0 0 20px rgba(220, 183, 147, 0.5),
      inset 0 1px 3px rgba(255, 255, 255, 0.7),
      inset 0 -1px 4px rgba(0, 0, 0, 0.05);
  }

  .scent-orb:hover .scent-orb__text {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }

  .scent-orb:hover .scent-orb__glow {
    opacity: 1;
  }

  .scent-orb:hover .scent-orb__shimmer {
    opacity: 1;
  }

  /* Shift highlight on pill shape */
  .scent-orb:hover .scent-orb__bead::after {
    width: 30px;
    left: 14px;
  }
}

/* ═══════════════════════════════════════════════════════ */
/*  MOBILE: TAP-EXPANDED STATE                            */
/* ═══════════════════════════════════════════════════════ */
.scent-orb.is-expanded .scent-orb__bead {
  width: 152px;
  border-radius: 100px;
  transform: scale(1.08);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.2),
    0 5px 15px rgba(0, 0, 0, 0.12),
    0 0 20px rgba(220, 183, 147, 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.7),
    inset 0 -1px 4px rgba(0, 0, 0, 0.05);
}

.scent-orb.is-expanded .scent-orb__text {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
}

.scent-orb.is-expanded .scent-orb__glow {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════ */
/*  EXIT ANIMATION                                        */
/* ═══════════════════════════════════════════════════════ */
.scent-orb.is-exiting {
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0;
  transform: translateY(10px) scale(0.85);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════ */
/*  RESPONSIVE — MOBILE                                   */
/* ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .scent-orb {
    bottom: 24px;
    right: 24px;
  }

  .scent-orb__bead {
    width: 44px;
    height: 44px;
  }

  .scent-orb__text {
    font-size: 11.5px;
  }

  .scent-orb.is-expanded .scent-orb__bead,
  .scent-orb:hover .scent-orb__bead {
    width: 136px;
  }
}

/* ═══════════════════════════════════════════════════════ */
/*  PREFERS REDUCED MOTION                                */
/* ═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .scent-orb {
    animation: none;
  }

  .scent-orb__shimmer {
    animation: none;
  }

  .scent-orb__glow {
    animation: none;
  }

  .scent-orb__bead {
    transition-duration: 0.01s;
  }

  .scent-orb__text {
    transition-duration: 0.01s;
    filter: none;
  }
}

/* ═══════════════════════════════════════════════════════ */
/*  HINT INDICATOR                                         */
/* ═══════════════════════════════════════════════════════ */
.orb-hint {
  position: fixed;
  bottom: 85px;
  right: 75px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  animation: orb-hint-float 3s ease-in-out infinite;
  transition: opacity 0.8s ease;
}

.orb-hint.is-visible {
  opacity: 0.85;
}

.orb-hint.is-fading {
  opacity: 0 !important;
}

.orb-hint__text {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-style: italic;
  color: #7a6f66;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transform: translateY(-8px);
}

.orb-hint__arrow {
  display: block;
}

.orb-hint__line {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.orb-hint__head {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.orb-hint.is-drawing .orb-hint__line {
  animation: orb-hint-draw-line 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.orb-hint.is-drawing .orb-hint__head {
  animation: orb-hint-draw-head 0.4s cubic-bezier(0.25, 1, 0.5, 1) 0.8s forwards;
}

@keyframes orb-hint-draw-line {
  to { stroke-dashoffset: 0; }
}

@keyframes orb-hint-draw-head {
  to { stroke-dashoffset: 0; }
}

@keyframes orb-hint-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .orb-hint {
    bottom: 70px;
    right: 55px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb-hint {
    animation: none;
  }
  .orb-hint.is-drawing .orb-hint__line,
  .orb-hint.is-drawing .orb-hint__head {
    animation: none;
    stroke-dashoffset: 0;
  }
}

