/* ---- APP SHELL ---- */
.app-body {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(184, 169, 201, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
}

.app-nav-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-plum);
  text-decoration: none;
}

.app-nav-links {
  display: flex;
  gap: 0.5rem;
}

.app-nav-link {
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.app-nav-link:hover {
  background: var(--whisper);
  color: var(--dark-plum);
}

.app-nav-link.active {
  background: var(--deep-lavender);
  color: white;
}

.app-main {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* ---- SHARED FORM ELEMENTS ---- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-plum);
  margin-bottom: 0.6rem;
}

.form-optional {
  font-weight: 400;
  color: var(--text-light);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid rgba(184, 169, 201, 0.4);
  border-radius: 12px;
  background: white;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--lavender);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-primary {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--deep-lavender);
  color: white;
  border: none;
  border-radius: 100px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--soft-plum);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: var(--lavender);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: transparent;
  color: var(--deep-lavender);
  border: 1.5px solid var(--lavender);
  border-radius: 100px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--whisper);
}

.hidden { display: none !important; }

/* ---- CHAT ---- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px);
  max-width: 720px;
  margin: 0 auto;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(184, 169, 201, 0.2);
  flex-shrink: 0;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender), var(--blush));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.chat-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark-plum);
  line-height: 1.2;
}

.chat-subtitle {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

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

.msg-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender), var(--blush));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.msg-bubble {
  max-width: 80%;
  padding: 0.9rem 1.2rem;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  background: white;
  box-shadow: 0 1px 8px rgba(139, 123, 168, 0.08);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.msg-bubble p + p { margin-top: 0.6rem; }

.msg-bubble-user {
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  background: var(--deep-lavender);
  color: white;
  box-shadow: none;
}

/* Typing indicator */
.msg-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1rem 1.2rem;
}

.msg-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lavender);
  display: inline-block;
  animation: bounce 1.2s infinite;
}

.msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.msg-error {
  color: #c0392b;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  background: #fdf0f0;
  border-radius: 8px;
  text-align: center;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-enter { animation: fadeInUp 0.25s ease forwards; }

.chat-input-area {
  flex-shrink: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(184, 169, 201, 0.2);
}

.chat-input-wrap {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 0.9rem 1.2rem;
  border: 1.5px solid rgba(184, 169, 201, 0.4);
  border-radius: 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: white;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  overflow: hidden;
  max-height: 140px;
}

.chat-input:focus { border-color: var(--lavender); }
.chat-input::placeholder { color: var(--text-light); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--deep-lavender);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.chat-send-btn:hover { background: var(--soft-plum); transform: scale(1.05); }
.chat-send-btn:disabled { background: var(--lavender); cursor: not-allowed; transform: none; }

.chat-disclaimer {
  font-size: 0.72rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 0.6rem;
}

/* ---- CHECK-IN ---- */
.checkin-container { max-width: 680px; margin: 0 auto; }

.checkin-header { margin-bottom: 2rem; }

.checkin-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--dark-plum);
  margin-bottom: 0.3rem;
}

.checkin-subtitle { color: var(--text-secondary); font-size: 0.95rem; }

.checkin-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(139, 123, 168, 0.08);
  margin-bottom: 2rem;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mood-btn {
  padding: 0.55rem 0.4rem;
  border: 1.5px solid rgba(184, 169, 201, 0.3);
  border-radius: 12px;
  background: var(--whisper);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.mood-btn:hover { border-color: var(--lavender); background: white; }

.mood-btn.selected {
  border-color: var(--deep-lavender);
  background: var(--whisper);
  color: var(--deep-lavender);
  font-weight: 600;
}

.intensity-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--light-lilac), var(--deep-lavender));
  outline: none;
  margin: 0.5rem 0;
}

.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--deep-lavender);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(139, 123, 168, 0.3);
}

.intensity-display {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--deep-lavender);
  margin-left: 0.3rem;
}

.intensity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-light);
}

/* Reflection card */
.reflection-card {
  background: linear-gradient(145deg, var(--whisper), white);
  border: 1px solid rgba(184, 169, 201, 0.3);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.reflection-avatar {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.reflection-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.8rem;
}

.reflection-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.reflection-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Recent check-ins */
.recent-checkins { margin-top: 1.5rem; }

.recent-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.recent-list { display: flex; flex-direction: column; gap: 0.6rem; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: white;
  border-radius: 14px;
  border: 1px solid rgba(184, 169, 201, 0.15);
}

.recent-mood-emoji { font-size: 1.4rem; flex-shrink: 0; }

.recent-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.recent-mood-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark-plum);
}

.recent-intensity, .recent-trigger {
  font-size: 0.76rem;
  color: var(--text-light);
}

.recent-time {
  font-size: 0.72rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.recent-empty { font-size: 0.88rem; color: var(--text-light); font-style: italic; }

/* ---- GROUNDING ---- */
.grounding-container { max-width: 680px; margin: 0 auto; }

.grounding-header { margin-bottom: 2rem; }

.grounding-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--dark-plum);
  margin-bottom: 0.3rem;
}

.grounding-subtitle { color: var(--text-secondary); font-size: 0.95rem; }

.tool-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tool-tab {
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  border: 1.5px solid rgba(184, 169, 201, 0.35);
  background: white;
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-tab:hover { border-color: var(--lavender); }

.tool-tab.active {
  background: var(--deep-lavender);
  color: white;
  border-color: var(--deep-lavender);
}

.tool-panel { display: none; }
.tool-panel.active { display: block; }

/* Breathing */
.breathing-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(139, 123, 168, 0.08);
  text-align: center;
}

.breathing-circle {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.breathing-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--lavender);
  transition: transform 4s ease-in-out, border-color 0.5s;
  background: radial-gradient(circle, var(--whisper) 60%, transparent 100%);
}

.breathing-active.inhale .breathing-ring {
  transform: scale(1.25);
  border-color: var(--deep-lavender);
  background: radial-gradient(circle, var(--light-lilac) 60%, transparent 100%);
  transition: transform 4s ease-in-out, border-color 0.5s, background 0.5s;
}

.breathing-active.exhale .breathing-ring {
  transform: scale(0.85);
  border-color: var(--warm-blush);
  background: radial-gradient(circle, #fef6f0 60%, transparent 100%);
  transition: transform 4s ease-in-out, border-color 0.5s, background 0.5s;
}

.breathing-active.hold .breathing-ring {
  border-color: var(--rose-gold);
  transition: transform 0.3s, border-color 0.5s;
}

.breathing-instruction {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark-plum);
  margin-bottom: 0.2rem;
}

.breathing-count {
  position: relative;
  z-index: 1;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--deep-lavender);
  line-height: 1;
}

.breathing-controls {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.form-select {
  max-width: 260px;
  padding: 0.65rem 1rem;
}

.breathing-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto;
}

/* Affirmations */
.affirmations-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(139, 123, 168, 0.08);
  text-align: center;
}

.affirmation-display {
  min-height: 120px;
  background: linear-gradient(145deg, var(--whisper), var(--light-lilac));
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.affirmation-display:hover { transform: scale(1.01); }

.affirmation-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  font-style: italic;
  color: var(--dark-plum);
  line-height: 1.6;
  transition: opacity 0.2s;
}

.affirmation-categories {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.cat-btn {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1.5px solid rgba(184, 169, 201, 0.35);
  background: white;
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-btn:hover { border-color: var(--lavender); }
.cat-btn.active { background: var(--whisper); color: var(--deep-lavender); border-color: var(--lavender); font-weight: 600; }

/* 5 Senses */
.senses-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(139, 123, 168, 0.08);
}

.senses-intro {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.senses-list { display: flex; flex-direction: column; gap: 0.8rem; }

.sense-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 14px;
  background: var(--whisper);
}

.sense-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sense-5 { background: linear-gradient(135deg, var(--light-lilac), white); }
.sense-4 { background: linear-gradient(135deg, var(--blush), white); }
.sense-3 { background: linear-gradient(135deg, #d4f4dd, white); }
.sense-2 { background: linear-gradient(135deg, #fef0d4, white); }
.sense-1 { background: linear-gradient(135deg, #f4e0d4, white); }

.sense-label {
  font-size: 0.92rem;
  color: var(--dark-plum);
  margin-bottom: 0.2rem;
}

.sense-hint { font-size: 0.78rem; color: var(--text-light); line-height: 1.5; }

.senses-close {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
  border-top: 1px solid rgba(184, 169, 201, 0.2);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .app-nav { padding: 0.8rem 1rem; }
  .app-nav-links { gap: 0.25rem; }
  .app-nav-link { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
  .app-main { padding: 1rem; }
  .chat-container { height: calc(100vh - 60px); }
  .mood-grid { grid-template-columns: repeat(2, 1fr); }
  .checkin-card, .breathing-card, .affirmations-card, .senses-card { padding: 1.3rem; }
}
