﻿@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap');

:root {
  --bg-color: #000000;
  --text-color: #ffffff;
  --secondary-text: #a8a8a8;
  --border-color: #262626;
  --accent-color: #FF4444; /* Reddish Brand Color */
  --phone-width: 390px;
  --phone-height: 844px;
  --bottom-nav-height: 110px;
  --top-bar-height: 54px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Source Serif 4', serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px; /* Reset base size */
}

button, input, textarea, select {
  font-family: 'Source Serif 4', serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Instrument Serif', serif;
}

/* Stage & Phone Container */
.stage {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color); /* Match phone bg for seamless look */
}

.phone {
  width: 100%;
  height: 100%;
  max-width: var(--phone-width);
  max-height: var(--phone-height);
  background-color: var(--bg-color);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

@media (min-width: 450px) {
  .phone {
    border-radius: 30px;
    height: 95vh;
    max-height: 850px;
  }
}

/* Top Bar Removed */

/* Main Viewport & Pager */
.viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.pager {
  width: 100%;
  height: 100%;
  touch-action: pan-y; /* Allow vertical scroll, handle horizontal in JS */
}

.pages {
  display: flex;
  width: 500%; /* 5 pages */
  height: 100%;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

.page {
  width: 20%;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

/* Hide scrollbar */
.page::-webkit-scrollbar {
  display: none;
}
.page {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scroll-container {
  padding-top: 20px; /* Safe area padding */
  padding-bottom: var(--bottom-nav-height);
}

/* FEED STYLES */
.stories {
  display: flex;
  gap: 14px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }

.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.story-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 2px;
  border: 2px solid #333;
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-ring.gradient {
  border: none;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.story-img {
  width: 100%;
  height: 100%;
  background-color: #1a1a1a;
  border-radius: 50%;
  border: 2px solid #000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

.story-name {
  font-size: 11px;
  color: var(--text-color);
}

.post {
  margin-bottom: 16px;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
}

.post-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
}

.username {
  font-size: 14px;
  font-weight: 600;
}

.icon-btn-small {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
}
.icon-btn-small svg { width: 20px; height: 20px; fill: currentColor; }

.post-media {
  width: 100%;
  aspect-ratio: 4/5;
  background-color: #1a1a1a;
}

.media-ramen {
  background: radial-gradient(circle, #ff9966, #ff5e62);
}
.media-toast {
  background: radial-gradient(circle, #d4fc79, #96e6a1);
}

.post-actions {
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.left-actions {
  display: flex;
  gap: 16px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0;
}
.action-btn svg { width: 24px; height: 24px; fill: currentColor; }

.post-content {
  padding: 0 12px;
}

.likes {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.caption {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.handle {
  font-weight: 600;
  margin-right: 4px;
}

.comments-link {
  color: var(--secondary-text);
  font-size: 14px;
  margin-bottom: 4px;
  cursor: pointer;
}

.timestamp {
  color: var(--secondary-text);
  font-size: 12px;
}

/* REELS STYLES */
.page-reels {
  background-color: #000;
  height: 100%;
  overflow: hidden; /* Reels handle their own scroll */
}

.reels-container {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.reels-container::-webkit-scrollbar { display: none; }

.reel-item {
  height: 100%;
  width: 100%;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reels-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
}

.reels-title {
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.reel-ui {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 110px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  pointer-events: none; /* Let clicks pass through to video/nav if not on buttons */
}

.reel-info, .reel-actions-bar {
  pointer-events: auto; /* Re-enable clicks for content */
}

.reel-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 80%;
  margin-bottom: 10px;
}

.btn-reel-remix svg {
  fill: none !important;
  stroke: #fff;
}

.reel-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #444;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
}

.follow-btn {
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.6);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
}

.reel-desc {
  font-size: 14px;
  line-height: 1.3;
}

.reel-audio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.reel-audio svg { width: 12px; height: 12px; fill: currentColor; }

.reel-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding-bottom: 10px;
}

.reel-action {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.reel-action svg { width: 28px; height: 28px; fill: #fff; }
.reel-action span { font-size: 12px; font-weight: 500; }

.reel-audio-cover {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: #333;
  border: 2px solid #fff;
}

/* PROFILE STYLES */
.profile-header {
  padding: 16px;
}

.profile-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Align left */
  gap: 20px; /* Space between pic and name */
  margin-bottom: 12px;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  border: none;
}

.profile-name-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-username {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-weight: 700;
  font-size: 18px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-color);
}

.profile-bio-section {
  margin-bottom: 16px;
}

.bio-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.bio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.bio-tag {
  background-color: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* .tag-1, .tag-2, .tag-3 removed for uniform gray */

.bio-text {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.bio-link {
  color: #e0f1ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-btn {
  flex: 1;
  background-color: #363636;
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.profile-tabs {
  display: flex;
  border-top: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0;
  color: #777;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.tab-btn.active {
  color: #fff;
  border-bottom: 1px solid #fff;
}

.tab-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
}

.grid-item {
  aspect-ratio: 1/1;
  background-color: #222;
}
.item-1 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); }
.item-2 { background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%); }
.item-3 { background: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%); }
.item-4 { background: linear-gradient(to right, #43e97b 0%, #38f9d7 100%); }
.item-5 { background: linear-gradient(to top, #5ee7df 0%, #b490ca 100%); }
.item-6 { background: linear-gradient(to top, #30cfd0 0%, #330867 100%); }
.item-7 { background: linear-gradient(to right, #f83600 0%, #f9d423 100%); }
.item-8 { background: linear-gradient(to top, #a8edea 0%, #fed6e3 100%); }
.item-9 { background: linear-gradient(to top, #d299c2 0%, #fef9d7 100%); }

.spacer-bottom {
  height: 60px;
}

/* BOTTOM NAVBAR */
.navbar {
  height: 64px;
  width: auto; /* Allow width to adjust based on content */
  /* Removed background and border for the container */
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  
  display: flex;
  justify-content: center;
  gap: 12px; /* Add gap between buttons */
  align-items: center;
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999; /* Ensure it's always on top */
  padding: 0;
  pointer-events: none; /* Allow clicks to pass through the container area */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar.hidden {
  transform: translate(-50%, 200%); /* Slide down */
  opacity: 0;
}

.nav-btn {
  pointer-events: auto; /* Re-enable clicks on buttons */
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5); /* White with opacity for difference mode */
  cursor: pointer;
  padding: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Slower transition for shape change */
  z-index: 1;
}

.nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-btn.active {
  width: 125px; /* Increased width for safety */
  border-radius: 24px;
  color: #fff;
  /* Standard Glassmorphism Recipe */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none; /* As requested */
  transform: translateY(-2px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Layout */
  justify-content: center;
  padding: 0 16px; /* Added horizontal padding */
  gap: 8px;
  
  /* Ensure rendering */
  z-index: 10;
  will-change: width, backdrop-filter; /* Optimize */
}

.nav-btn.active svg,
.nav-btn.active .nav-label {
  mix-blend-mode: normal; /* Removed difference mode for better visibility */
  text-shadow: 0 1px 3px rgba(0,0,0,0.3); /* Added shadow for contrast */
}

.nav-btn svg {
  width: 22px; /* Slightly smaller icon for better proportion */
  height: 22px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  mix-blend-mode: difference;
}

.nav-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.3s ease 0.1s, max-width 0.3s ease;
  margin-top: 1px; /* Optical vertical alignment */
}

/* @keyframes fadeIn {
  to { opacity: 1; }
} */

.nav-btn.active .nav-label {
  opacity: 1;
  max-width: 100px;
}

.nav-btn.active svg {
  transform: scale(1); /* Reset scale or keep it subtle */
}

/* Profile Specifics */
.nav-icon-profile { display: block; }
.nav-avatar { display: none; }

.nav-btn.active .nav-icon-profile { display: none; }
.nav-btn.active .nav-avatar { 
  display: flex; 
  width: 24px; 
  height: 24px;
  border-radius: 50%;
  background: #555;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
  border: 1px solid #fff;
  flex-shrink: 0;
}

/* Journey Mode Overrides */
.nav-btn.active.journey-mode {
  width: 48px;
  border-radius: 50%;
  padding: 0;
  gap: 0;
}

.nav-btn.active.journey-mode .nav-label,
.nav-btn.active.journey-mode .nav-avatar {
  display: none;
}

.nav-btn.active.journey-mode .nav-icon-profile {
  display: block;
}

/* Remove old icon classes */
.nav-icon-filled, .nav-icon-outline { display: none; }
/* ONBOARDING STYLES */
.onboarding {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000; /* Changed from gradient to black */
  z-index: 2000; /* Above everything */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0; /* Removed padding to allow full-bleed image */
  transition: opacity 0.5s ease, visibility 0.5s;
  overflow: hidden;
}

.onboarding.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.onboarding-indicators {
  position: absolute;
  top: 20px; /* Adjusted to 20px as requested */
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2010;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #888; /* Gray for inactive */
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.indicator.active {
  width: 24px;
  border-radius: 10px;
  background-color: #fff; /* White for active */
  opacity: 1;
}

/* Hide navbar when onboarding is active */
.onboarding:not(.hidden) ~ .navbar {
  display: none;
}

.onboarding-step {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  justify-content: center;
  padding: 20px;
  text-align: center;
  animation: fadeInStep 0.5s ease;
  position: relative;
}

.onboarding-step.active {
  display: flex;
}

/* Step 1 Specific Styles */
#step-1 {
  padding: 0;
}

#step-1 .onboarding-title {
  /* Removed absolute positioning that was hiding the title */
  position: relative;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
  margin-top: 80px; /* Moved down slightly */
}

#step-1 .onboarding-actions {
  position: absolute;
  bottom: 8%;
  left: 40px;
  right: 40px;
  width: auto;
}

.deco-star {
  position: absolute;
  z-index: 5;
  width: 50px;
  height: auto;
  pointer-events: none;
}

.star-left {
  top: 20%;
  left: 2%;
  width: 75px; /* Increased size */
  animation: breatheStar 6s ease-in-out infinite;
}

.star-right {
  bottom: 22%;
  right: 8%;
  width: 130px; /* Increased size */
  animation: breatheStarRotated 6s ease-in-out infinite; /* Same duration as onboarding1 */
}

.welcome-msg {
  position: absolute;
  bottom: 3%;
  width: 100%;
  text-align: center;
  color: #ffffff;
  font-size: 9px; /* Reduced font size to 9px */
  font-weight: 500;
  opacity: 0.8;
  z-index: 20;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breatheStar {
  0% { transform: scale(1) rotate(-30deg); }
  50% { transform: scale(1.2) rotate(-35deg); }
  100% { transform: scale(1) rotate(-30deg); }
}

@keyframes breatheStarRotated {
  0% { transform: scale(1.4) rotate(30deg); } /* Start big */
  50% { transform: scale(1) rotate(35deg); } /* Shrink */
  100% { transform: scale(1.4) rotate(30deg); } /* Back to big */
}

@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboarding-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 80%;
  object-fit: contain;
  object-position: center;
  margin: 0;
  z-index: 1;
  pointer-events: none;
  animation: breatheAndRock 6s ease-in-out infinite;
}

@keyframes breatheAndRock {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

.onboarding-title {
  font-family: 'Instrument Serif', serif;
  font-size: 64px;
  margin-top: 0;
  font-weight: 400;
  margin-bottom: 40px;
  color: #ffffff;
  z-index: 10;
  flex-shrink: 0;
  line-height: 1.1;
  padding-bottom: 10px; /* Prevent text cropping */
  opacity: 0;
  animation: slideDownFade 1s ease-out forwards;
}

.title-highlight {
  font-size: 140px;
  display: block;
  font-style: italic;
  padding-right: 10px; /* Prevent italic/wide text cropping */
  margin-top: 0px;
  opacity: 0;
  animation: slideDownFade 1s ease-out 0.3s forwards;
}

.onboarding-actions {
  display: flex;
  gap: 15px;
  z-index: 20;
  padding-bottom: 0;
  flex-shrink: 0;
  width: 100%;
}

.onboarding-nav-buttons {
  display: flex;
  gap: 15px;
  position: absolute;
  bottom: 8%;
  left: 40px;
  right: 40px;
  width: auto;
  margin-top: 0;
  z-index: 20;
}

.onboarding-btn {
  flex: 1;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 10px; /* Reduced font size to 10px */
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.onboarding-btn:active {
  transform: scale(0.95);
}

.btn-yes {
  background: #fff; /* Changed to white */
  color: #000; /* Changed to black */
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-no {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-next, .btn-finish {
  width: 100%;
  margin-top: 0; /* Reset margin since it's in a flex container now */
  background: #fff;
  color: #000;
  flex: 1; /* Share space */
  padding: 16px;
  font-size: 16px;
}

.btn-back {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  flex: 0 0 80px; /* Fixed width for back button */
  padding: 16px;
  font-size: 16px;
}

.preference-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.preference-grid-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  width: 100%;
  max-width: 340px;
  margin-bottom: 20px;
}

.preference-grid-images.grid-3-cols {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  max-width: 380px;
}

.preference-grid-images.grid-3-cols .pref-image-btn {
  padding: 10px;
}

.preference-grid-images.grid-3-cols .pref-label {
  font-size: 12px;
}

.preference-grid-images.grid-3-cols .pref-icon-wrapper {
  margin-bottom: 15px;
}

.pref-image-btn {
  background: #1a1a1a;
  border: none;
  border-radius: 20px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  aspect-ratio: 1;
}

.pref-image-btn.selected {
  background: #1a1a1a;
  border: none;
}

.pref-image-btn.selected .pref-icon {
  transform: scale(1.3);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.4));
  opacity: 1;
}

/* Stop breathing animation on wrapper when selected */
.pref-image-btn.selected .pref-icon-wrapper {
  animation: none;
}

/* Shrink other images when one is selected */
.preference-grid-images.has-selection .pref-image-btn:not(.selected) .pref-icon {
  transform: scale(0.8);
  opacity: 0.5;
  filter: grayscale(0.5);
}

.preference-grid-images.has-selection .pref-image-btn:not(.selected) .pref-icon-wrapper {
  animation: none;
}

.pref-icon-wrapper {
  width: 100%;
  height: 70%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
  animation: breatheIcon 4s ease-in-out infinite;
}

.pref-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease, opacity 0.3s ease;
  will-change: transform;
}

/* Randomize animation timing on wrapper */
.pref-image-btn:nth-child(1) .pref-icon-wrapper { animation-delay: 0s; }
.pref-image-btn:nth-child(2) .pref-icon-wrapper { animation-delay: -1.2s; }
.pref-image-btn:nth-child(3) .pref-icon-wrapper { animation-delay: -2.5s; }
.pref-image-btn:nth-child(4) .pref-icon-wrapper { animation-delay: -0.7s; }
.pref-image-btn:nth-child(5) .pref-icon-wrapper { animation-delay: -1.8s; }
.pref-image-btn:nth-child(6) .pref-icon-wrapper { animation-delay: -3.1s; }
.pref-image-btn:nth-child(7) .pref-icon-wrapper { animation-delay: -0.5s; }
.pref-image-btn:nth-child(8) .pref-icon-wrapper { animation-delay: -2.2s; }
.pref-image-btn:nth-child(9) .pref-icon-wrapper { animation-delay: -1.5s; }

.pref-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

@keyframes breatheIcon {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.pref-btn {
  background: #222;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pref-btn.selected {
  background: #fff;
  color: #000;
  border-color: #fff;
  transform: scale(1.05);
}

/* FEED STYLES (Vertical Scroll) */
.card-stack-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 100px; /* Space for nav */
  overflow: hidden;
}

.feed-scroll-container {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Firefox */
}

.feed-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.feed-item {
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.food-card {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 24px;
  position: relative;
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.food-card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* Fix for button interaction on card back */
.food-card.flipped .card-back {
  z-index: 2;
  pointer-events: auto;
}

.food-card.flipped .card-front {
  pointer-events: none;
  z-index: -1;
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 24px;
  overflow: hidden;
}

.card-front {
  /* background-size: cover; REMOVED - now handled by .card-img-bg */
  /* background-position: center; REMOVED */
  /* position: relative; REMOVED - caused layout shift on flip */
  overflow: hidden; /* Ensure image doesn't overflow when scaled */
}

.card-img-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
  animation: breathe 10s ease-in-out infinite;
  transform-origin: center;
}

@keyframes breathe {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Ensure content stays on top */
.rating-badge,
.feed-content,
.dietary-tags {
  position: relative;
  z-index: 2;
}

.card-front::after {
  content: '';
  position: absolute;
  bottom: -5px; /* Moved down slightly to fix gap/alignment */
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  z-index: 1;
  pointer-events: none;
}

.card-back {
  background-color: #1a1a1a;
  color: white;
  transform: rotateY(180deg);
  padding: 16px; /* Reduced padding */
  display: flex;
  flex-direction: column;
  gap: 10px; /* Reduced gap */
  overflow-y: auto;
  cursor: default;
}

/* Ensure buttons are always clickable */
.card-back button, 
.card-back .btn-step, 
.card-back .btn-adjust, 
.card-back .btn-timer-toggle {
  pointer-events: auto;
  cursor: pointer;
  z-index: 20;
  position: relative;
}

/* Scrollbar for card back */
.card-back {
  scrollbar-width: none; /* Firefox */
}
.card-back::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.btn-flip-back {
  position: absolute;
  top: 16px;
  left: 16px; /* Changed from right to left to appear on right when flipped */
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%; /* Circle shape */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 20; /* Higher than card content */
  transition: background 0.2s;
  padding: 0;
  /* Fix for position and visibility on flip */
  transform: rotateY(180deg) translateZ(1px);
  backface-visibility: hidden;
}

.btn-flip-back svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
}

.btn-flip-back:hover {
  background: rgba(255, 255, 255, 0.25);
}

.recipe-section h3 {
  font-size: 14px;
  color: var(--accent-color);
  margin-bottom: 4px; /* Reduced margin */
  border-bottom: none; /* Removed underline */
  padding-bottom: 0; /* Removed padding */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ingredients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingredient-tag {
  background: #2a2a2a;
  border: 1px solid #333;
  padding: 6px 12px;
  border-radius: 20px; /* Pill shape */
  font-size: 11px;
  color: #ccc;
}

.recipe-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.step-item {
  background: #222;
  padding: 8px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.4;
  border: 1px solid #333;
  transition: all 0.3s ease;
}

.step-item.completed {
  opacity: 0.4;
  filter: grayscale(100%);
}

.step-item.active {
  border-color: var(--accent-color);
  background: rgba(255, 68, 68, 0.1); /* Brand color tint (Red) */
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.3);
}

.step-num {
  color: var(--accent-color);
  font-weight: bold;
  margin-bottom: 2px;
  display: block;
  font-size: 11px;
}

/* New Timer & Nav Styles */
.timer-control-panel {
  background: #222;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 8px; /* Reduced padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px; /* Reduced margin */
  margin-bottom: 5px; /* Reduced margin */
}

.timer-adjust-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-adjust {
  background: #333;
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-adjust:active {
  background: #444;
}

.timer-display {
  font-size: 16px;
  font-weight: bold;
  font-family: monospace;
  color: #fff;
  min-width: 50px;
  text-align: center;
}

.btn-timer-toggle {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.step-nav-panel {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping */
  justify-content: center; /* Center content */
  gap: 4px; /* Small gap between buttons */
  margin-top: auto; /* Push to bottom if space allows */
  padding-top: 5px; /* Reduced padding */
  border-top: none; /* Removed top border */
}

.btn-step {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  padding: 10px 16px; /* Increased padding for touch target */
  border-radius: 12px; /* Slightly less rounded */
  font-size: 14px; /* Larger font */
  cursor: pointer;
  transition: all 0.2s;
  flex: 1; /* Share width */
  display: flex;
  justify-content: center;
  align-items: center;
  order: 1; /* Buttons first */
}

.btn-step:hover {
  border-color: #666;
  color: #fff;
}

.btn-step:active {
  background: #333;
}

.step-indicator {
  font-size: 11px;
  color: #666;
  font-weight: 600;
  width: 100%; /* Full width to force new line */
  text-align: center;
  order: 2; /* Indicator last */
  margin-top: 4px;
}

.feed-content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
  color: #fff;
}

.feed-content h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.rating-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 20px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
}

.food-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.dietary-tags {
  position: absolute;
  bottom: 15px;
  right: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 10;
}

.dietary-tag {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.feed-info-box {
  margin-top: 15px;
  background: #080808;
  border: none;
  border-radius: 16px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 10px;
  color: #888;
  margin-bottom: 4px;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.btn-save {
  background: #fff;
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.feed-author-area {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 5px;
}

.feed-item-stats {
  margin-left: auto; /* Push to right */
  display: flex;
  gap: 12px;
}

.f-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.f-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-color);
}

.f-label {
  font-size: 9px;
  color: var(--secondary-text);
  text-transform: uppercase;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.author-rating {
  font-size: 12px;
  color: #FFD700; /* Gold */
}


  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

.card-content h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-content p {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
}

.card-overlay {
  position: absolute;
  top: 40px;
  padding: 8px 16px;
  border: 4px solid;
  border-radius: 8px;
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-15deg);
  pointer-events: none;
}

.overlay-like {
  left: 40px;
  color: #4CD964;
  border-color: #4CD964;
  transform: rotate(-15deg);
}

.overlay-nope {
  right: 40px;
  color: #FF3B30;
  border-color: #FF3B30;
  transform: rotate(15deg);
}

.tinder-actions {
  display: none;
}

.tinder-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: #222;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tinder-btn:hover {
  transform: scale(1.1);
  background: #333;
}

.btn-like { color: #4CD964; }
.btn-pass { color: #FF3B30; }


/* Mobile Optimization for Onboarding Steps */
@media (max-width: 480px), (max-height: 800px) {
  .onboarding-title {
    font-size: 35px;
    margin-bottom: 20px;
  }

  .title-highlight {
    font-size: 75px;
  }

  .preference-grid-images {
    gap: 8px;
    max-width: 280px; /* Smaller width to fit screen */
    margin-bottom: 15px;
  }

  .preference-grid-images.grid-3-cols {
    max-width: 320px;
    gap: 6px;
  }

  .pref-image-btn {
    padding: 8px;
  }

  .pref-icon-wrapper {
    margin-bottom: 5px; /* Reduce spacing */
    height: 60%;
  }

  .pref-label {
    font-size: 12px;
  }
  
  .preference-grid-images.grid-3-cols .pref-label {
    font-size: 10px;
  }
  
  .onboarding-nav-buttons {
    margin-top: 15px;
  }
}

/* Review Modal Styles */
.review-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001; /* Higher than navbar (9999) */
  display: flex;
  align-items: flex-end; /* Bottom sheet */
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.review-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.review-modal {
  background: #000000; /* Solid Black Background */
  width: 100%;
  max-width: 480px; /* Match app width */
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 24px;
  padding-top: 60px; /* Increased top padding to clear close button */
  padding-bottom: 40px; /* Extra padding at bottom */
  min-height: 80%; /* Increased height */
  position: relative;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  border-top: none; /* Removed border */
}

.review-modal-overlay.hidden .review-modal {
  transform: translateY(100%);
}

.btn-close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #262626;
  margin-top: 10px;
}

.modal-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-color);
}

.user-rating {
  font-size: 13px;
  color: #FFD700; /* Gold for star */
  font-weight: 600;
}

.modal-stats {
  display: flex;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-color);
}

.stat-label {
  font-size: 11px;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Interactive Star Rating */
.star-rating-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #333; /* Default empty color */
  transition: transform 0.1s, color 0.2s;
}

.star-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1;
}

.star-btn.active,
.star-btn.hover {
  color: #FFD700; /* Gold */
}

.star-btn:active {
  transform: scale(0.9);
}

.modal-header h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: var(--text-color);
}

.share-options {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-share {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none; /* Removed border */
  background: #1F1F1F; /* Dark Gray Background */
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
}

.review-input {
  width: 100%;
  height: 100px;
  border-radius: 12px;
  border: none; /* Removed border */
  background: #1F1F1F; /* Dark Gray Background */
  color: var(--text-color);
  padding: 12px;
  font-family: inherit;
  resize: none;
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-modal-action {
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 16px;
  flex: 1; /* Equal width for both buttons */
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-modal-action.primary {
  background: var(--accent-color);
  color: white;
}

.btn-modal-action.secondary {
  background: #1F1F1F; /* Dark Gray Background */
  color: var(--text-color);
  border: none; /* Removed border */
}

/* Bon Appétit Button State */
.btn-step.finish {
  background-color: var(--accent-color);
  color: white;
  width: auto;
  padding: 0 16px;
  font-weight: 700;
}

/* --- NEW PROFILE STYLES --- */
.profile-header-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px;
  gap: 12px;
}

.profile-pic-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  border: 2px solid #444;
}

.profile-username-large {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  font-family: 'Source Serif 4', serif; /* Changed to sub font */
}

.profile-actions-centered {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.profile-btn-pill {
  background: #1F1F1F;
  border: 1px solid #333;
  color: var(--text-color);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-btn-pill:hover {
  background: #333;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 10px;
  margin-top: 10px;
}

.section-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.btn-icon-only {
  background: none;
  border: none;
  color: var(--secondary-text);
  cursor: pointer;
  padding: 4px;
}

.fridge-image-container {
  margin: 0 20px 10px 20px;
  border-radius: 20px;
  overflow: hidden;
  background: #111111; /* Much Darker Grey */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  min-height: 180px;
}

.fs-label {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 36px;
  color: white;
  text-transform: none;
  letter-spacing: 0.5px;
  font-weight: 600;
  font-family: 'Instrument Serif', serif;
  z-index: 2;
}

.fs-value {
  position: absolute;
  bottom: 60px; /* Moved up to avoid overlap with marquee */
  right: 20px;
  font-size: 96px; /* Much larger */
  font-weight: 400; /* Lighter weight for large serif */
  color: var(--text-color);
  font-family: 'Instrument Serif', serif;
  z-index: 2;
  line-height: 1;
}

.fridge-img {
  width: 55%;
  height: auto;
  object-fit: contain;
  display: block;
  animation: breathe-rotate 10s ease-in-out infinite;
  transform-origin: center;
  z-index: 1;
}

@keyframes breathe-rotate {
  0% { transform: scale(1) rotate(-30deg); }
  50% { transform: scale(1.1) rotate(-30deg); }
  100% { transform: scale(1) rotate(-30deg); }
}

.journey-card {
  margin: 0 20px 10px 20px;
  border-radius: 20px;
  overflow: hidden;
  background: #2C2C2C; /* Medium-Dark Grey */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  position: relative;
  height: 90px;
  cursor: pointer;
  transition: transform 0.2s;
}

.journey-card:active {
  transform: scale(0.98);
}

.journey-title {
  font-size: 32px; /* Increased size */
  font-weight: 800;
  color: var(--text-color);
  font-family: 'Instrument Serif', serif;
}

.journey-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-family: 'Source Serif 4', serif;
}

/* Removed .journey-info and .journal-img styles as they are no longer used */

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px; /* Increased gap slightly */
  padding: 0 20px; /* Added side padding */
}

.journal-item {
  aspect-ratio: 1/1;
  background-color: #222;
  background-size: cover;
  background-position: center;
  border-radius: 8px; /* Slight rounded edge */
}

/* --- FOOD JOURNEY DASHBOARD --- */
.journey-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
}

.journey-title-group h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text-color);
}

.journey-date {
  font-size: 14px;
  color: var(--secondary-text);
  font-weight: 500;
}

.toggle-container {
  background: #1F1F1F;
  border-radius: 20px;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--secondary-text);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: #333;
  color: white;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px;
}

.bento-card {
  background: #1F1F1F;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary-text);
}

.badge-good {
  background: rgba(52, 199, 89, 0.2);
  color: #34C759;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 10px;
}

/* Calorie Card */
.calorie-card {
  grid-column: span 1;
}

.calorie-display {
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.big-number {
  font-size: 32px;
  font-weight: 800;
  color: white;
  letter-spacing: -1px;
}

.unit {
  font-size: 14px;
  color: var(--secondary-text);
  font-weight: 600;
}

.calorie-progress-bg {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.calorie-progress-fill {
  height: 100%;
  background: linear-gradient(45deg, #FF512F, #DD2476);
  border-radius: 3px;
}

.sub-text {
  font-size: 12px;
  color: var(--secondary-text);
}

/* Spike Card */
.spike-card {
  grid-column: span 1;
}

.spike-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.spike-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.spike-icon {
  font-size: 18px;
}

.spike-text {
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}

.mini-chart .bar {
  flex: 1;
  background: #333;
  border-radius: 2px;
}

.mini-chart .bar.active {
  background: linear-gradient(to top, #FF512F, #DD2476);
}

/* Macros Card */
.macros-card {
  grid-column: span 2;
}

.macro-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.macro-item {
  width: 100%;
}

.macro-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
}

.macro-label-row .label { color: var(--secondary-text); }
.macro-label-row .val { color: white; }

.m-bar-bg {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.m-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.c-fill { background: #FF9F0A; }
.p-fill { background: #30D158; }
.f-fill { background: #0A84FF; }

/* Nutrient Split Card */
.nutrient-split-card {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 24px;
}

.nutrient-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nutrient-divider {
  width: 1px;
  height: 40px;
  background: #333;
}

.n-label {
  font-size: 12px;
  color: var(--secondary-text);
  font-weight: 600;
  text-transform: uppercase;
}

.n-val {
  font-size: 24px;
  font-weight: 800;
}

.n-val.warning { color: #FF453A; }
.n-val.good { color: #30D158; }

.n-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary-text);
}

/* Trend Card */
.trend-card {
  grid-column: span 2;
}

.trend-chart {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 120px;
  padding-top: 20px;
}

.t-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  flex: 1;
}

.t-bar {
  width: 8px;
  background: #333;
  border-radius: 4px;
  transition: height 0.5s ease;
}

.t-bar.active {
  background: linear-gradient(to top, #FF512F, #DD2476);
  box-shadow: 0 0 10px rgba(221, 36, 118, 0.4);
}

.day {
  font-size: 12px;
  color: var(--secondary-text);
  font-weight: 600;
}

/* Removed old button styles to avoid conflict */
/* .btn-check-journey { ... } */


/* FAB Button */
.fab-btn {
  position: absolute;
  top: 20px; /* Moved to top left */
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: transparent; /* Changed to transparent for pseudo-element */
  color: #000;
  border: none;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 105; /* Increased z-index to be above overlay (104) */
  transition: box-shadow 0.2s;
}

/* White Circle Background */
.fab-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 50%;
  z-index: -1;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded State */
.fab-btn.active::before {
  transform: scale(1); /* Don't expand, let overlay handle background */
}

.fab-btn.active {
  box-shadow: none; /* Remove shadow when expanded */
}

/* Icon Rotation */
.fab-btn svg {
  transition: transform 0.3s ease;
}

.fab-btn.active svg {
  transform: rotate(135deg); /* Rotate to X */
}

.fab-btn:active {
  transform: scale(0.95);
}

/* Step 1 Updates */
#step-1 {
  background: #000 !important; /* Force black */
}

.marquee-container {
  width: 100%;
  overflow: hidden;
  margin: 40px 0;
  position: relative;
}

.marquee-content {
  display: flex;
  gap: 16px;
  animation: marquee-scroll 20s linear infinite;
  width: max-content;
}

.marquee-img {
  width: 220px; /* Increased size */
  height: 320px; /* Increased size */
  object-fit: cover;
  border-radius: 24px;
  flex-shrink: 0;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Step 2 & 3 Title Animation */
.onboarding-title {
  font-size: 36px !important; /* Increased size */
  animation: bounce-down-up 2s ease-in-out infinite;
}

@keyframes bounce-down-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* Fridge Ingredients Marquee */
.ingredients-marquee-container {
  width: 100%;
  overflow: hidden;
  position: absolute; /* Position absolutely within the fridge container */
  bottom: 20px; /* Place at the bottom */
  left: 0;
  z-index: 5;
}

.ingredients-marquee-content {
  display: flex;
  gap: 12px;
  animation: marquee-scroll-left 15s linear infinite;
  width: max-content;
}

.pill-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Food Journey Button Styling */
.btn-check-journey {
  width: auto; /* Let margins control width */
  margin: 0 20px 20px 20px; /* Match Fridge margins */
  background: #ffffff; /* Changed to White */
  border-radius: 20px;
  padding: 24px;
  border: none;
  cursor: pointer;
  display: block;
  text-align: left;
  transition: transform 0.2s;
  min-height: 100px;
  position: relative;
}

.btn-check-journey:active {
  transform: scale(0.98);
}

.journey-content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.journey-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  color: black; /* Changed to Black */
  font-weight: 400;
}

.journey-icon {
  color: black; /* Changed to Black */
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes marquee-scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}


/* Fix Onboarding Title Visibility */
.onboarding-title {
  color: #fff !important;
  text-align: left; /* Changed to left */
  margin-bottom: 20px;
}

.title-highlight {
  color: #fff !important; /* Unified white */
}


/* FORCE FIX for Step 1 Title */
#step-1 .onboarding-title {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  text-align: left !important; /* Left align */
  margin-top: 60px;
  margin-left: 24px; /* Left margin */
  z-index: 20;
  width: auto !important;
  font-size: 52px !important; /* Larger size */
  line-height: 1.1;
}


/* FINAL VISIBILITY FIX */
.onboarding-title {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: #fff !important;
  z-index: 9999 !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}


/* Ensure Marquee Container has enough height for larger images */
.marquee-container {
  height: 340px;
  display: flex;
  align-items: center;
}


/* Updated Check Journey Button */
.btn-check-journey {
  background: #2C2C2C;
  color: #fff;
  border: 1px solid #333;
  padding: 10px 20px; /* Reduced padding */
  border-radius: 24px;
  font-size: 14px; /* Reduced font size */
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  width: auto; /* Auto width */
}

.btn-check-journey:hover {
  background: #333;
}

/* Updated Pill Glass (Smaller) */
.pill-glass {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(4px) !important;
  padding: 6px 12px !important; /* Reduced padding */
  border-radius: 16px !important;
  font-size: 12px !important; /* Reduced font size */
  color: #fff !important;
  white-space: nowrap !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}


/* Further Reduce Check Journey Button Size */
.btn-check-journey {
  padding: 6px 16px !important;
  font-size: 12px !important;
  border-radius: 20px !important;
  height: auto !important;
  min-height: 30px !important;
}

.btn-check-journey svg {
  width: 14px !important;
  height: 14px !important;
}


/* Minimalist Check Journey Button (Arrow Only) */
.btn-check-journey {
  background: #ffffff !important;
  border: none !important;
  padding: 12px 20px !important; /* Reduced vertical padding */
  margin: 0 20px 20px 20px !important; /* Match Fridge margins */
  width: calc(100% - 40px) !important; /* Force full width minus margins */
  min-height: auto !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
  border-radius: 20px !important; /* Match Fridge border-radius */
  color: #000 !important;
  display: block !important;
  box-sizing: border-box !important;
}

.btn-check-journey .journey-content-wrapper {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
}

.btn-check-journey .journey-title {
  font-size: 20px !important; /* Reduced font size */
}

.btn-check-journey:hover {
  background: #f0f0f0 !important;
}

.btn-check-journey svg {
  width: 20px !important;
  height: 20px !important;
  stroke: #000 !important;
  stroke-width: 1.5px !important;
}

/* Align Onboarding Title with Buttons */
#step-1 .onboarding-title {
  margin-left: 0 !important; /* Reset margin */
  padding-left: 0 !important;
  text-align: left !important;
  width: 100% !important;
  padding: 0 20px; /* Match container padding if needed, or 0 if container has padding */
}

/* Ensure Onboarding Actions align */
.onboarding-actions {
  width: 100%;
  padding: 0 20px; /* Ensure buttons have same side spacing */
  display: flex;
  gap: 12px;
}

/* Override Step 1 Title specific positioning */
#step-1 .onboarding-title {
  padding-left: 20px !important; /* Align with button container padding */
}


/* Adjust Marquee Position and Speed */
.marquee-container {
  margin-top: -40px !important; /* Move up */
  margin-bottom: 20px !important;
}

/* --- Final Onboarding Adjustments --- */

/* Marquee Container & Animation */
.marquee-container {
  margin-top: 20px !important;
  margin-bottom: 40px !important;
}

.marquee-content {
  animation-duration: 60s !important; /* Slower speed */
}

/* Marquee Images Wrapper */
.marquee-item {
  width: 240px !important; /* Reduced size as requested */
  height: 320px !important; /* 3:4 Aspect Ratio */
  border-radius: 24px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
  background: #222 !important;
  position: relative !important;
  margin-right: 8px !important; /* Add spacing between items */
  /* WebKit Fix for Border Radius Clipping */
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.marquee-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 0 !important;
  filter: brightness(0.9);
}

/* Title Adjustments */
#step-1 .onboarding-title {
  margin-top: -60px !important;
  margin-bottom: 40px !important;
  text-shadow: none !important;
  position: relative;
  z-index: 10;
}

/* --- Journal Onboarding Overlay --- */
.journal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 104; /* Above FAB (103) so text is visible */
  pointer-events: auto; /* Capture clicks so they don't go through */
  background: #fff; /* White background */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  
  /* Animation: Expand from FAB */
  clip-path: circle(0px at 48px 48px); /* Start at FAB center */
  transition: clip-path 0.6s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s 0.6s; /* Custom ease */
  visibility: hidden;
}

.journal-overlay.visible {
  clip-path: circle(150% at 48px 48px); /* Expand to fill screen */
  visibility: visible;
  transition: clip-path 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.journal-text-group {
  margin-top: 40px; /* Reduced space */
  display: flex;
  flex-direction: column;
  gap: 20px; /* Reduced gap */
  transition: transform 0.5s ease, opacity 0.5s ease; /* For slide out */
  pointer-events: auto; /* Enable clicks on text/buttons */
}

.journal-text-group.slide-out {
  transform: translateX(-50px);
  opacity: 0;
  pointer-events: none;
}

.journal-title-line {
  font-family: 'Instrument Serif', serif;
  font-size: 42px; /* Optimized for mobile */
  line-height: 1.1;
  color: #000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000);
  margin: 0;
}

.journal-title-line:first-child {
  font-size: 56px; /* Optimized for mobile */
}

.btn-journal-start {
  margin-top: 180px; /* Restored to original position */
  background: #000;
  color: #fff;
  font-family: 'Source Serif 4', serif;
  font-size: 16px; /* Restored to original size */
  padding: 12px 28px; /* Restored padding */
  border-radius: 100px;
  border: none;
  cursor: pointer;
  width: fit-content;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000);
  pointer-events: auto; /* Enable click for this button */
  font-weight: 600;
}

.btn-journal-start.camera-mode {
  transform: translateY(300px) !important; /* Restored to original position */
}

/* --- Journal Camera Box --- */
.journal-camera-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(100vw, -50%); /* Start off-screen right */
  width: 75vw; /* Responsive width */
  height: 75vw; /* Responsive height (square) */
  max-width: 300px;
  max-height: 300px;
  background: #000;
  border-radius: 32px;
  overflow: hidden;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000);
  pointer-events: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.journal-camera-box.active {
  transform: translate(-50%, -50%); /* Center */
  opacity: 1;
}

.journal-camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror effect */
}

.journal-captured-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* Camera Status Text */
.camera-status-text {
  position: absolute;
  top: 15%; /* Responsive top */
  right: 24px; /* Screen relative right */
  color: #000; /* Black text */
  font-family: 'Instrument Serif', serif;
  font-size: 42px; /* Optimized font size */
  z-index: 102; /* Above overlay */
  text-align: right;
  opacity: 0;
  transition: opacity 0.5s ease 0.5s; /* Delay to appear after box slides in */
  pointer-events: none;
  line-height: 1;
}

.camera-status-text.visible {
  opacity: 1;
}

.loading-dots {
  display: none; /* Remove animation */
}

/* Red Circle (Enable Camera) - Top Left */

.loading-dots::after {
  content: '...';
  animation: dots 2s steps(4, end) infinite;
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  text-align: left;
}

@keyframes dots {
  to { width: 1.25em; }
}

/* Red Circle (Enable Camera) - Top Left */
.btn-camera-enable {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #FF453A; /* Red border */
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.btn-camera-enable:hover {
  background: rgba(255, 69, 58, 0.2);
}

.btn-camera-enable.active {
  background: #FF453A;
  box-shadow: 0 0 10px #FF453A;
}

/* White Circle (Capture) - Bottom Right */
.btn-camera-capture-journal {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s;
  display: none; /* Hidden until camera enabled */
}

.btn-camera-capture-journal:active {
  transform: scale(0.9);
}

/* Upload Text */
.journal-upload-text {
  position: absolute;
  bottom: 10%; /* Responsive bottom */
  left: 50%;
  transform: translateX(-50%); /* Center horizontally */
  font-family: 'Source Serif 4', serif;
  font-size: 14px; /* Restored to original size */
  color: #999;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s ease 0.5s;
  pointer-events: auto;
  z-index: 102;
  width: 100%;
  text-align: center;
}

.journal-camera-box.active ~ .journal-upload-text {
  opacity: 1;
}

/* Animation Delays & Visibility */
.journal-overlay.visible .journal-title-line,
.journal-overlay.visible .btn-journal-start {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* Button States - Overrides */

/* Camera Mode (Waiting for Photo): Gray, Disabled */
.btn-journal-start.camera-mode {
  background: #E5E5EA !important; /* Light Gray */
  color: #999 !important;
  border: none !important;
  transform: translateY(0) !important;
  pointer-events: none !important; /* Not clickable */
}

/* Camera Mode + Photo: Black, Active */
.btn-journal-start.camera-mode.has-photo {
  background: #000 !important;
  color: #fff !important;
  pointer-events: auto !important; /* Clickable */
  cursor: pointer !important;
}

.btn-journal-start:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


/* Reel Action Buttons - Default State for Lucide Icons */
.reel-action svg.lucide {
  fill: transparent;
}

/* Reel Action Buttons - Filled State */
.reel-action.filled svg {
  fill: white;
  color: white;
  animation: like-bounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes like-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Bottom Sheet Modals */
.bottom-sheet-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(2px);
}

.bottom-sheet-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  width: 100%;
  background: #1e1e1e; /* Dark background */
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.bottom-sheet-overlay.visible .bottom-sheet {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #444;
  border-radius: 2px;
  position: absolute;
  top: -10px;
}

.sheet-title {
  font-weight: 600;
  font-size: 16px;
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}

/* Comment Styles */
.comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}

.comment-body {
  flex: 1;
}

.comment-user {
  font-weight: 600;
  font-size: 13px;
  margin-right: 8px;
}

.comment-text {
  font-size: 13px;
  color: #eee;
}

.comment-meta {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.sheet-footer {
  padding-top: 12px;
  border-top: 1px solid #333;
  margin-top: auto;
}

.comment-input-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-avatar.small {
  width: 28px;
  height: 28px;
  font-size: 10px;
  flex-shrink: 0;
}

#commentInput {
  flex: 1;
  background: #333;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

#commentInput::placeholder {
  color: #888;
}

#btnPostComment {
  background: none;
  border: none;
  color: #0095f6; /* Instagram blue */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
}

#btnPostComment:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Share Styles */
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 10px 0;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.share-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
}

.share-name {
  font-size: 11px;
  color: #ccc;
}


/* Double Tap Heart Animation */
.double-tap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100px;
  height: 100px;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
}

.double-tap-heart svg {
  width: 100%;
  height: 100%;
  fill: white;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.double-tap-heart.animate {
  animation: doubleTapLike 0.8s ease-out forwards;
}

@keyframes doubleTapLike {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}


/* Reel Tags */
.reel-tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.reel-tags .pill-glass {
  padding: 4px 12px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3); /* Slightly darker for better contrast on video */
  border: 1px solid rgba(255, 255, 255, 0.3);
}


/* White Mode for Recap Page */
.page-journey {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.page-journey .journey-header h2 {
  color: #000000;
}

.page-journey .journey-date {
  color: #666666;
}

.page-journey .bento-card {
  background: #F2F2F7; /* Light gray for cards */
  border: 1px solid #E5E5EA;
}

.page-journey .card-title {
  color: #8E8E93;
}

.page-journey .big-number {
  color: #000000;
}

.page-journey .unit,
.page-journey .sub-text {
  color: #8E8E93;
}

.page-journey .calorie-progress-bg {
  background: #E5E5EA;
}

.page-journey .spike-status {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
}

.page-journey .spike-text {
  color: #000000;
}

.page-journey .mini-chart .bar {
  background: #D1D1D6;
}

.page-journey .mini-chart .bar.active {
  background: #000000;
}

/* Macros Card */
.page-journey .macro-label-row .label {
  color: #8E8E93;
}

.page-journey .macro-label-row .val {
  color: #000000;
}

.page-journey .m-bar-bg {
  background: #E5E5EA;
}

/* Nutrient Split Card */
.page-journey .n-label {
  color: #8E8E93;
}

.page-journey .n-val {
  color: #000000;
}

.page-journey .n-sub {
  color: #8E8E93;
}

.page-journey .nutrient-divider {
  background: #E5E5EA;
}

/* Trend Card */
.page-journey .trend-chart .t-bar {
  background: #D1D1D6;
}

.page-journey .trend-chart .t-bar.active {
  background: #000000;
}

.page-journey .trend-chart .day {
  color: #8E8E93;
}

.page-journey .toggle-btn {
  color: #8E8E93;
  border: 1px solid #E5E5EA;
}

.page-journey .toggle-btn.active {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}


/* Profile Icon Black in Journey Mode (Recap Page) */
.nav-btn.active.journey-mode {
  color: #000000 !important;
  background: rgba(0, 0, 0, 0.05) !important;
}


/* Latest Food Section in Recap */
.latest-food-section {
  padding: 0 20px;
  margin-bottom: 24px;
}

.latest-food-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  border-radius: 24px;
  margin-bottom: 12px;
  border: 1px solid #E5E5EA;
}

.latest-food-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px; /* Slightly larger for readability */
  font-family: 'Source Serif 4', serif;
}

.latest-time {
  color: #666666;
}

.latest-name {
  color: #000000;
  font-weight: 600;
}


/* Updated Latest Food Section Styles */
.latest-food-info {
  margin-bottom: 8px;
}

.latest-meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.latest-date {
  font-size: 11px;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.latest-time {
  font-size: 13px;
  color: #000000;
  font-weight: 600;
}

.latest-name {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
}

.latest-description {
  font-size: 13px;
  color: #444;
  line-height: 1.4;
  font-family: 'Source Serif 4', serif;
}


/* Glucose Pill Redesign */
.glucose-pill-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.glucose-pill-track {
  width: 100%;
  height: 32px; /* Pill height */
  background: #E5E5EA;
  border-radius: 100px; /* Pill shape */
  overflow: hidden;
  position: relative;
}

.glucose-pill-fill {
  height: 100%;
  background: #000000;
  border-radius: 100px;
  transition: width 1s linear; /* Smooth transition for timer effect */
}

.glucose-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.glucose-percentage {
  font-size: 24px;
  font-weight: 800;
  color: #000000;
  font-family: 'Instrument Serif', serif; /* Stylish font */
}

.glucose-timer {
  font-size: 14px;
  color: #666666;
  font-family: 'Source Serif 4', serif;
  font-variant-numeric: tabular-nums; /* Fixed width numbers for timer */
}

/* Unify Graph Colors to Black */
.page-journey .mini-chart .bar {
  background: #E5E5EA !important;
}

.page-journey .mini-chart .bar.active {
  background: #000000 !important;
}


/* Pill-shaped Bars for Glucose Graph */
.page-journey .mini-chart .bar {
  border-radius: 100px !important; /* Full pill shape */
  width: 12px; /* Slightly wider for better pill look */
}


/* Black Mode for Calories & Macros in Recap */
.page-journey .calorie-progress-fill {
  background: #000000 !important;
}

.page-journey .c-fill,
.page-journey .p-fill,
.page-journey .f-fill {
  background: #000000 !important;
}

/* Override Badge Colors set by JS */
.page-journey .badge-good {
  color: #000000 !important;
  background: rgba(0, 0, 0, 0.1) !important;
}


/* Trend Chart Alignment & Style Fixes */
.page-journey .trend-chart {
  align-items: stretch; /* Let groups take full height */
}

.page-journey .t-bar-group {
  justify-content: flex-end; /* Align bar and text to bottom */
}

.page-journey .t-bar {
  width: 12px;
  border-radius: 6px; /* Rounded bars */
  background: #E5E5EA !important;
  margin-bottom: 0; /* Reset margin if any */
}

.page-journey .t-bar.active {
  background: #000000 !important;
  box-shadow: none !important; /* Remove red glow */
}

.page-journey .day {
  margin-top: 8px;
  text-align: center;
  width: 100%;
}


/* Glucose Timer Size Adjustment */
.glucose-timer {
  font-size: 12px !important; /* Reduced from 14px */
}

/* Glucose Notify Button */
.btn-glucose-notify {
  background: none;
  border: none;
  color: #8E8E93;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-glucose-notify:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

.btn-glucose-notify.active svg {
  fill: currentColor;
  color: #000;
}

/* Notification Toast */
.notification-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.notification-toast.hidden {
  opacity: 0;
  transform: translate(-50%, -40%);
  pointer-events: none;
}

.notification-toast span {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  color: #000;
  font-size: 15px;
}

.notification-toast svg {
  color: #000000; /* Black check */
}


/* Analysis Phase Styles */
.analysis-prompt {
  position: absolute;
  top: 80px;
  left: 32px;
  font-family: 'Instrument Serif', serif;
  font-size: 42px;
  color: #000;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.5s ease;
  z-index: 105;
}

.analysis-prompt.visible {
  opacity: 1;
  transform: translateY(0);
}

.analysis-input {
  position: absolute;
  top: 150px;
  left: 32px;
  width: calc(100% - 64px);
  background: transparent;
  border: none;
  border-bottom: 1px solid #ccc;
  font-family: 'Source Serif 4', serif;
  font-size: 24px;
  color: #000;
  outline: none;
  padding: 8px 0;
  opacity: 0;
  transition: all 0.5s ease 0.2s;
  z-index: 105;
}

.analysis-input.visible {
  opacity: 1;
}

.analysis-input:focus {
  border-bottom-color: #000;
}

/* Slide Out Animations */
.slide-out-left {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s ease !important;
}

.slide-out-right {
  transform: translateX(200%) !important;
  opacity: 0;
  transition: all 0.5s ease;
}

.analysis-text-display {
  position: absolute;
  top: 72%;
  left: 32px;
  right: 32px;
  font-family: 'Source Serif 4', serif;
  font-size: 14px;
  line-height: 1.5;
  color: #000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000);
  z-index: 110;
  text-align: center;
}

.analysis-text-display.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hide Red Ring */
.btn-camera-enable.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Write Journal Button */
.btn-write-journal {
  position: absolute;
  top: 98px;
  right: 32px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Source Serif 4', serif;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 120;
}

.btn-write-journal.visible {
  opacity: 1;
}

.btn-write-journal:hover {
  color: #000;
}


/* Play Button Overlay */
.reel-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 24 24\' fill=\'white\' stroke=\'white\' stroke-width=\'2\' stroke-linecap=\'round\' stroke-linejoin=\'round\'%3E%3Cpolygon points=\'5 3 19 12 5 21 5 3\'/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.reel-item.playing::after {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.5);
}

