/* ============================================================
   VITVERSE GLOBAL STYLESHEET
   Consolidated for: Index, ChronoZen, SoulSync, DreamWeaver, Tutorial
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Orbitron:wght@700;900&display=swap');

/* ============================================================
   1. VARIABLES & RESET
   ============================================================ */
:root {
  --bg-base: #0f111a;
  --bg-surface: rgba(30, 34, 53, 0.6);
  --text-main: #f0f4f8;
  --text-muted: #8b9bb4;
  --accent: #00e5ff;
  --accent-glow: rgba(0, 229, 255, 0.4);
  --border-glass: rgba(255, 255, 255, 0.08);
  --font-ui: 'Inter', sans-serif;
  --font-display: 'Orbitron', sans-serif;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-ui);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  min-height: 100dvh;
}

/* ============================================================
   2. SHARED UI COMPONENTS
   ============================================================ */
h1, h2, h3, .title-text {
  font-family: var(--font-display);
  letter-spacing: 1px;
}

/* Glassmorphism / Neumorphic Buttons */
.neumorphic-button {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  color: var(--text-main);
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.neumorphic-button:active {
  transform: scale(0.96);
  background: rgba(30, 34, 53, 0.9);
}

.neumorphic-button i { color: var(--accent); font-size: 16px; }

.icon-btn {
  background: transparent; 
  border: none; 
  color: var(--text-muted); 
  font-size: 20px; 
  cursor: pointer;
  transition: color 0.2s;
}
.icon-btn:hover { color: var(--text-main); }

/* Header & Top Navigation */
header {
  display: flex;
  justify-content: center;
  width: 100%;
}

.top-buttons {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}

.top-bar {
  position: fixed; 
  top: 0; left: 0; right: 0; height: 60px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 20px; z-index: 100;
  background: linear-gradient(180deg, var(--bg-base) 0%, transparent 100%);
}

.back-btn { 
  color: var(--text-muted); 
  font-size: 20px; 
  text-decoration: none; 
  transition: color 0.2s; 
}
.back-btn:hover { color: var(--accent); }

.title-text { 
  font-size: 16px; 
  color: var(--text-main); 
  letter-spacing: 2px; 
}

/* Shared Primary Button */
.submit-btn {
  width: 100%; max-width: 340px; padding: 16px; border-radius: 16px;
  background: var(--accent); color: #000; font-weight: 800; font-size: 16px;
  border: none; cursor: pointer; z-index: 10;
  box-shadow: 0 0 20px var(--accent-glow); transition: all 0.2s;
}
.submit-btn:active { transform: scale(0.96); box-shadow: none; }

/* Shared Success Overlay */
.success-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
  background: rgba(15, 17, 26, 0.9); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.success-overlay.active { opacity: 1; pointer-events: auto; }

.success-icon {
  width: 80px; height: 80px; border-radius: 50%; background: rgba(0, 229, 255, 0.1);
  border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--accent); margin-bottom: 20px;
  box-shadow: 0 0 30px var(--accent-glow);
  animation: pop-icon 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pop-icon { 0% { transform: scale(0); } 100% { transform: scale(1); } }

.success-overlay h2 { color: #fff; margin-bottom: 8px; }
.success-overlay p { color: var(--accent); font-family: var(--font-display); font-weight: bold; }


/* ============================================================
   3. CHRONOZEN (QUEST BOARD)
   ============================================================ */
.calendar-wrapper {
  position: absolute; top: 60px; bottom: 100px; left: 0; right: 0;
  padding: 0 16px; overflow-y: auto;
}

#calendar {
  /* FullCalendar Dark Mode Overrides */
  --fc-border-color: rgba(255, 255, 255, 0.05);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 255, 255, 0.02);
  --fc-today-bg-color: rgba(0, 229, 255, 0.05);
  --fc-event-bg-color: var(--accent);
  --fc-event-border-color: transparent;
  --fc-event-text-color: #000;
  --fc-button-bg-color: rgba(255, 255, 255, 0.05);
  --fc-button-border-color: transparent;
  --fc-button-hover-bg-color: rgba(255, 255, 255, 0.1);
  --fc-button-active-bg-color: var(--accent);
  --fc-button-active-text-color: #000;
  font-family: var(--font-ui);
}

.fc-theme-standard td, .fc-theme-standard th { border-color: rgba(255,255,255,0.05); }
.fc-col-header-cell-cushion { color: var(--text-muted); font-size: 12px; text-transform: uppercase; padding: 10px 0 !important; font-weight: 600; }
.fc-daygrid-day-number { color: var(--text-muted); font-size: 14px; padding: 8px !important; font-weight: 600; }
.fc-day-today .fc-daygrid-day-number { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
.fc-toolbar-title { font-family: var(--font-display) !important; font-size: 18px !important; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px;}
.fc-header-toolbar { padding: 16px 0; }
.fc-event { border-radius: 6px; font-weight: bold; font-size: 11px; padding: 2px 4px; box-shadow: 0 0 10px var(--accent-glow); cursor: pointer;}

/* Quest Dock */
.quest-dock {
  position: fixed; bottom: 0; left: 0; right: 0; height: 90px;
  background: rgba(15, 17, 26, 0.9); backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  overflow-x: auto; z-index: 100; scrollbar-width: none;
}
.quest-dock::-webkit-scrollbar { display: none; }

.quest-item {
  min-width: 70px; height: 70px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-main); font-size: 10px; font-weight: bold; cursor: grab;
  transition: transform 0.2s, background 0.2s;
  user-select: none;
}
.quest-item:active { cursor: grabbing; transform: scale(0.95); }
.quest-item:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.quest-item i { font-size: 20px; color: var(--accent); }

/* Delete Popup */
.delete-popup {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9);
  background: #1a1e2e; border: 1px solid rgba(255, 68, 68, 0.3); border-radius: 20px;
  padding: 24px; text-align: center; z-index: 1000; opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.delete-popup.active { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.delete-popup p { color: #fff; margin-bottom: 20px; font-size: 14px; }
.btn-danger { background: rgba(255, 68, 68, 0.1); color: #ff4444; border: 1px solid #ff4444; padding: 10px 20px; border-radius: 12px; font-weight: bold; cursor: pointer; margin-right: 10px;}
.btn-cancel { background: rgba(255,255,255,0.1); color: #fff; border: none; padding: 10px 20px; border-radius: 12px; font-weight: bold; cursor: pointer; }


/* ============================================================
   4. SOULSYNC (VIBE CHECK)
   ============================================================ */
#body-bg {
  transition: background 1s ease;
  background: radial-gradient(circle at center, #1e2a38 0%, #0f111a 100%);
}

#particle-canvas {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 999;
}

.soul-container {
  position: absolute; top: 60px; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
}

/* Mood Display */
.mood-display {
  position: relative; width: 200px; height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 40px;
}

.glow-orb {
  position: absolute; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, #7fd8ff 0%, transparent 70%);
  box-shadow: 0 0 60px #7fd8ff;
  transition: all 1s ease;
  animation: pulse-orb 4s infinite alternate;
  z-index: 1;
}

@keyframes pulse-orb {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

.mood-emoji { font-size: 60px; z-index: 10; margin-bottom: 10px; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.mood-label { font-family: var(--font-display); font-size: 18px; font-weight: bold; color: #fff; z-index: 10; text-transform: uppercase; letter-spacing: 2px; }

/* Mood Slider */
.mood-slider {
  display: flex; gap: 12px; margin-bottom: 40px; z-index: 10;
}
.mood-btn {
  width: 50px; height: 50px; border-radius: 50%; font-size: 24px;
  background: rgba(255,255,255,0.05); border: 2px solid transparent;
  cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0.4;
}
.mood-btn.active {
  opacity: 1; transform: scale(1.2);
  background: rgba(255,255,255,0.1); border-color: var(--text-main);
  box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

/* Reflection Input */
.reflection-card {
  width: 100%; max-width: 340px; margin-bottom: 30px; z-index: 10;
}
#reflection {
  width: 100%; height: 120px;
  background: var(--bg-surface); border: 1px solid var(--border-glass);
  border-radius: 20px; padding: 16px; color: var(--text-main);
  font-family: var(--font-ui); font-size: 14px; resize: none; outline: none;
  backdrop-filter: blur(12px); transition: border-color 0.3s;
}
#reflection:focus { border-color: var(--accent); }
#reflection::placeholder { color: var(--text-muted); opacity: 0.6; }


/* ============================================================
   5. DREAMWEAVER (STARLIGHT CAMP)
   ============================================================ */
#dream-body {
  background: linear-gradient(180deg, #0a0c13 0%, #151a30 100%);
  overflow: hidden;
  transition: background 1s ease;
}

#stars-container {
  position: absolute; top: 0; left: 0; width: 100vw; height: 100dvh;
  pointer-events: none; z-index: 0;
}

.bg-star {
  position: absolute; width: 2px; height: 2px; background: #fff;
  border-radius: 50%; opacity: 0; animation: twinkle infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.8); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

.dream-container {
  position: absolute; top: 60px; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; z-index: 10;
}

/* The Glowing Moon */
.moon-wrapper {
  position: relative; width: 180px; height: 180px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 30px;
}

.moon-glow {
  position: absolute; width: 150%; height: 150%; border-radius: 50%;
  background: radial-gradient(circle, #e0e5ff 0%, transparent 70%);
  filter: blur(20px); z-index: 1; transition: all 1s ease;
}

.moon {
  width: 120px; height: 120px; border-radius: 50%;
  background: #e0e5ff;
  box-shadow: inset -20px -20px 40px #a8b0c4, 0 0 40px #e0e5ff;
  position: relative; z-index: 2;
  transition: all 1s ease;
  animation: float-moon 6s ease-in-out infinite alternate;
}

@keyframes float-moon {
  0% { transform: translateY(0); }
  100% { transform: translateY(-15px); }
}

/* Moon Craters */
.crater { position: absolute; background: rgba(0,0,0,0.1); border-radius: 50%; box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2); }
.c1 { width: 30px; height: 30px; top: 20%; left: 20%; }
.c2 { width: 20px; height: 20px; top: 60%; left: 50%; }
.c3 { width: 15px; height: 15px; top: 30%; left: 70%; }

.sleep-title {
  font-family: var(--font-display); font-size: 16px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 16px;
}

/* Custom Slider */
.slider-container {
  width: 100%; max-width: 340px; margin-bottom: 20px;
  background: var(--bg-surface); border: 1px solid var(--border-glass);
  border-radius: 24px; padding: 20px; backdrop-filter: blur(12px);
}

.sleep-time-display {
  text-align: center; font-family: var(--font-display); font-size: 48px;
  font-weight: 900; color: var(--text-main); margin-bottom: 20px;
  text-shadow: 0 0 20px var(--accent-glow);
}
.sleep-time-display span { font-size: 20px; color: var(--text-muted); margin-left: 4px; }

input[type=range] {
  -webkit-appearance: none; width: 100%; height: 12px;
  background: rgba(255,255,255,0.1); border-radius: 10px; outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--text-main); cursor: pointer;
  box-shadow: 0 0 15px var(--accent-glow), 0 0 0 4px rgba(0, 229, 255, 0.2);
  transition: transform 0.1s ease;
}
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.2); }

.slider-labels {
  display: flex; justify-content: space-between; margin-top: 12px;
  font-size: 12px; color: var(--text-muted); font-weight: bold;
}

/* Star Rating */
.star-rating {
  display: flex; gap: 12px; margin-bottom: 40px;
}
.star {
  font-size: 32px; color: rgba(255,255,255,0.1); cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.star.active {
  color: #ffd700; text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  transform: scale(1.1);
}


/* ============================================================
   6. ONBOARDING TUTORIAL (SPIRIT GUIDE)
   ============================================================ */
.tutorial-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
  background: rgba(15, 17, 26, 0.85); backdrop-filter: blur(16px);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.6s ease;
}

.tutorial-overlay.active { opacity: 1; pointer-events: auto; }

.tutorial-card {
  background: var(--bg-surface); border: 1px solid var(--border-glass);
  border-radius: 32px; padding: 40px 30px; width: 90%; max-width: 380px;
  text-align: center; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: float-card 6s ease-in-out infinite alternate;
}

@keyframes float-card {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.tutorial-orb {
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, #a8e8ff 0%, #00e5ff 60%, transparent 100%);
  box-shadow: 0 0 40px var(--accent-glow); margin: 0 auto 24px auto;
  animation: pulse-orb 3s infinite alternate;
}

.tutorial-step { display: none; }
.tutorial-step.active { display: block; animation: fade-in-up 0.5s ease; }

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.tutorial-step h2 {
  font-family: var(--font-display); font-size: 22px; color: var(--accent);
  margin-bottom: 16px; letter-spacing: 1px;
}

.tutorial-step p {
  font-family: var(--font-ui); font-size: 15px; color: var(--text-main);
  line-height: 1.6; margin-bottom: 30px;
}

.tutorial-step strong { color: #fff; font-weight: 800; }

.tutorial-controls {
  display: flex; justify-content: space-between; align-items: center; margin-top: 20px;
}

.skip-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; transition: color 0.2s;
}
.skip-btn:hover { color: var(--text-main); }

.next-btn {
  background: var(--accent); color: #000; border: none;
  padding: 12px 24px; border-radius: 12px; font-weight: 800; font-size: 14px;
  cursor: pointer; box-shadow: 0 0 15px var(--accent-glow); transition: transform 0.2s;
}
.next-btn:active { transform: scale(0.95); }
