:root {
  --bg-color: #faf9f5;
  /* Soft beige */
  --text-primary: #3c3a38;
  --text-secondary: #8a8886;
  --accent-color: #fbd6dd;
  /* Soft pink */
  --accent-hover: #f9b6c4;
  /* Slightly deeper pink */
  --card-bg: #ffffff;
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 12px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --progress-bg: #e8e6e1;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.app-container {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 80px;
  /* Space for bottom nav */
  position: relative;
  display: flex;
  flex-direction: column;
}

.page-container {
  padding: 100px 24px 24px 24px;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

p {
  color: var(--text-secondary);
}

/* Base UI Elements */
.action-button {
  background-color: var(--accent-color);
  color: #2c3325;
  font-size: 1.125rem;
  font-weight: 700;
  padding: 16px 32px;
  border-radius: 100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transform: scale(1);
}

.action-button:hover {
  background-color: var(--accent-hover);
  transform: scale(1.02);
}

.action-button:active {
  transform: scale(0.98);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.03);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.nav-item span {
  opacity: 0;
  transform: translateY(5px);
  transition: var(--transition-smooth);
  position: absolute;
  bottom: -15px;
}

.nav-item.active {
  color: var(--accent-color);
  color: #8fae77;
  /* Slightly darker green for nav active state */
  transform: translateY(-4px);
}

.nav-item.active span {
  opacity: 1;
  transform: translateY(0);
}

.animated-hero-container {
  display: flex;
  width: 100vw;
  height: 500px;
  position: relative;
  margin-left: calc(-50vw + 50%);
  /* full bleed trick */
  margin-right: calc(-50vw + 50%);
  margin-top: -24px;
  /* compensate for padding */
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .animated-hero-container {
    height: 700px;
  }
}

.hero-bg {
  flex: 1;
  height: 100%;
}

.hero-left-bg {
  background-color: #faf9f5;
}

.hero-right-bg {
  background: linear-gradient(180deg, #f07e7e 0%, #db506f 100%);
}

.hero-center-axis {
  position: absolute;
  top: -20%;
  /* Move up 20% to be slightly off screen */
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* Let clicks pass to the background or text */
  z-index: 1;
}

.hero-image-wrapper {
  position: relative;
  /* Scaled up heavily (2x size roughly) */
  width: 600px;
  height: 800px;
}

@media (min-width: 1024px) {
  .hero-image-wrapper {
    width: 1000px;
    height: 1333px;
  }
}

.hero-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  /* Instead of scale which causes weird overlapping shifts when combined with object-fit,
     we just use a simple perfectly centered transform */
  transform: translate(-50%, -50%) scale(0.95);
  transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-image.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.maimai-overlay {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.maimai-heading {
  width: 100%;
  text-align: center;
  font-size: 5rem;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -2px;
  line-height: 1;
  /* The magic centerline split */
  background: linear-gradient(90deg, #db506f 0%, #db506f 50%, #ffffff 50%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  /* Fallback */
  /* Drop shadow filter handles shadows on background clipped text safely */
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
}

@media (min-width: 768px) {
  .maimai-heading {
    font-size: 7rem;
  }
}

.maimai-prompt-container {
  background: white;
  padding: 8px 24px;
  border-radius: 8px;
  /* rectangle-like */
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.maimai-prompt {
  color: #111;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.maimai-subtext {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  background-color: rgba(0, 0, 0, 0.15);
  /* Keep it slightly readable if crossing borders */
  padding: 4px 12px;
  border-radius: 100px;
}

.book-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  height: 100%;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.book-cover-container {
  position: relative;
  aspect-ratio: 2 / 3;
  width: 100%;
  background-color: #f0f0f0;
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wishlist-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-button.active {
  color: #ff6b6b;
  /* Soft red for heart */
}

.wishlist-button:hover {
  background-color: white;
  transform: scale(1.1);
}

.wishlist-button:active {
  transform: scale(0.9);
}

.book-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: auto;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  0% {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: #db506f;
  color: white;
}

.modal-body {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .modal-body {
    flex-direction: row;
  }
}

.modal-cover {
  width: 100%;
  background: #faf9f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

@media (min-width: 768px) {
  .modal-cover {
    width: 40%;
    min-height: 400px;
  }
}

.modal-cover img {
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

.modal-details {
  padding: 40px;
  width: 100%;
}

@media (min-width: 768px) {
  .modal-details {
    width: 60%;
  }
}

.modal-details h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #111;
  line-height: 1.2;
}

.modal-author {
  font-size: 1.15rem;
  font-weight: 600;
  color: #794343;
  margin-bottom: 24px;
}

.modal-wishlist-button {
  background: #ffe8ec;
  color: #db506f;
  border: none;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 32px;
}

.modal-wishlist-button:hover {
  background: #fbd6dd;
}

.modal-wishlist-button.active {
  background: #db506f;
  color: white;
}

.modal-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #888;
  font-weight: 600;
  background: #f9f9f9;
  padding: 24px;
  border-radius: 12px;
}

.modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f0f0;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
}

.modal-description h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #333;
}

.modal-description p {
  color: #555;
  line-height: 1.7;
  font-size: 1rem;
  white-space: pre-wrap;
}

.modal-error {
  color: #888;
  font-style: italic;
  background: #f9f9f9;
  padding: 24px;
  border-radius: 12px;
}

.counter-container {
  position: relative;
  display: inline-block;
}

.counter-counter {
  display: flex;
  overflow: hidden;
  line-height: 1;
}

.counter-digit {
  position: relative;
  width: 1ch;
  font-variant-numeric: tabular-nums;
}

.counter-number {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-container {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.bottom-gradient {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.progress-container {
  width: 100%;
  margin: 24px 0;
}

.progress-bar-bg {
  width: 100%;
  height: 24px;
  background-color: var(--progress-bg);
  border-radius: var(--border-radius-lg);
  position: relative;
  overflow: visible;
  /* To allow milestone labels to overflow */
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--accent-color);
  /* Only round the left side — right edge stays flat against the track */
  border-radius: var(--border-radius-lg) 4px 4px var(--border-radius-lg);
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milestone-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background-color: white;
  border: 2px solid var(--progress-bg);
  border-radius: 50%;
  z-index: 2;
  transition: var(--transition-smooth);
}

.milestone-marker.reached {
  border-color: var(--accent-color);
  background-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(196, 215, 178, 0.8);
}

.milestone-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.milestone-marker.reached .milestone-label {
  color: var(--text-primary);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  background-color: transparent;
  /* Assuming it overlays or sits above safely */
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 100;
}

.top-nav-logo a {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  display: flex;
}

.logo-bites {
  color: #794343;
}

.logo-books {
  color: #ffffff;
  /* Matches right pink background or can be dark depending on placement */
  /* Let's make logo universally visible */
  color: #333;
}

.top-nav-links {
  display: flex;
  gap: 32px;
}

.top-nav-item {
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.top-nav-item:hover {
  opacity: 0.7;
}

.top-nav-item.active {
  color: #aa4555;
  border-bottom: 2px solid #aa4555;
}

.hub-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 60vh;
}

.hub-header {
  margin-bottom: 48px;
}

.hub-header h1 {
  font-size: 3rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hub-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 900px;
}

@media (min-width: 768px) {
  .hub-grid {
    flex-direction: row;
    align-items: stretch;
  }
}

.hub-card {
  flex: 1;
  background: var(--card-bg);
  padding: 48px 32px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.hub-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.local-library-card:hover {
  border-color: var(--accent-hover);
}

.external-store-card:hover {
  border-color: #333;
  /* B&N styling flavor */
}

.hub-card-icon {
  background: var(--bg-color);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--accent-color);
}

.local-library-card .hub-card-icon {
  color: var(--accent-hover);
  background: #fff5f7;
}

.external-store-card .hub-card-icon {
  color: #3e5b4c;
  /* Classic green to mix theme */
  background: #f0f5f2;
}

.hub-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hub-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  flex: 1;
}

.hub-cta {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-color);
  padding: 12px 24px;
  border-radius: 100px;
  background: #fff5f7;
  transition: background 0.25s, color 0.25s;
}

.external-store-card .hub-cta {
  color: #3e5b4c;
  background: #f0f5f2;
}

.hub-card:hover .hub-cta {
  background: var(--accent-color);
  color: white;
}

.external-store-card:hover .hub-cta {
  background: #3e5b4c;
  color: white;
}

.explore-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  gap: 12px;
}

.search-icon {
  color: var(--text-secondary);
}

.search-bar input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.categories-scroll::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.category-chip {
  background-color: var(--card-bg);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.category-chip.active {
  background-color: var(--accent-color);
  color: #2c3325;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 0;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  animation: spin 1s linear infinite;
  color: var(--accent-color);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.faq-page {
  padding-top: 40px;
}

.faq-header {
  text-align: center;
  margin-bottom: 48px;
}

.faq-header h1 {
  font-size: 3rem;
  color: #333;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.faq-header p {
  font-size: 1.15rem;
  color: #888;
  font-weight: 500;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.faq-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.faq-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(219, 80, 111, 0.08);
  /* slight pink glow hover */
}

.faq-icon-wrapper {
  background: linear-gradient(135deg, #fce4e8 0%, #fbd6dd 100%);
  color: #db506f;
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-content h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #333;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.faq-content p {
  font-size: 1.05rem;
  color: #555;
  line-height: 1.6;
  white-space: pre-line;
  /* Allows line breaks if needed */
}

@media (max-width: 600px) {
  .faq-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }
}

.home-page-wrapper {
  overflow-x: hidden;
}

.page-container.home-page {
  padding-top: 0px;
}

.home-progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -16px;
  /* Bridge the gap directly onto the Hero container */
  position: relative;
  z-index: 20;
  gap: 24px;
}

.home-progress-container {
  background: white;
  padding: 24px 32px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  /* Matches other clean container shadows */
  width: 100%;
  max-width: 600px;
}

/* Make inner progress bar striking against white container */
.home-progress-container .progress-bar-bg {
  background-color: rgba(0, 0, 0, 0.05);
  height: 32px;
  margin-top: 8px;
}

.home-progress-container .progress-bar-fill {
  background: linear-gradient(90deg, #f07e7e 0%, #db506f 100%);
  box-shadow: 0 0 12px rgba(219, 80, 111, 0.3);
}

.home-progress-container .milestone-marker {
  width: 14px;
  height: 14px;
  border: 4px solid white;
}

.home-progress-container .milestone-label {
  font-size: 0.85rem;
  top: -32px;
}

.home-progress-container .milestone-label-bottom {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 800;
  color: #db506f;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
  line-height: 1.1;
}

.home-progress-container .milestone-marker.reached {
  background-color: #db506f;
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(219, 80, 111, 0.6);
}

.home-action-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.home-log-button {
  background-color: #2c3325;
  color: #c4d7b2;
  padding: 16px 40px;
  border-radius: 100px;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
  box-shadow: 0 8px 24px rgba(44, 51, 37, 0.15);
}

.home-log-button:hover {
  background-color: #1a1e16;
  transform: translateY(-2px) scale(1.02);
}

.home-log-button.animating {
  transform: scale(0.9);
}

.home-log-button.disabled {
  background-color: #e0e0e0;
  color: #a0a0a0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.home-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: white;
  padding: 8px 8px 8px 20px; /* Slimmer padding */
  border-radius: 100px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0,0,0,0.05);
}

.home-meal-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: #333;
  width: 180px; /* Slightly narrower */
  font-weight: 500;
}

.home-yummy-button {
  background-color: #db506f;
  color: white;
  padding: 10px 24px; /* Slimmer padding */
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(219, 80, 111, 0.3);
}

.home-yummy-button:hover:not(:disabled) {
  background-color: #c4405c;
  transform: translateY(-1px);
}

.home-yummy-button:disabled {
  background-color: #ffb5c6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Duolingo-style Streak Popup */
#streak-popup {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 12px;
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  z-index: 1000;
  width: 320px;
  display: none;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

#streak-popup.active {
  display: flex;
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

#streak-popup .popup-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: #333;
}

#streak-popup .popup-msg {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  font-weight: 400;
}

.roadmap-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 10px 0;
  margin-top: 8px;
}

.roadmap-line {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 2px;
  background-image: linear-gradient(90deg, #eee 50%, transparent 50%);
  background-size: 8px 2px;
  z-index: 1;
  transform: translateY(-50%);
}

.roadmap-day {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 700;
  color: #aaa;
  position: relative;
  transition: all 0.3s ease;
}

.roadmap-day.completed {
  background: #ff8c00;
  border-color: #ff8c00;
  color: white;
}

.roadmap-day.milestone {
  width: 40px;
  height: 40px;
  background: #fce4e8;
  border-color: #fbd6dd;
  color: #db506f;
  font-size: 1.2rem;
}

.roadmap-day.milestone.completed {
  background: #db506f;
  border-color: #db506f;
  color: white;
}


.home-cancel-button {
  background-color: transparent;
  color: #888;
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s, background-color 0.2s;
}

.home-cancel-button:hover {
  background-color: #f5f5f5;
  color: #333;
}

.how-it-works-section {
  padding: 24px 0 64px 0;
  text-align: center;
}

.how-it-works-section h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 48px;
  color: #333;
  letter-spacing: -1px;
}

.how-it-works-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .how-it-works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .how-it-works-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step-card {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #222;
}

.step-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(219, 80, 111, 0.15);
  border-color: #f07e7e;
}

.step-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.pulse-1 {
  background: linear-gradient(135deg, #c4d7b2 0%, #a3be8c 100%);
}

.pulse-2 {
  background: linear-gradient(135deg, #8fae77 0%, #6f8c55 100%);
}

.pulse-3 {
  background: linear-gradient(135deg, #f07e7e 0%, #db506f 100%);
}

.pulse-4 {
  background: linear-gradient(135deg, #db506f 0%, #aa4555 100%);
}

.step-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #333;
}

.step-card p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* special-card — no longer distinct, uses same border treatment as all cards */
.wishlist-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 32px;
}

.empty-icon-wrap {
  width: 96px;
  height: 96px;
  background-color: var(--progress-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.empty-icon {
  color: var(--text-secondary);
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
}

.empty-action {
  width: auto;
}

/* Inherits .books-grid from Explore.css because it's a generic layout */