/* Jenny App — Shared iPhone Shell & App Base Styles */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
  color: #5D4E4E;
  background: #f0e8e4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* iPhone 15 Pro Shell */
.iphone {
  position: relative;
  width: 375px;
  height: 812px;
  background: #1a1412;
  border-radius: 55px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2d2826,
    0 40px 80px rgba(26, 20, 18, 0.45),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;
}

/* Dynamic Island */
.iphone::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
}

/* Home Indicator */
.iphone::after {
  content: "";
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(93, 78, 78, 0.3);
  border-radius: 5px;
  z-index: 50;
}

/* Screen */
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(232, 180, 184, 0.15), transparent 40%),
    linear-gradient(180deg, #FFFAF8 0%, #FDF5F5 100%);
}

/* Scrollable area between status bar and bottom nav */
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen-scroll::-webkit-scrollbar { display: none; }
.screen-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* Hide scrollbar but keep scroll */
.screen::-webkit-scrollbar { display: none; }
.screen { -ms-overflow-style: none; scrollbar-width: none; }

/* Status Bar */
.status-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5D4E4E;
  background: linear-gradient(180deg, #FFFAF8 0%, rgba(255,250,248,0.95) 80%, rgba(255,250,248,0) 100%);
  padding-top: 48px; /* space for dynamic island */
}

.status-bar .time { font-size: 0.82rem; font-weight: 700; }
.status-bar .icons { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; }

/* App Content Area */
.app-content {
  padding: 0 20px 24px;
}

/* Bottom Navigation — fixed at bottom of screen, never scrolls */
.bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 16px 28px;
  background: #FFFAF8;
  border-top: 1px solid rgba(232, 180, 184, 0.2);
  border-radius: 0 0 44px 44px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 16px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #C9A9A6;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item.active {
  color: #8B4D5C;
  background: linear-gradient(180deg, #FDF5F5, #F8E8E8);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  fill: none;
  stroke: currentColor;
}

/* Shared Component Styles */
.card {
  background: #FFFFFF;
  border: 1px solid rgba(232, 180, 184, 0.25);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(139, 77, 92, 0.06);
}

.card-brand {
  background: linear-gradient(135deg, #8B4D5C, #A66275);
  border: none;
  border-radius: 24px;
  padding: 18px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(139, 77, 92, 0.25);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill-brand {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
}

.pill-light {
  background: #F8E8E8;
  color: #8B4D5C;
}

.pill-success {
  background: #E8F5E9;
  color: #2E7D32;
}

.pill-warning {
  background: #FFF0E5;
  color: #BF5000;
}

.pill-danger {
  background: #FFE5E5;
  color: #C62828;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #8B4D5C, #A66275);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 77, 92, 0.25);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 77, 92, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #FFFFFF;
  color: #5D4E4E;
  border: 2px solid #F8E8E8;
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.btn-secondary:hover {
  border-color: #E8B4B8;
  color: #8B4D5C;
}

.section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #D4959A;
}

.heading-lg {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
  color: #5D4E4E;
  letter-spacing: -0.02em;
}

.heading-md {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  color: #5D4E4E;
}

.heading-sm {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  color: #5D4E4E;
}

.text-body { font-size: 0.88rem; line-height: 1.6; color: #5D4E4E; }
.text-small { font-size: 0.8rem; line-height: 1.5; color: #8B7B7B; }
.text-muted { color: #8B7B7B; }
.text-brand { color: #8B4D5C; }
.text-on-brand { color: rgba(255,255,255,0.8); }
.text-white { color: #fff; }

/* Mood chips */
.mood-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 20px;
  border: 2px solid #F8E8E8;
  background: #FFFAF8;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8B7B7B;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.mood-chip .emoji { font-size: 1.5rem; }

.mood-chip.active {
  border-color: #E8B4B8;
  background: linear-gradient(180deg, #FDF5F5, #F8E8E8);
  color: #8B4D5C;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(139, 77, 92, 0.12);
}

/* Tag chips */
.tag-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid #F8E8E8;
  background: #FFFAF8;
  font-size: 0.78rem;
  font-weight: 500;
  color: #8B7B7B;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip.active {
  border-color: #D4959A;
  background: #FDF5F5;
  color: #8B4D5C;
}

/* Progress bar */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: #F8E8E8;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8B4D5C, #A66275);
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Transitions */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

.slide-up {
  animation: slideUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

/* Responsive: on desktop show phone centered, on mobile go fullscreen */
@media (max-width: 420px) {
  body { padding: 0; background: #FFFAF8; }
  .iphone {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height — fixes Safari mobile address bar */
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .iphone::before { display: none; } /* hide dynamic island on real phones */
  .iphone::after { bottom: 4px; }
  .screen { border-radius: 0; }
  .bottom-nav { border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 16px); }
  .status-bar { padding-top: env(safe-area-inset-top, 20px); }
}
