/* MealPrep Hub Custom Styles - Notion / Linear / Paprika Productivity Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-green: #166B57;
  --primary-green-dark: #125746;
  --color-recipe: #166B57;
  --color-recipe-bg: #E5F1EC;
  --color-recipe-border: #C8E3D8;
  --color-component: #8B72C7;
  --color-component-bg: #F0EBF8;
  --color-component-border: #D8CCE8;
  --color-success: #2F8F72;
  --color-warning: #EBCB70;
  --color-warning-bg: #FBF4D9;
  --color-error: #D9534F;
  --color-error-bg: #FDF2F2;
  --app-bg: #F8F8F5;
  --card-bg: #FFFFFF;
  --text-main: #24312B;
  --text-muted: #68736D;
  --border-subtle: #E5E7E3;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  background-color: #F8F8F5;
  color: #24312B;
  overflow-x: hidden;
}

/* Hide scrollbars while preserving scroll functionality */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile Frame Wrapper & Responsive Desktop Layout */
.mobile-app-container {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: #FAF8F5;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .mobile-app-container {
    max-width: 768px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
  }

  .bottom-sheet-backdrop {
    max-width: 100vw !important;
  }

  .bottom-nav {
    max-width: 768px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 20px 20px 0 0;
  }

  .responsive-recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .responsive-planner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .mobile-app-container {
    max-width: 980px;
  }

  .bottom-nav {
    max-width: 980px !important;
  }

  .responsive-recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .responsive-planner-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Bottom Navigation Bar - CookLoop 5 Tabs */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 12px));
  z-index: 40;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 0;
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 10px;
  font-weight: 600;
  user-select: none;
}

.bottom-nav-item.active {
  color: var(--color-recipe);
  font-weight: 700;
}

.bottom-nav-item[data-tab="mealprep"].active {
  color: var(--color-mealprep);
}

.bottom-nav-item.active svg {
  transform: translateY(-2px) scale(1.08);
}

/* CookLoop Visual Hierarchy Badges */
.badge-cookloop-recipe {
  background-color: var(--color-recipe-bg);
  color: var(--color-recipe);
  border: 1px solid var(--color-recipe-border);
}

.badge-cookloop-mealprep {
  background-color: var(--color-mealprep-bg);
  color: var(--color-mealprep);
  border: 1px solid var(--color-mealprep-border);
}

/* To-Do Checklist Interactive Styling */
.mealprep-todo-checkbox {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mealprep-todo-card.completed {
  background-color: #F8FAF9;
  border-color: #E2E8F0;
}

.mealprep-todo-card.completed .mealprep-title {
  text-decoration: line-through;
  opacity: 0.65;
}

.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 12, 10, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 390px;
  max-height: 90vh;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  z-index: 51;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}

.bottom-sheet.open {
  transform: translateY(0%);
}

@media (min-width: 640px) {
  .bottom-sheet {
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -45%) scale(0.95);
    max-width: 520px;
    border-radius: 28px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  }
  .bottom-sheet.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background: #E2DDD5;
  border-radius: 3px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

/* Strikethrough animation for shopping checkboxes */
.checked-item {
  text-decoration: line-through;
  opacity: 0.5;
  color: var(--text-muted);
}

/* Floating Action Button (FAB) */
.fab-button {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 12px));
  right: 20px;
  width: 56px;
  height: 56px;
  background: #166B57;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(22, 107, 87, 0.35);
  cursor: pointer;
  z-index: 45;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

.fab-button:hover {
  background: #125746;
}

@media (min-width: 480px) {
  .fab-button {
    right: calc(50% - 190px);
  }
}

.fab-button:active {
  transform: scale(0.92);
}

/* Ingredient quantity scaler buttons - Mobile First 36px */
.scaler-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #E5E7E3;
  color: #24312B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.scaler-btn:hover {
  background: #F8F8F5;
  border-color: #166B57;
  color: #166B57;
}

.scaler-btn:active {
  transform: scale(0.92);
  background: #E5F1EC;
}

/* Phase 3 AI Import & Modal Styles */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

.animate-spin-slow {
  animation: spin 1.4s linear infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.import-dropzone {
  border: 2px dashed #E5E7E3;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.import-dropzone:hover, .import-dropzone.dragover {
  border-color: #166B57;
  background-color: #E5F1EC;
}

/* Card 1-Click Status Popover */
.card-status-popover {
  animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top right;
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
