/* =========================================
   MoodAI - AI Mood Tracker | styles.css  (v2 – Aurora Neon)
   ========================================= */

/* ---- Google Fonts extra weight ---- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Backgrounds */
  --bg-dark:        #04040f;
  --bg-card:        rgba(255,255,255,0.045);
  --bg-card-hover:  rgba(255,255,255,0.075);
  --border:         rgba(255,255,255,0.09);
  --border-bright:  rgba(255,255,255,0.2);

  /* Text */
  --text-primary:   #eef0ff;
  --text-secondary: rgba(220,225,255,0.65);
  --text-muted:     rgba(200,210,255,0.38);

  /* ── Vibrant Palette ── */
  --violet:   #c084fc;   /* was purple */
  --cyan:     #22d3ee;   /* was blue  */
  --magenta:  #f472b6;
  --lime:     #a3e635;
  --amber:    #fbbf24;
  --rose:     #fb7185;
  --indigo:   #818cf8;

  /* Gradients */
  --grad:        linear-gradient(135deg, #c084fc 0%, #22d3ee 100%);
  --grad-warm:   linear-gradient(135deg, #f472b6 0%, #fbbf24 100%);
  --grad-green:  linear-gradient(135deg, #a3e635 0%, #22d3ee 100%);
  --grad-sunset: linear-gradient(135deg, #fb7185 0%, #c084fc 50%, #22d3ee 100%);
  --grad-gold:   linear-gradient(135deg, #fbbf24 0%, #fb7185 100%);

  /* Glows */
  --glow-violet:  rgba(192,132,252,0.22);
  --glow-cyan:    rgba(34,211,238,0.18);
  --glow-magenta: rgba(244,114,182,0.18);

  /* Shadow */
  --shadow:      0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 60px var(--glow-violet);

  --radius:    22px;
  --radius-sm: 14px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   ANIMATED BACKGROUND
   ============================================= */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  animation: orbFloat 14s ease-in-out infinite;
}

.orb-1 { width: 700px; height: 700px; background: radial-gradient(circle, #c084fc, #818cf8);  top: -250px; left: -180px; animation-delay: 0s; }
.orb-2 { width: 550px; height: 550px; background: radial-gradient(circle, #22d3ee, #06b6d4);  top: 25%;  right: -200px; animation-delay: -5s; }
.orb-3 { width: 450px; height: 450px; background: radial-gradient(circle, #f472b6, #fbbf24);  bottom: 5%; left: 15%;  animation-delay: -9s; }
.orb-4 { width: 350px; height: 350px; background: radial-gradient(circle, #a3e635, #22d3ee);  bottom: -130px; right: 8%; animation-delay: -2s; }
.orb-5 { width: 280px; height: 280px; background: radial-gradient(circle, #fb7185, #c084fc);  top: 50%; left: 45%; animation-delay: -7s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
  33%       { transform: translateY(-50px) scale(1.06) rotate(2deg); }
  66%       { transform: translateY(20px) scale(0.97) rotate(-1deg); }
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ---- Particles Canvas ---- */
#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(4, 4, 15, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0 28px;
  height: 74px;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192,132,252,0.5), rgba(34,211,238,0.5), transparent);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon svg { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(192,132,252,0.6)); }

.logo-text {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.8px;
}

.logo-ai {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-btn {
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%; right: 50%;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(192,132,252,0.2);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-btn.active {
  background: rgba(192,132,252,0.12);
  border-color: rgba(192,132,252,0.35);
  color: var(--violet);
}

.nav-btn.active::after { left: 20%; right: 20%; }

.header-streak {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.22);
  border-radius: 50px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(251,191,36,0.06);
  transition: var(--transition);
}

.header-streak:hover { box-shadow: 0 0 28px rgba(251,191,36,0.14); }

.streak-fire { font-size: 1.15rem; animation: fireFlicker 1.5s ease-in-out infinite alternate; }

@keyframes fireFlicker {
  0%   { filter: brightness(1);   transform: scale(1); }
  100% { filter: brightness(1.3); transform: scale(1.1) rotate(5deg); }
}

.streak-count { font-size: 1.1rem; font-weight: 800; color: var(--amber); }
.streak-label { font-size: 0.75rem; color: var(--text-muted); }

/* =============================================
   MAIN & SECTIONS
   ============================================= */
.main {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 100px 24px 64px;
}

.section { display: none; }
.section.active { display: block; }

/* ---- Glass Card ---- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* Subtle inner shimmer */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(192,132,252,0.18);
  box-shadow: var(--shadow), 0 0 60px var(--glow-violet);
  transform: translateY(-2px);
}

/* ---- Section Titles ---- */
.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.section-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Animations ---- */
.animate-in {
  opacity: 0;
  transform: translateY(28px);
  animation: fadeSlideIn 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.22s; }
.delay-3 { animation-delay: 0.34s; }

@keyframes fadeSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   GREETING CARD
   ============================================= */
.greeting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: linear-gradient(135deg,
    rgba(192,132,252,0.1) 0%,
    rgba(34,211,238,0.06) 60%,
    rgba(244,114,182,0.05) 100%);
  border-color: rgba(192,132,252,0.22);
  box-shadow: var(--shadow), 0 0 80px rgba(192,132,252,0.08);
}

.greeting-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.greeting-title {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -1px;
}

.greeting-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  max-width: 380px;
  line-height: 1.6;
}

.greeting-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(192,132,252,0.08);
  border: 1px solid rgba(192,132,252,0.18);
  border-radius: 50px;
  padding: 5px 16px;
  display: inline-block;
  letter-spacing: 0.3px;
}

.current-mood-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.mood-ring {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
}

.mood-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(#c084fc, #22d3ee, #f472b6, #a3e635, #c084fc);
  z-index: -1;
  opacity: 0.6;
  animation: rotateBorder 5s linear infinite;
}

.mood-ring::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(#c084fc, #22d3ee, #f472b6, #a3e635, #c084fc);
  z-index: -2;
  opacity: 0.12;
  filter: blur(8px);
  animation: rotateBorder 5s linear infinite reverse;
}

@keyframes rotateBorder { to { transform: rotate(360deg); } }

.mood-emoji-large {
  font-size: 3.2rem;
  animation: floatEmoji 3.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(192,132,252,0.4));
}

@keyframes floatEmoji {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-8px) scale(1.05); }
}

.mood-preview-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
}

/* =============================================
   MOOD GRID
   ============================================= */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 14px;
}

.mood-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 22px 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.mood-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--mood-color, rgba(192,132,252,0.4)) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mood-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mood-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(192,132,252,0.4);
  box-shadow: 0 14px 32px rgba(192,132,252,0.18);
}

.mood-item:hover::before { opacity: 1; }
.mood-item:hover::after  { opacity: 1; }

.mood-item.selected {
  border-color: var(--violet);
  background: rgba(192,132,252,0.13);
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 12px 32px rgba(192,132,252,0.3), 0 0 0 1px rgba(192,132,252,0.3);
}

.mood-item.selected::before { opacity: 1; }
.mood-item.selected::after  { opacity: 1; }

.mood-emoji { font-size: 2.3rem; transition: transform 0.25s ease; position: relative; z-index: 1; }
.mood-item:hover .mood-emoji    { transform: scale(1.2) rotate(5deg); }
.mood-item.selected .mood-emoji { transform: scale(1.25); filter: drop-shadow(0 4px 10px rgba(192,132,252,0.5)); }

.mood-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  position: relative;
  z-index: 1;
  letter-spacing: 0.3px;
}

.mood-item.selected .mood-name { color: var(--violet); }

/* =============================================
   INTENSITY SLIDER
   ============================================= */
.intensity-wrapper { margin-bottom: 30px; }

.intensity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.intensity-slider {
  width: 100%;
  height: 9px;
  border-radius: 12px;
  background: linear-gradient(to right, #c084fc, #22d3ee);
  outline: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 0 16px rgba(192,132,252,0.3);
}

.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 3px rgba(192,132,252,0.4), 0 4px 12px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.intensity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 5px rgba(192,132,252,0.3), 0 0 20px rgba(192,132,252,0.5);
}

.intensity-value-display {
  text-align: center;
  margin-top: 14px;
}

#intensity-value {
  font-size: 2.4rem;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.intensity-unit { font-size: 1rem; color: var(--text-muted); }

/* =============================================
   TAGS
   ============================================= */
.tags-section, .tags-title { margin-bottom: 14px; }
.tags-title { font-size: 1rem; font-weight: 700; color: var(--text-secondary); }

.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.tag-chip {
  padding: 8px 18px;
  border-radius: 50px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.2px;
}

.tag-chip:hover {
  border-color: var(--violet);
  color: var(--violet);
  background: rgba(192,132,252,0.08);
  transform: translateY(-2px);
}

.tag-chip.selected {
  background: rgba(192,132,252,0.15);
  border-color: var(--violet);
  color: var(--violet);
  box-shadow: 0 4px 14px rgba(192,132,252,0.2);
}

/* =============================================
   TEXTAREA & NOTE
   ============================================= */
.note-section { margin-bottom: 26px; }
.note-title { font-size: 1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; }
.optional { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }

.mood-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: var(--transition);
  line-height: 1.65;
}

.mood-textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(192,132,252,0.1), 0 0 20px rgba(192,132,252,0.08);
}
.mood-textarea::placeholder { color: var(--text-muted); }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 36px;
  background: var(--grad-sunset);
  border: none;
  border-radius: 50px;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(192,132,252,0.4);
  letter-spacing: 0.3px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transition: var(--transition);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50px;
  background: var(--grad-sunset);
  filter: blur(12px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(192,132,252,0.55);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover::after  { opacity: 0.5; }
.btn-primary:active { transform: translateY(0); }

.btn-icon { font-size: 1.1rem; }

.btn-ghost {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover {
  border-color: var(--violet);
  color: var(--violet);
  background: rgba(192,132,252,0.08);
  box-shadow: 0 4px 16px rgba(192,132,252,0.12);
}

/* =============================================
   TODAY'S ENTRY ITEMS
   ============================================= */
.entry-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: var(--transition);
}

.entry-item:hover {
  border-color: rgba(192,132,252,0.25);
  box-shadow: 0 6px 24px rgba(192,132,252,0.1);
  transform: translateX(4px);
}

.entry-emoji { font-size: 1.9rem; }

.entry-info { flex: 1; }
.entry-mood { font-size: 1rem; font-weight: 800; }
.entry-meta { font-size: 0.76rem; color: var(--text-muted); margin-top: 3px; }
.entry-note { font-size: 0.85rem; color: var(--text-secondary); margin-top: 7px; font-style: italic; }

.entry-intensity { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.intensity-badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 14px rgba(192,132,252,0.35);
}

/* =============================================
   CALENDAR
   ============================================= */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.cal-nav {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.cal-nav:hover {
  border-color: var(--violet);
  color: var(--violet);
  box-shadow: 0 4px 16px rgba(192,132,252,0.2);
  transform: scale(1.1);
}

.cal-month { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.2px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-card-hover);
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: default;
  position: relative;
}

.cal-day.has-mood { border-color: rgba(255,255,255,0.08); cursor: pointer; }
.cal-day.has-mood:hover {
  border-color: var(--violet);
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(192,132,252,0.2);
}

.cal-day.today {
  border-color: var(--violet);
  color: var(--violet);
  font-weight: 800;
  background: rgba(192,132,252,0.1);
  box-shadow: 0 0 14px rgba(192,132,252,0.2);
}

.cal-day.empty { background: transparent; border: none; }
.cal-emoji { font-size: 1.1rem; }

/* =============================================
   HISTORY LIST
   ============================================= */
.history-list { display: flex; flex-direction: column; gap: 12px; }

.history-entry {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.history-entry:hover {
  border-color: rgba(192,132,252,0.22);
  transform: translateX(5px);
  box-shadow: 0 6px 24px rgba(192,132,252,0.08);
}

.history-emoji-wrap { font-size: 2.1rem; }
.history-content { flex: 1; }
.history-mood-name { font-size: 1rem; font-weight: 800; }
.history-date { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.history-note { font-size: 0.85rem; color: var(--text-secondary); margin-top: 7px; }

.history-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.history-tag {
  padding: 3px 12px;
  border-radius: 50px;
  background: rgba(192,132,252,0.1);
  border: 1px solid rgba(192,132,252,0.22);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--violet);
}

/* =============================================
   STATS ROW
   ============================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px;
  margin-bottom: 0;
  transition: var(--transition);
}

.stat-card:nth-child(1) { --card-glow: var(--glow-violet); border-color: rgba(192,132,252,0.14); }
.stat-card:nth-child(2) { --card-glow: var(--glow-cyan);   border-color: rgba(34,211,238,0.12); }
.stat-card:nth-child(3) { --card-glow: var(--glow-magenta);border-color: rgba(244,114,182,0.12); }
.stat-card:nth-child(4) { --card-glow: rgba(163,230,53,0.14); border-color: rgba(163,230,53,0.12); }

.stat-card:hover { box-shadow: var(--shadow), 0 0 40px var(--card-glow, var(--glow-violet)); }

.stat-icon {
  font-size: 2.3rem;
  width: 58px; height: 58px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-label { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; letter-spacing: 0.3px; }
.stat-value { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; }

/* =============================================
   CHARTS
   ============================================= */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card { margin-bottom: 0; }
.chart-wrapper { position: relative; height: 250px; }

/* =============================================
   TAGS INSIGHT
   ============================================= */
.tags-insight { display: flex; flex-wrap: wrap; gap: 14px; }

.tag-insight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: var(--transition);
}

.tag-insight-item:hover {
  border-color: rgba(192,132,252,0.3);
  box-shadow: 0 4px 16px rgba(192,132,252,0.12);
}

.tag-insight-bar-wrap { width: 80px; height: 6px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; }
.tag-insight-bar { height: 100%; background: var(--grad); border-radius: 10px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }
.tag-insight-name { font-size: 0.85rem; font-weight: 600; }
.tag-insight-count { font-size: 0.75rem; color: var(--text-muted); }

/* =============================================
   AI SECTION
   ============================================= */
.ai-hero {
  display: flex;
  align-items: center;
  gap: 30px;
  background: linear-gradient(135deg,
    rgba(192,132,252,0.1) 0%,
    rgba(34,211,238,0.06) 60%,
    rgba(244,114,182,0.05) 100%);
  border-color: rgba(192,132,252,0.22);
  box-shadow: var(--shadow), 0 0 80px rgba(192,132,252,0.1);
}

.ai-avatar {
  position: relative;
  width: 84px; height: 84px;
  flex-shrink: 0;
}

.ai-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.25;
  animation: aiPulse 2.8s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1);   opacity: 0.25; }
  50%       { transform: scale(1.2); opacity: 0.1; }
}

.ai-icon {
  position: relative;
  width: 84px; height: 84px;
  background: rgba(192,132,252,0.14);
  border: 1px solid rgba(192,132,252,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  box-shadow: 0 0 30px rgba(192,132,252,0.2);
}

.ai-title { font-size: 2rem; font-weight: 900; margin-bottom: 10px; letter-spacing: -0.5px; }
.ai-sub { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; }

/* =============================================
   AFFIRMATION
   ============================================= */
.affirmation-card {
  text-align: center;
  background: linear-gradient(135deg,
    rgba(251,113,133,0.08) 0%,
    rgba(192,132,252,0.07) 50%,
    rgba(251,191,36,0.06) 100%);
  border-color: rgba(251,113,133,0.2);
}

.affirmation-label {
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 18px;
  display: block;
}

.affirmation-text {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 22px;
  font-style: italic;
}

/* =============================================
   CHAT
   ============================================= */
.chat-card { background: var(--bg-card); }

.chat-messages {
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 0;
  margin-bottom: 20px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  animation: fadeSlideIn 0.3s ease;
}

.chat-msg.user-msg { flex-direction: row-reverse; }

.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(192,132,252,0.12);
  border: 1px solid rgba(192,132,252,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-bubble {
  max-width: 75%;
  padding: 13px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  line-height: 1.65;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.user-msg .chat-bubble {
  background: rgba(192,132,252,0.14);
  border-color: rgba(192,132,252,0.25);
  color: var(--text-primary);
}

.typing-bubble { display: flex; gap: 5px; align-items: center; padding: 14px 18px; }
.typing-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--violet);
  animation: typingBounce 1.3s infinite;
  opacity: 0.7;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-9px); } }

.chat-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 15px 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(192,132,252,0.1), 0 0 20px rgba(192,132,252,0.06);
}
.chat-input::placeholder { color: var(--text-muted); }

.btn-send {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(192,132,252,0.4);
}

.btn-send svg { width: 18px; height: 18px; stroke: white; }
.btn-send:hover {
  transform: scale(1.12) rotate(-5deg);
  box-shadow: 0 8px 28px rgba(192,132,252,0.55);
}

/* =============================================
   WELLNESS TIPS
   ============================================= */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tip-item {
  padding: 22px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tip-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.3s;
}

.tip-item:hover {
  border-color: rgba(192,132,252,0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(192,132,252,0.1);
}

.tip-item:hover::before { opacity: 1; }

.tip-icon { font-size: 1.9rem; margin-bottom: 13px; }
.tip-title { font-size: 0.95rem; font-weight: 800; margin-bottom: 7px; }
.tip-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.65; }

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: 36px; right: 36px;
  padding: 15px 26px;
  background: rgba(20,20,40,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(192,132,252,0.25);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transform: translateY(90px);
  opacity: 0;
  transition: var(--transition);
  box-shadow: var(--shadow), 0 0 30px rgba(192,132,252,0.12);
}

.toast.show { transform: translateY(0); opacity: 1; }

/* =============================================
   SUCCESS OVERLAY
   ============================================= */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,4,15,0.85);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.success-overlay.active { display: flex; }

.success-card {
  background: linear-gradient(135deg, rgba(192,132,252,0.08), rgba(34,211,238,0.06));
  border: 1px solid rgba(192,132,252,0.25);
  border-radius: var(--radius);
  padding: 56px 52px;
  text-align: center;
  max-width: 400px;
  animation: successPop 0.55s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow), 0 0 80px rgba(192,132,252,0.25);
}

@keyframes successPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-emoji {
  font-size: 4.5rem;
  margin-bottom: 22px;
  display: block;
  animation: bounceIn 0.55s ease 0.2s both;
  filter: drop-shadow(0 8px 20px rgba(192,132,252,0.4));
}

@keyframes bounceIn {
  from { transform: scale(0) rotate(-20deg); }
  60%  { transform: scale(1.25) rotate(5deg); }
  to   { transform: scale(1) rotate(0deg); }
}

.success-title { font-size: 1.9rem; font-weight: 900; margin-bottom: 10px; }
.success-sub { color: var(--text-secondary); margin-bottom: 30px; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,132,252,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(192,132,252,0.5); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .header-inner   { gap: 12px; }
  .nav            { display: none; }
  .greeting-card  { flex-direction: column; }
  .greeting-title { font-size: 1.75rem; }
  .charts-row     { grid-template-columns: 1fr; }
  .stats-row      { grid-template-columns: 1fr 1fr; }
  .main           { padding: 92px 16px 44px; }
  .glass-card     { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .stats-row       { grid-template-columns: 1fr; }
  .mood-grid       { grid-template-columns: repeat(3, 1fr); }
  .greeting-right  { display: none; }
}

/* =============================================
   GAME STYLES
   ============================================= */

.chat-widget {
  padding: 0 0 16px 54px;
  animation: fadeSlideIn 0.4s ease forwards;
}

/* ---- Game Menu ---- */
.game-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 460px;
}

.game-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  background: rgba(192,132,252,0.07);
  border: 1px solid rgba(192,132,252,0.22);
  border-radius: 16px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.game-btn:hover:not(:disabled) {
  background: rgba(192,132,252,0.16);
  border-color: rgba(192,132,252,0.48);
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(192,132,252,0.22);
}

.game-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.game-btn-icon { font-size: 1.9rem; line-height: 1; flex-shrink: 0; }

.game-btn-info { display: flex; flex-direction: column; gap: 2px; }
.game-btn-name { font-size: 0.9rem; font-weight: 800; color: var(--text-primary); }
.game-btn-desc { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.3; }

/* ---- Trivia Options ---- */
.trivia-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 460px;
}

.trivia-opt {
  padding: 13px 20px;
  background: rgba(34,211,238,0.06);
  border: 1px solid rgba(34,211,238,0.18);
  border-radius: 13px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.trivia-opt:hover:not(:disabled) {
  background: rgba(34,211,238,0.14);
  border-color: rgba(34,211,238,0.42);
  transform: translateX(5px);
}

.trivia-opt:disabled { cursor: not-allowed; }

.trivia-opt.correct {
  background: rgba(163,230,53,0.14) !important;
  border-color: #a3e635 !important;
  color: #a3e635 !important;
  font-weight: 800;
}

.trivia-opt.wrong {
  background: rgba(251,113,133,0.12) !important;
  border-color: #fb7185 !important;
  color: #fb7185 !important;
}

/* ---- Fortune Card ---- */
.fortune-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 26px;
  background: linear-gradient(135deg, rgba(192,132,252,0.1), rgba(244,114,182,0.08));
  border: 1px solid rgba(192,132,252,0.28);
  border-radius: 22px;
  max-width: 380px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(192,132,252,0.1);
}

.fortune-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(192,132,252,0.18), transparent 60%);
  pointer-events: none;
}

.fortune-orb {
  font-size: 3.8rem;
  animation: fortuneFloat 3.5s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(192,132,252,0.7));
  position: relative;
  z-index: 1;
}

@keyframes fortuneFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-12px) rotate(6deg); }
}

.fortune-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.75;
  font-style: italic;
  letter-spacing: 0.2px;
  position: relative;
  z-index: 1;
}

.fortune-again {
  padding: 11px 26px;
  background: linear-gradient(135deg, rgba(192,132,252,0.18), rgba(244,114,182,0.14));
  border: 1px solid rgba(192,132,252,0.38);
  border-radius: 50px;
  color: var(--violet);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.fortune-again:hover:not(:disabled) {
  background: rgba(192,132,252,0.28);
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(192,132,252,0.3);
}

.fortune-again:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Game Result ---- */
.game-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 26px;
  background: linear-gradient(135deg, rgba(163,230,53,0.08), rgba(34,211,238,0.06));
  border: 1px solid rgba(163,230,53,0.22);
  border-radius: 22px;
  max-width: 360px;
  text-align: center;
}

.game-result-medal {
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--grad-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: scorePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.game-result-score {
  font-size: 3.8rem;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: scorePop 0.7s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  line-height: 1;
}

@keyframes scorePop {
  0%   { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1); }
}

.game-result-label { font-size: 0.82rem; color: var(--text-muted); margin-top: -6px; }

.game-result-btn {
  padding: 12px 30px;
  background: var(--grad);
  border: none;
  border-radius: 50px;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  box-shadow: 0 6px 20px rgba(192,132,252,0.35);
}

.game-result-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(192,132,252,0.5);
}

.game-result-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}

.game-result-btn.ghost:hover:not(:disabled) {
  border-color: var(--violet);
  color: var(--violet);
  background: rgba(192,132,252,0.08);
}

.game-result-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
