/* ===== CSS Variables ===== */
:root {
  /* Spiritual Color Palette - Blues and Golds only */
  --primary-dark: #0a0a1a;
  --primary-mid: #121230;
  --primary-light: #1a1a3e;
  --accent-blue: #4A90D9;
  --accent-blue-light: #6BA3E0;
  --accent-blue-dark: #2563a8;
  --accent-gold: #FFD700;
  --accent-gold-light: #ffe566;
  --accent-gold-dark: #E6B800;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 30px rgba(74, 144, 217, 0.3);
  --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
  
  /* Category Colors - harmonious blues and golds */
  --color-physical: #4A90D9;
  --color-mental: #5B8FCE;
  --color-social: #6BA3E0;
  --color-economical: #FFD700;
  --color-spiritual: #F4C430;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Font */
  --font-primary: 'Quicksand', sans-serif;
  --font-accent: 'Playfair Display', serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-primary);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 50%, var(--primary-light) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ===== Screen Management ===== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility 0s linear 0.3s;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility 0s linear 0s;
}

/* Dashboard screen should never scroll */
#dashboard-screen {
  overflow: hidden !important;
}

/* Screens with FAB - use flex layout */
#goals-screen,
#actions-screen {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#goals-screen .goals-content,
#actions-screen .actions-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* FAB positioning within screen */
#goals-screen .fab,
#actions-screen .fab {
  position: absolute;
  bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
  right: var(--spacing-xl);
}

.screen.slide-out {
  transform: translateX(-20px);
}

/* ===== Loading Screen ===== */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, var(--primary-mid) 0%, var(--primary-dark) 100%);
}

.loading-content {
  text-align: center;
}

.lotus-loader {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--spacing-lg);
  position: relative;
  animation: lotus-bloom 2s ease-in-out infinite;
}

.petal {
  position: absolute;
  width: 30px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  left: 50%;
  top: 50%;
  transform-origin: center bottom;
  opacity: 0.8;
}

.petal:nth-child(1) { transform: translate(-50%, -100%) rotate(0deg); }
.petal:nth-child(2) { transform: translate(-50%, -100%) rotate(60deg); }
.petal:nth-child(3) { transform: translate(-50%, -100%) rotate(120deg); }
.petal:nth-child(4) { transform: translate(-50%, -100%) rotate(180deg); }
.petal:nth-child(5) { transform: translate(-50%, -100%) rotate(240deg); }
.petal:nth-child(6) { transform: translate(-50%, -100%) rotate(300deg); }

@keyframes lotus-bloom {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(30deg); }
}

.app-title {
  font-family: var(--font-accent);
  font-size: 2.5rem;
  font-weight: 400;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--text-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== Login Screen ===== */
.login-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--spacing-xl);
  position: relative;
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
  position: relative;
}

.mandala-bg {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  border-radius: var(--radius-full);
  animation: mandala-rotate 30s linear infinite;
}

@keyframes mandala-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-header h1 {
  font-family: var(--font-accent);
  font-size: 3rem;
  font-weight: 400;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--text-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: var(--spacing-sm);
  position: relative;
  z-index: 1;
}

.login-form {
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
}

.input-group {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.input-group input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-gold);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-glow {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  transition: width var(--transition-normal);
}

.input-group input:focus ~ .input-glow {
  width: 80%;
}

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.btn-secondary {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--glass-border);
  transform: scale(1.05);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== Dashboard ===== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  padding-top: calc(var(--spacing-lg) + env(safe-area-inset-top));
  overflow: visible;
}

.user-greeting {
  display: flex;
  flex-direction: column;
}

.greeting-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.username {
  font-family: var(--font-accent);
  font-size: 1.5rem;
  color: var(--accent-gold);
}

.header-actions {
  display: flex;
  gap: var(--spacing-sm);
  overflow: visible;
  flex-shrink: 0;
}

.dashboard-content {
  padding: var(--spacing-md);
  position: relative;
  height: calc(100% - 80px);
  max-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Particles background */
.dashboard-content::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 215, 0, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(74, 144, 217, 0.3), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 130px 80px, rgba(255, 215, 0, 0.2), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(74, 144, 217, 0.3), transparent);
  background-size: 200px 200px;
  animation: particles-float 20s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes particles-float {
  from { transform: translateY(0); }
  to { transform: translateY(-200px); }
}

/* Overall Score Ring */
.overall-score-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.overall-score {
  position: relative;
  width: 160px;
  height: 160px;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--glass-border);
  stroke-width: 8;
}

.ring-progress {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1s ease-out;
}

.score-value {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.score-number {
  font-family: var(--font-accent);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.2em 0.1em;
  transform: translateY(-0.08em);
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Categories Petal Formation ===== */
.categories-bubble-grid {
  position: relative;
  width: 100%;
  height: calc(100vh - 140px);
  max-height: 580px;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-bubble {
  --bubble-size: 105px;
  --orbit-radius: 175px;
  position: absolute;
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.25),
    inset 0 -4px 16px rgba(0, 0, 0, 0.15),
    inset 0 4px 16px rgba(255, 255, 255, 0.03);
  will-change: transform, box-shadow;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              box-shadow 0.4s ease,
              border-color 0.4s ease;
  backdrop-filter: blur(2px);
}

/* Glow effect behind bubble */
.category-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background: radial-gradient(circle, var(--bubble-color) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.2;
  z-index: -1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Petal positions - 5 petals around center forming a symmetric flower */
/* Using transform to properly center each bubble at its position */
.category-bubble.petal-top {
  top: calc(50% - var(--orbit-radius));
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float-gentle 8s ease-in-out infinite;
}

.category-bubble.petal-top-right {
  top: calc(50% - var(--orbit-radius) * 0.309);
  left: calc(50% + var(--orbit-radius) * 0.951);
  transform: translate(-50%, -50%);
  animation: float-gentle 9s ease-in-out infinite 1s;
}

.category-bubble.petal-bottom-right {
  top: calc(50% + var(--orbit-radius) * 0.809);
  left: calc(50% + var(--orbit-radius) * 0.588);
  transform: translate(-50%, -50%);
  animation: float-gentle 7s ease-in-out infinite 2s;
}

.category-bubble.petal-bottom-left {
  top: calc(50% + var(--orbit-radius) * 0.809);
  left: calc(50% - var(--orbit-radius) * 0.588);
  transform: translate(-50%, -50%);
  animation: float-gentle 8.5s ease-in-out infinite 3s;
}

.category-bubble.petal-top-left {
  top: calc(50% - var(--orbit-radius) * 0.309);
  left: calc(50% - var(--orbit-radius) * 0.951);
  transform: translate(-50%, -50%);
  animation: float-gentle 9.5s ease-in-out infinite 4s;
}

@keyframes float-gentle {
  0%, 100% { 
    transform: translate(-50%, -50%) translateY(0) scale(1); 
  }
  50% { 
    transform: translate(-50%, -50%) translateY(-6px) scale(1.01); 
  }
}

.category-bubble:hover {
  animation-play-state: paused;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 30px var(--bubble-color),
    inset 0 -4px 16px rgba(0, 0, 0, 0.15),
    inset 0 4px 16px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  z-index: 20;
}

.category-bubble:hover::before {
  opacity: 0.4;
  transform: scale(1.05);
}

.category-bubble:active {
  transform: translate(-50%, -50%) scale(1.05);
  transition: transform 0.15s ease;
}

.bubble-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  z-index: 1;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.bubble-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.category-bubble:hover .bubble-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px var(--bubble-color));
}

.bubble-name {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.bubble-score {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: var(--primary-dark);
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 700;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  z-index: 2;
  transition: transform 0.3s ease;
}

.category-bubble:hover .bubble-score {
  transform: scale(1.1);
}

/* ===== Screen Headers ===== */
.screen-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-lg);
  padding-top: calc(var(--spacing-lg) + env(safe-area-inset-top));
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  margin-right: var(--spacing-md);
  transition: all var(--transition-fast);
}

.back-btn:hover {
  transform: translateX(-2px);
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

.screen-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.screen-title h2 {
  font-family: var(--font-accent);
  font-size: 1.3rem;
  font-weight: 500;
}

.category-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.category-icon svg {
  width: 100%;
  height: 100%;
}

.category-score-badge,
.goal-score-badge {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: var(--primary-dark);
  font-weight: 700;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.filter-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
}

.filter-btn:hover {
  color: var(--accent-gold);
}

.filter-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== Goals & Actions Lists ===== */
.goals-content,
.actions-content {
  padding: var(--spacing-lg);
  padding-bottom: 100px;
}

.goals-list,
.actions-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.goal-card,
.action-card {
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.goal-card:hover,
.action-card:hover {
  transform: translateX(4px);
  border-color: var(--accent-blue);
  box-shadow: 0 5px 30px rgba(74, 144, 217, 0.2);
}

.goal-card::before,
.action-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-gold) 0%, var(--accent-blue) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.goal-card:hover::before,
.action-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-score {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 700;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.card-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--spacing-xs);
  transition: color var(--transition-fast);
}

.card-action-btn:hover {
  color: var(--text-primary);
}

.card-action-btn.delete:hover {
  color: #ff6b6b;
}

.card-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.5;
}

.empty-state h3 {
  font-family: var(--font-accent);
  font-size: 1.3rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.9rem;
}

/* FAB (Floating Action Button) */
.fab {
  position: fixed;
  bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
  right: var(--spacing-xl);
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  border: none;
  border-radius: var(--radius-full);
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  transition: all var(--transition-normal);
  z-index: 50;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.fab svg {
  width: 28px;
  height: 28px;
}

/* ===== History Screen ===== */
.history-filters {
  display: none;
  padding: var(--spacing-md) var(--spacing-lg);
  gap: var(--spacing-md);
  background: rgba(10, 10, 26, 0.5);
  border-bottom: 1px solid var(--glass-border);
}

.history-filters.active {
  display: flex;
}

.history-filters select {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.history-filters select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.history-content {
  padding: var(--spacing-lg);
}

.history-chart-container {
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  height: 200px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.08) 0%, rgba(255, 215, 0, 0.03) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.history-date {
  min-width: 60px;
  text-align: center;
}

.history-date .day {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.history-date .month {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.history-details {
  flex: 1;
}

.history-action {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.history-goal {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.history-category-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.history-category-icon svg {
  width: 100%;
  height: 100%;
}

.history-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 1000;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary-dark) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
  font-family: var(--font-accent);
  font-size: 1.2rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-form {
  padding: var(--spacing-lg);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  resize: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.modal-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* AI Suggestion Button */
.ai-suggest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: auto;
  margin-right: var(--spacing-sm);
}

.ai-suggest-btn:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.ai-suggest-btn:active {
  transform: scale(0.95);
}

.ai-suggest-btn svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-gold);
}

.ai-suggest-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

.ai-suggest-btn.loading svg {
  animation: sparkle-pulse 1.5s ease-in-out infinite;
}

@keyframes sparkle-pulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% { 
    transform: scale(1.2) rotate(180deg);
    opacity: 0.7;
  }
}

/* AI Suggestions Container */
.ai-suggestions-container {
  display: none;
  padding: 0 var(--spacing-lg);
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.ai-suggestions-container.active {
  display: block;
  max-height: 400px;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--glass-border);
}

.ai-suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.ai-suggestions-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.ai-suggestions-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}

.ai-suggestions-close svg {
  width: 16px;
  height: 16px;
}

.ai-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  max-height: 280px;
  overflow-y: auto;
}

.ai-suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.ai-suggestion-item:hover {
  border-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.05);
}

.ai-suggestion-content {
  flex: 1;
  min-width: 0;
}

.ai-suggestion-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ai-suggestion-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-suggestion-use {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
  border: none;
  border-radius: var(--radius-full);
  color: #1a1a2e;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-suggestion-use:hover {
  transform: scale(1.1);
}

.ai-suggestion-use svg {
  width: 16px;
  height: 16px;
}

/* AI Loading State */
.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.ai-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ai-error {
  padding: var(--spacing-md);
  text-align: center;
  color: #ff6b6b;
  font-size: 0.9rem;
}

/* Score Modal */
.score-modal-content {
  padding: var(--spacing-lg);
}

.score-modal .action-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: var(--text-primary);
}

.score-slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.score-slider-container input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #ff6b6b 0%, var(--accent-gold) 50%, #88B04B 100%);
  border-radius: 4px;
  outline: none;
  margin-bottom: var(--spacing-lg);
}

.score-slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-fast);
}

.score-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.score-display {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.score-display #score-value {
  font-family: var(--font-accent);
  font-size: 3rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-display .score-max {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--primary-mid);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  max-width: 92vw;
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  z-index: 2000;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ===== Admin Styles ===== */
.admin-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: var(--spacing-lg);
  padding: var(--spacing-sm);
  transition: color var(--transition-fast);
}

.admin-link:hover {
  color: var(--accent-gold);
}

.admin-content {
  padding: var(--spacing-lg);
  overflow-y: auto;
  height: calc(100% - 60px);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.stat-number {
  font-family: var(--font-accent);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-users-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  font-size: 1.1rem;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.admin-user-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-user-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-gold);
  transform: translateX(4px);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.admin-user-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-user-score {
  font-family: var(--font-accent);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.admin-user-detail-content {
  padding: var(--spacing-lg);
  overflow-y: auto;
  height: calc(100% - 60px);
}

.user-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.user-detail-goals h4,
.user-detail-history h4 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.user-detail-goals {
  margin-bottom: var(--spacing-xl);
}

.user-goal-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-goal-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-gold);
}

.user-goal-card.expanded {
  border-color: var(--accent-gold);
}

.user-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.user-goal-title {
  font-weight: 600;
  color: var(--text-primary);
}

.user-goal-category {
  font-size: 0.7rem;
  color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.user-goal-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-xs);
}

.user-goal-actions-list {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--glass-border);
}

.user-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-xs);
}

.user-action-item:last-child {
  margin-bottom: 0;
}

.user-action-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-action-score {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-goal-actions {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.user-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--glass-border);
}

.user-history-item:last-child {
  border-bottom: none;
}

.user-history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-history-action {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.user-history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-history-score {
  font-weight: 600;
  font-size: 1.1rem;
}

/* ===== Welcome Modal ===== */
.welcome-modal {
  text-align: center;
  max-width: 320px;
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-xl);
  border: none;
  overflow: visible;
}

.welcome-lotus {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

.welcome-modal h2 {
  color: var(--accent-gold);
  font-family: var(--font-accent);
  font-size: 1.4rem;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.welcome-intro {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
}

.welcome-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--spacing-md);
}

.welcome-cat-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--cat-color);
}

.welcome-cat-item svg {
  width: 22px;
  height: 22px;
  color: var(--cat-color);
  flex-shrink: 0;
}

.welcome-cat-item span {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
}

.welcome-sub {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  margin-bottom: var(--spacing-sm) !important;
}

.welcome-modal .btn-primary {
  margin-top: var(--spacing-xs);
  width: 100%;
  padding: 12px;
}

/* ===== Tutorial Pointer ===== */
.tutorial-pointer {
  display: none;
  position: fixed;
  z-index: 9999;
  align-items: center;
  gap: 2px;
}

.tutorial-pointer.show {
  display: flex;
}

.pointer-text {
  color: #FFD700;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-primary);
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.9), 0 0 20px rgba(255, 215, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
}

.pointer-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
  animation: arrowGlow 1.2s ease-in-out infinite;
}

.pointer-arrow svg {
  display: block;
}

@keyframes arrowGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(3px); opacity: 0.8; }
}

.pointer-close {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: rgba(255, 215, 0, 0.5);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.pointer-close:hover {
  color: rgba(255, 215, 0, 0.9);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .categories-bubble-grid {
    max-width: 550px;
    margin: 0 auto;
  }
  
  .category-bubble {
    width: 140px;
    height: 140px;
  }
  
  .goals-content,
  .actions-content,
  .history-content {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .login-container {
    max-width: 500px;
    margin: 0 auto;
  }
  
  .dashboard-content {
    max-width: 800px;
    margin: 0 auto;
  }
  
  .categories-bubble-grid {
    max-width: 700px;
  }
  
  .category-bubble {
    width: 150px;
    height: 150px;
  }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.goal-card,
.action-card,
.history-item {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.goal-card:nth-child(1) { animation-delay: 0.05s; }
.goal-card:nth-child(2) { animation-delay: 0.1s; }
.goal-card:nth-child(3) { animation-delay: 0.15s; }
.goal-card:nth-child(4) { animation-delay: 0.2s; }
.goal-card:nth-child(5) { animation-delay: 0.25s; }

.action-card:nth-child(1) { animation-delay: 0.05s; }
.action-card:nth-child(2) { animation-delay: 0.1s; }
.action-card:nth-child(3) { animation-delay: 0.15s; }
.action-card:nth-child(4) { animation-delay: 0.2s; }
.action-card:nth-child(5) { animation-delay: 0.25s; }

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== Responsive Petal Layout ===== */
@media (max-width: 400px) {
  .categories-bubble-grid {
    height: calc(100vh - 120px);
    max-height: 520px;
    min-height: 420px;
  }
  
  .category-bubble {
    --bubble-size: 90px;
    --orbit-radius: 115px;
  }
  
  .overall-score {
    width: 100px;
    height: 100px;
  }
  
  .score-number {
    font-size: 2rem;
  }
  
  .bubble-icon {
    width: 36px;
    height: 36px;
  }
  
  .bubble-name {
    font-size: 0.7rem;
  }
  
  .bubble-score {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
    top: 0px;
    right: 0px;
  }
}

@media (min-width: 401px) and (max-width: 600px) {
  .categories-bubble-grid {
    height: calc(100vh - 120px);
    max-height: 580px;
    min-height: 460px;
  }
  
  .category-bubble {
    --bubble-size: 100px;
    --orbit-radius: 135px;
  }
  
  .overall-score {
    width: 110px;
    height: 110px;
  }
  
  .score-number {
    font-size: 2.2rem;
  }
  
  .bubble-icon {
    width: 42px;
    height: 42px;
  }
  
  .bubble-name {
    font-size: 0.75rem;
  }
  
  .bubble-score {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
    top: 2px;
    right: 2px;
  }
}

@media (min-width: 601px) {
  .categories-bubble-grid {
    height: calc(100vh - 140px);
    max-height: 620px;
    min-height: 500px;
  }
  
  .category-bubble {
    --bubble-size: 105px;
    --orbit-radius: 175px;
  }
  
  .overall-score {
    width: 120px;
    height: 120px;
  }
  
  .score-number {
    font-size: 2.4rem;
  }
  
  .bubble-icon {
    width: 44px;
    height: 44px;
  }
}
