/* === Let's Pray - App Styles === */
:root {
  /* CORE SPIRITUAL COLOURS */
  --lp-presence: #5B5FEF;
  --lp-presence-soft: #EEF0FF;
  --lp-peace: #4DB6AC;
  --lp-peace-soft: #E6F7F5;
  --lp-love: #FF7A9E;
  --lp-love-soft: #FFE9EF;
  --lp-light: #FFC75F;
  --lp-light-soft: #FFF6E5;
  --lp-depth: #2D3142;
  --lp-depth-soft: #F4F5F8;

  /* NEUTRALS */
  --lp-bg: #F7F8FC;
  --lp-card: #FFFFFF;
  --lp-text: #2B2D42;
  --lp-text-light: #6C6F7F;
  --lp-border: #ECEEF5;

  /* FUNCTIONAL */
  --lp-success: #00C9A7;
  --lp-warning: #FFC75F;
  --lp-danger: #FF6B6B;

  /* TYPE TINTS */
  --lp-tint-prayer: #EEF0FF;
  --lp-tint-prayer-border: rgba(91,95,239,0.15);
  --lp-tint-devotional: #F3E8FF;
  --lp-tint-devotional-border: rgba(132,94,194,0.15);
  --lp-tint-verse: #E6F7F5;
  --lp-tint-verse-border: rgba(77,182,172,0.15);
  --lp-tint-thought: #FFF6E5;
  --lp-tint-thought-border: rgba(255,199,95,0.2);
  --lp-tint-image: #FFE9EF;
  --lp-tint-image-border: rgba(255,122,158,0.15);

  /* UI SHAPE */
  --lp-radius: 18px;

  /* ALIASES (backward compat — used throughout CSS & JS) */
  --lp-primary: var(--lp-presence);
  --lp-primary-dark: #4A4ED4;
  --lp-secondary: var(--lp-love);

  /* FRAMEWORK7 OVERRIDES */
  --f7-theme-color: #5B5FEF;
  --f7-theme-color-rgb: 91, 95, 239;
  --f7-navbar-bg-color: #fff;
  --f7-navbar-text-color: #2B2D42;
  --f7-toolbar-bg-color: #fff;
  --f7-toolbar-border-color: #ECEEF5;
  --f7-tabbar-label-font-size: 10px;
  --f7-tabbar-icon-size: 24px;
}

body {
  background: var(--lp-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Auth Screen === */
.auth-page {
  background: linear-gradient(160deg, var(--lp-presence) 0%, var(--lp-primary-dark) 50%, var(--lp-presence) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  padding: 40px 24px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo-img {
  width: 100px;
  height: auto;
  margin-bottom: 12px;
}

.auth-logo h1 {
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
}

.auth-logo p {
  color: rgba(255,255,255,0.7);
  margin: 8px 0 0;
  font-size: 15px;
}

.auth-page button.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.auth-page button.auth-btn:active {
  transform: scale(0.98);
}

.auth-page button.auth-btn-primary {
  background: #fff;
  color: var(--lp-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-mode-toggle {
  display: flex;
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-mode-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-mode-btn.active {
  background: #fff;
  color: var(--lp-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-email-form {
  margin-top: 0;
}

.auth-input-group,
.auth-otp-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-otp-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.auth-page input.auth-input,
.auth-page input.auth-input[type="email"],
.auth-page input.auth-input[type="text"] {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 50px;
  background: #fff;
  color: #2B2D42;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  height: auto;
  line-height: normal;
}

.auth-page input.auth-input:focus {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  background: #fff;
}

.auth-page input.auth-input::placeholder {
  color: #aab0c0;
}

.auth-page select.auth-select {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 50px;
  background: #fff;
  color: #2B2D42;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23aab0c0' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 44px;
  margin: 0;
  height: auto;
  line-height: normal;
}

.auth-page select.auth-select:focus {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.auth-page select.auth-select option {
  color: #2B2D42;
}

.auth-skip-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
  width: 100%;
  text-align: center;
}

/* === Navbar === */
.navbar .title {
  font-weight: 700;
  font-size: 20px;
}

/* === Tab Bar === */
.tabbar .tab-link {
  color: #b0b3c5;
}

.tabbar .tab-link-active {
  color: var(--lp-primary);
}

.tabbar-label {
  font-weight: 600;
}

/* === Feed / Lists === */
.feed-filter, .pray-filter, .inspire-filter {
  display: flex;
  gap: 8px;
  padding: 10px 16px 6px;
}

.feed-filter-btn, .pray-filter-btn, .inspire-filter-btn {
  width: auto;
  height: 36px;
  border-radius: 15px;
  border: 1.5px solid var(--lp-border);
  background: var(--lp-card);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
}

.feed-filter-btn.active, .pray-filter-btn.active, .inspire-filter-btn.active {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  box-shadow: 0 2px 8px rgba(91,95,239,0.3);
  color: white;
}

.feed-list, .prayer-list, .inspire-list {
  padding: 8px 16px;
}

/* === Feed Card === */
.feed-card {
  background: var(--lp-tint-prayer);
  border: 1px solid var(--lp-tint-prayer-border);
  border-radius: var(--lp-radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.feed-card-room {
  background: linear-gradient(135deg, rgba(91,95,239,0.05), rgba(91,95,239,0.1));
  border: 1px solid rgba(91,95,239,0.15);
}

.feed-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--lp-text);
}

.feed-time {
  font-size: 12px;
  color: var(--lp-text-light);
}

.feed-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.feed-badge-prayer {
  background: rgba(91,95,239,0.1);
  color: var(--lp-primary);
}

.feed-badge-inspiration {
  background: rgba(255,101,132,0.1);
  color: var(--lp-secondary);
}

.feed-card-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--lp-text);
  margin-bottom: 6px;
}

.feed-card-body {
  font-size: 14px;
  color: var(--lp-text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-card-image {
  width: 100%;
  border-radius: 12px;
  margin-top: 12px;
  max-height: 200px;
  object-fit: cover;
}

.feed-follow-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--lp-primary);
  background: transparent;
  color: var(--lp-primary);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.feed-follow-btn.following {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}

.feed-card-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--lp-border);
}

.feed-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--lp-text-light);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.feed-action-btn:active {
  color: var(--lp-primary);
}

.feed-action-btn .count {
  font-weight: 600;
}

/* === Inspiration Card === */
.inspire-card {
  background: var(--lp-card);
  border-radius: var(--lp-radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid var(--lp-border);
}

.inspire-card.type-devotional {
  background: var(--lp-tint-devotional);
  border-color: var(--lp-tint-devotional-border);
}

.inspire-card.type-verse {
  background: var(--lp-tint-verse);
  border-color: var(--lp-tint-verse-border);
}

.inspire-card.type-thought {
  background: var(--lp-tint-thought);
  border-color: var(--lp-tint-thought-border);
}

.inspire-card.type-image {
  background: var(--lp-tint-image);
  border-color: var(--lp-tint-image-border);
}

.inspire-card .inspire-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--lp-primary);
  margin-bottom: 8px;
}

.inspire-card .inspire-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--lp-text);
}

.inspire-card .inspire-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--lp-text-light);
}

.inspire-card .inspire-image {
  width: 100%;
  border-radius: 12px;
  margin-top: 12px;
}

/* === Chat === */
.chat-list {
  padding: 8px 16px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--lp-border);
  cursor: pointer;
}

.chat-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-item-info {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-weight: 600;
  font-size: 15px;
}

.chat-item-preview {
  font-size: 13px;
  color: var(--lp-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-meta {
  text-align: right;
  flex-shrink: 0;
}

.chat-item-time {
  font-size: 12px;
  color: var(--lp-text-light);
}

.chat-unread-badge {
  background: var(--lp-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-top: 4px;
}

/* === Empty States === */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--lp-text-light);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--lp-text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

/* === Prayer Detail Sheet === */
.prayer-sheet {
  --f7-sheet-bg-color: var(--lp-card);
}

.prayer-sheet .sheet-modal-inner {
  padding: 24px;
}

/* === Prayer Room Chips === */
.room-chip {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--lp-card);
  border: 1.5px solid var(--lp-border);
  cursor: pointer;
  text-align: center;
  min-width: 100px;
  transition: all 0.2s;
}

.room-chip:active {
  transform: scale(0.97);
}

.room-chip-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--lp-text);
  white-space: nowrap;
}

.room-chip-meta {
  font-size: 11px;
  color: var(--lp-text-light);
  margin-top: 2px;
}

.room-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(91,95,239,0.1);
  color: var(--lp-primary);
}

/* === Profile Tag Chips === */
#profileTagChips {
  display: flex !important;
  flex-flow: row wrap !important;
  gap: 6px !important;
}

.profile-tag-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--lp-border);
  background: var(--lp-card);
  color: var(--lp-text-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex: 0 0 auto;
}

.profile-tag-chip.active {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}

.prayer-detail-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.prayer-detail-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--lp-text-light);
  margin-bottom: 20px;
}

.emoji-reactions {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
}

/* Toggle switches */
#anonToggle.on, #notifyToggle.on { background: var(--lp-primary); }
#anonToggle.on > div, #notifyToggle.on > div { left: 21px; }

.emoji-btn {
  padding: 6px 10px;
  border-radius: 16px;
  width: 42px;
  border: 1.5px solid var(--lp-border);
  background: var(--lp-card);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.emoji-btn.active {
  border-color: var(--lp-primary);
  background: rgba(91,95,239,0.08);
}

.reply-list {
  margin-top: 16px;
}

.reply-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.reply-body {
  background: var(--lp-bg);
  border-radius: 12px;
  padding: 10px 14px;
  flex: 1;
}

.reply-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.reply-time {
  font-weight: 400;
  font-size: 11px;
  color: var(--lp-text-light);
  margin-left: 4px;
}

.reply-text {
  font-size: 14px;
  color: var(--lp-text-light);
}

.reply-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--lp-card);
  border-top: 1px solid var(--lp-border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

.reply-input-bar input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--lp-border);
  font-size: 14px;
  outline: none;
  background: var(--lp-bg);
}

.reply-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--lp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  font-size: 14px;
  cursor: pointer;
}

/* === New Prayer Form === */
.new-prayer-form {
  padding: 24px;
}

.new-prayer-form input,
.new-prayer-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--lp-border);
  border-radius: 14px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  background: var(--lp-bg);
  font-family: inherit;
  resize: none;
}

.new-prayer-form input:focus,
.new-prayer-form textarea:focus {
  border-color: var(--lp-primary);
}

.new-prayer-form .submit-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--lp-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.anon-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--lp-text-light);
}

/* === Profile === */
.profile-header {
  text-align: center;
  padding: 50px 24px 30px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
  color: #fff;
  border-radius: 0 0 24px 24px;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin: 0 auto 12px;
  overflow: hidden;
}

.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-num {
  font-size: 20px;
  font-weight: 700;
}

.profile-stat-label {
  font-size: 12px;
  opacity: 0.7;
}

/* === Loading === */
.loading-indicator {
  text-align: center;
  padding: 30px;
}

/* === Utilities === */
.safe-areas {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Smooth scrolling */
.page-content {
  -webkit-overflow-scrolling: touch;
}

/* === Chat Messages View === */
.messages-container {
  padding: 16px;
  padding-bottom: 70px;
}

.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.message-sent {
  background: var(--lp-primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.message-received {
  background: var(--lp-bg);
  color: var(--lp-text);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
}
