/* frontend/components/vibes/vibes.css — Vibes الفنية الـ12 ✦
 * كل vibe له لون CSS مُعرّف + حركة خفيفة.
 * استعمل: .vibe-aura .vibe-svg ضمن أي حاوية.
 */

/* ── ألوان الـ12 vibe (CSS variables) ── */
:root {
  --vibe-grateful:    #D4A574;
  --vibe-reflective:  #5C5C8A;
  --vibe-sad:         #4A6B8A;
  --vibe-joyful:      #E8C547;
  --vibe-tired:       #A8A29E;
  --vibe-passionate:  #D4732E;
  --vibe-confused:    #8B8378;
  --vibe-serene:      #A8C5D6;
  --vibe-dreamer:     #8E7AB5;
  --vibe-longing:     #C97B84;
  --vibe-balanced:    #8B6F47;
  --vibe-awaiting:    #E8B57F;
}

/* ── SVG الأساسي ── */
.vibe-svg {
  display: block;
  width: 100%;
  height: 100%;
  color: currentColor;
}

/* ── الـ aura (هالة حول avatar) ── */
.vibe-aura {
  position: relative;
}
.vibe-aura::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--aura-color, currentColor);
  opacity: 0.55;
  animation: vibeAuraPulse 4s ease-in-out infinite;
  pointer-events: none;
}
.vibe-aura.size-lg::before { inset: -6px; border-width: 3px; }
.vibe-aura.size-xl::before { inset: -8px; border-width: 3px; }

@keyframes vibeAuraPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(1.04); }
}

.vibe-aura.aura-grateful   { --aura-color: var(--vibe-grateful);   color: var(--vibe-grateful);   }
.vibe-aura.aura-reflective { --aura-color: var(--vibe-reflective); color: var(--vibe-reflective); }
.vibe-aura.aura-sad        { --aura-color: var(--vibe-sad);        color: var(--vibe-sad);        }
.vibe-aura.aura-joyful     { --aura-color: var(--vibe-joyful);     color: var(--vibe-joyful);     }
.vibe-aura.aura-tired      { --aura-color: var(--vibe-tired);      color: var(--vibe-tired);      }
.vibe-aura.aura-passionate { --aura-color: var(--vibe-passionate); color: var(--vibe-passionate); }
.vibe-aura.aura-confused   { --aura-color: var(--vibe-confused);   color: var(--vibe-confused);   }
.vibe-aura.aura-serene     { --aura-color: var(--vibe-serene);     color: var(--vibe-serene);     }
.vibe-aura.aura-dreamer    { --aura-color: var(--vibe-dreamer);    color: var(--vibe-dreamer);    }
.vibe-aura.aura-longing    { --aura-color: var(--vibe-longing);    color: var(--vibe-longing);    }
.vibe-aura.aura-balanced   { --aura-color: var(--vibe-balanced);   color: var(--vibe-balanced);   }
.vibe-aura.aura-awaiting   { --aura-color: var(--vibe-awaiting);   color: var(--vibe-awaiting);   }

/* ── الحركات الخفيفة لكل vibe ── */

/* grateful — نبض كل 4 ثوانٍ */
.vibe-grateful .vibe-anim-pulse {
  transform-origin: 32px 32px;
  animation: vibeGratefulPulse 4s ease-in-out infinite;
}
@keyframes vibeGratefulPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.98); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

/* reflective — دوائر تتمدد ببطء */
.vibe-reflective .vibe-anim-expand-1,
.vibe-reflective .vibe-anim-expand-2,
.vibe-reflective .vibe-anim-expand-3 {
  transform-origin: 32px 32px;
  animation: vibeReflectiveExpand 6s ease-in-out infinite;
}
.vibe-reflective .vibe-anim-expand-2 { animation-delay: 0.6s; }
.vibe-reflective .vibe-anim-expand-3 { animation-delay: 1.2s; }
@keyframes vibeReflectiveExpand {
  0%   { transform: scale(0.8); opacity: 0.2; }
  50%  { opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* sad — قطرة تتشكّل كل 6 ثوانٍ */
.vibe-sad .vibe-anim-drop {
  transform-origin: 32px 32px;
  animation: vibeSadDrop 6s ease-in-out infinite;
}
@keyframes vibeSadDrop {
  0%, 30% { transform: translateY(-2px); opacity: 0.85; }
  60%     { transform: translateY(2px);  opacity: 1; }
  100%    { transform: translateY(-2px); opacity: 0.85; }
}

/* joyful — لمعان خفيف */
.vibe-joyful .vibe-anim-shine {
  animation: vibeJoyShine 3s ease-in-out infinite;
}
@keyframes vibeJoyShine {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.25); }
}

/* tired — حركة بطيئة للموجة */
.vibe-tired .vibe-anim-wave {
  animation: vibeTiredWave 5s ease-in-out infinite;
  transform-origin: 32px 32px;
}
.vibe-tired .vibe-anim-wave-2 {
  animation: vibeTiredWave 5s ease-in-out infinite reverse;
  animation-delay: 0.5s;
}
@keyframes vibeTiredWave {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-2px); }
}

/* passionate — لهب يتذبذب */
.vibe-passionate .vibe-anim-flicker {
  transform-origin: 32px 50px;
  animation: vibePassionFlicker 1.6s ease-in-out infinite;
}
@keyframes vibePassionFlicker {
  0%, 100% { transform: scaleY(1)    rotate(-1deg); }
  25%      { transform: scaleY(1.04) rotate( 1deg); }
  50%      { transform: scaleY(0.97) rotate(-0.5deg); }
  75%      { transform: scaleY(1.02) rotate( 0.5deg); }
}

/* confused — اهتزاز رقيق */
.vibe-confused .vibe-anim-jitter {
  animation: vibeConfusedJitter 2.5s ease-in-out infinite;
}
@keyframes vibeConfusedJitter {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(0.6px, -0.4px); }
  40%      { transform: translate(-0.5px, 0.3px); }
  60%      { transform: translate(0.4px, 0.4px); }
  80%      { transform: translate(-0.3px, -0.5px); }
}

/* serene — ثابت تماماً (سكون) */

/* dreamer — نقاط تتلألأ */
.vibe-dreamer .vibe-anim-twinkle circle {
  animation: vibeDreamerTwinkle 3s ease-in-out infinite;
}
.vibe-dreamer .t1 { animation-delay: 0.0s; }
.vibe-dreamer .t2 { animation-delay: 0.3s; }
.vibe-dreamer .t3 { animation-delay: 0.6s; }
.vibe-dreamer .t4 { animation-delay: 0.9s; }
.vibe-dreamer .t5 { animation-delay: 1.2s; }
.vibe-dreamer .t6 { animation-delay: 1.5s; }
.vibe-dreamer .t7 { animation-delay: 1.8s; }
.vibe-dreamer .t8 { animation-delay: 2.1s; }
@keyframes vibeDreamerTwinkle {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* longing — يدان تمتد ببطء */
.vibe-longing .vibe-anim-reach {
  animation: vibeLonging 5s ease-in-out infinite;
  transform-origin: 32px 50px;
}
@keyframes vibeLonging {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.06); }
}

/* balanced — ثابت متين (لا حركة، فقط نبض خفيف للجذور) */

/* awaiting — ضوء يتسلل */
.vibe-awaiting .vibe-anim-dawn {
  animation: vibeDawn 5s ease-in-out infinite;
}
@keyframes vibeDawn {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* تقليل الحركة (احترام prefers-reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  .vibe-svg *,
  .vibe-aura::before {
    animation: none !important;
  }
}

/* ── Vibes Stripe (الشريط العلوي في الرئيسية) ── */
.vibes-stripe {
  display: flex;
  gap: 16px;
  padding: 14px 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.vibes-stripe::-webkit-scrollbar { display: none; }

.vibes-stripe-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  scroll-snap-align: start;
  min-width: 72px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

.vibes-stripe-item .huna-avatar {
  --avatar-size: 64px;
}

.vibes-stripe-handle {
  font-size: 12px;
  color: var(--ink-light, #6b6b6b);
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.vibes-stripe-vibe-name {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1;
}

/* ── My Vibe pill (في top bar أو cta) ── */
.my-vibe-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  font: inherit;
}
.my-vibe-pill .vibe-svg-mini {
  width: 20px;
  height: 20px;
}

/* ── Vibe selector grid ── */
.vibe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.vibe-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 200ms ease, transform 200ms ease;
}
.vibe-grid-item:hover {
  transform: translateY(-2px);
  border-color: var(--vibe-color, currentColor);
}
.vibe-grid-item.is-selected {
  border-color: var(--vibe-color, currentColor);
  background: rgba(255,255,255,0.95);
}
.vibe-grid-item .vibe-svg-wrap {
  width: 56px;
  height: 56px;
}
.vibe-grid-item-label {
  font-size: 13px;
  color: var(--ink, #333);
  font-weight: 500;
}
