/* ============================================
   JOINT JOURNEY - App Styles
   ============================================ */

/* --- Auth Screens --- */
.auth-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green-50) 0%, var(--bg-body) 50%, var(--amber-100) 100%);
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
}

/* --- Onboarding --- */
.onboarding-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--green-50) 0%, var(--bg-body) 100%);
}

.onboarding-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
}

.onboarding-progress {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.onboarding-progress .form-hint {
  margin-top: var(--space-sm);
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- App Layout --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) var(--space-lg);
}

.app-layout {
  display: flex;
  min-height: calc(100vh - 73px);
}

.app-sidebar {
  width: 240px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  padding: var(--space-lg) 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0 var(--space-sm);
}

.sidebar-footer {
  padding: 0 var(--space-sm);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: none;
  background: none;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
  min-height: var(--min-touch);
}

.nav-item:hover {
  background: var(--green-50);
  color: var(--green-800);
}

.nav-item.active {
  background: var(--green-100);
  color: var(--green-900);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--green-700);
}

.nav-icon {
  font-size: 22px;
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
  color: var(--green-600);
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: currentColor;
}

.nav-label {
  white-space: nowrap;
}

.app-main {
  flex: 1;
  padding: var(--space-xl) var(--space-2xl);
  max-width: 1100px;
  overflow-y: auto;
}

/* --- Page Headers --- */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-sm);
}

.page-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin-bottom: 0;
}

/* --- Header Greeting --- */
.header-greeting {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Mobile Menu --- */
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-icon {
  font-size: 28px;
  color: var(--text-primary);
}

/* --- Mood Selector --- */
.mood-selector {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.mood-btn {
  font-size: 36px;
  background: none;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: var(--space-sm);
  transition: all var(--transition-fast);
  opacity: 0.5;
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.mood-btn.selected {
  opacity: 1;
  transform: scale(1.2);
  border-color: var(--green-400);
  background: var(--green-50);
}

/* --- Exercise Items --- */
.exercise-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  min-height: 60px;
}

.exercise-item:hover {
  background: var(--green-50);
  border-color: var(--green-200);
}

.exercise-item.completed {
  background: var(--green-100);
  border-color: var(--green-300);
}

.exercise-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.exercise-item.completed .exercise-check {
  background: var(--green-600);
  border-color: var(--green-600);
  color: white;
}

.exercise-info {
  flex: 1;
}

.exercise-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.exercise-detail {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

.exercise-item.completed .exercise-name {
  text-decoration: line-through;
  opacity: 0.7;
}

/* --- Recipe Cards --- */
.recipe-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.recipe-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green-300);
  transform: translateY(-2px);
}

.recipe-card-emoji {
  font-size: 40px;
  margin-bottom: var(--space-md);
}

.recipe-card-title {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

/* Diet badges */
.recipe-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.diet-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}
.diet-veg {
  background: #dcfce7;
  color: #166534;
}
.diet-vegan {
  background: #d1fae5;
  color: #065f46;
}
.diet-pesc {
  background: #dbeafe;
  color: #1e40af;
}

.recipe-card-meta {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.recipe-card-meta strong {
  color: var(--green-800);
}

/* --- Recipe Modal --- */
.recipe-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.recipe-modal-stat {
  text-align: center;
  padding: var(--space-md);
  background: var(--green-50);
  border-radius: var(--radius-md);
}

.recipe-modal-stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--green-800);
}

.recipe-modal-stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.recipe-section {
  margin-bottom: var(--space-xl);
}

.recipe-section h4 {
  color: var(--green-800);
  border-bottom: 2px solid var(--green-100);
  padding-bottom: var(--space-sm);
}

.recipe-tip {
  background: var(--amber-100);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  margin-top: var(--space-lg);
}

.recipe-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* --- Shopping List --- */
.shopping-aisle {
  margin-bottom: var(--space-xl);
}

.shopping-aisle-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--green-800);
  padding: var(--space-sm) 0;
  border-bottom: 2px solid var(--green-200);
  margin-bottom: var(--space-md);
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 44px;
}

.shopping-item:hover {
  background: var(--green-50);
}

.shopping-item.checked {
  opacity: 0.5;
  text-decoration: line-through;
}

.shopping-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--green-700);
}

/* --- Nutrition Tabs --- */
.nutrition-tab {
  /* shown/hidden via JS */
}

/* --- Weight Chart --- */
#weight-chart-container {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.weight-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--font-size-sm);
}

.weight-entry-date {
  color: var(--text-muted);
}

.weight-entry-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Mindset Module Cards --- */
.mindset-module-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--green-400);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.mindset-module-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green-300);
  border-top-color: var(--green-600);
  transform: translateY(-3px);
}

.mindset-module-card.completed {
  border-color: var(--green-400);
  background: var(--green-50);
}

.mindset-module-card .module-status {
  float: right;
  font-size: 24px;
}

.mindset-module-card h3 {
  margin-top: var(--space-sm);
}

/* --- Mindset Content --- */
.mindset-article h3 {
  color: var(--green-800);
  margin-top: var(--space-xl);
}

.mindset-article h4 {
  margin-top: var(--space-lg);
}

.mindset-article blockquote {
  position: relative;
  border-left: 4px solid var(--green-400);
  padding: var(--space-md) var(--space-lg) var(--space-md) var(--space-2xl);
  background: var(--green-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-lg) 0;
  font-style: italic;
  font-size: var(--font-size-lg);
  color: var(--green-900);
}

.mindset-article blockquote::before {
  content: "\201C";
  position: absolute;
  left: 10px;
  top: 4px;
  font-family: var(--font-family-heading);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--green-400);
}

.mindset-article .key-point {
  background: var(--amber-100);
  border-left: 4px solid var(--amber-600);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-lg) 0;
}

.mindset-article .exercise-box {
  background: var(--green-50);
  border: 2px solid var(--green-300);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.mindset-article .exercise-box h4 {
  color: var(--green-800);
  margin-top: 0;
}

/* --- Getting Ready Content --- */
.getting-ready-article h3 {
  color: var(--green-800);
  margin-top: var(--space-xl);
}

.getting-ready-article h4 {
  margin-top: var(--space-lg);
}

.precaution-warning {
  background: var(--warn-bg);
  border: 2px solid var(--warn-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.precaution-warning h4 {
  color: var(--warn-text);
  margin-top: 0;
}

.pro-tip {
  background: var(--green-50);
  border-left: 4px solid var(--green-600);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-md) 0;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 200;
    transition: left var(--transition-normal);
    padding-top: 80px;
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .app-main {
    padding: var(--space-lg) var(--space-md);
  }

  .page-title {
    font-size: var(--font-size-2xl);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .recipe-actions {
    flex-direction: column;
  }

  .auth-card, .onboarding-card {
    padding: var(--space-xl);
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .mood-selector {
    gap: var(--space-sm);
  }

  .mood-btn {
    font-size: 28px;
  }
}

/* --- Logo in app (reuse landing styles) --- */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  color: var(--text-primary);
}

.logo-icon {
  font-size: 32px;
}

.logo-text {
  font-weight: 400;
  color: var(--text-secondary);
}

.logo-text-bold {
  font-weight: 700;
  color: var(--green-800);
}

/* ===== OXFORD SCORE ===== */
.oxford-question {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-light);
}
.oxford-question:last-child { border-bottom: none; }
.oxford-question-number {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}
.oxford-question-text {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.oxford-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.oxford-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.oxford-option:hover {
  background: var(--green-50);
  border-color: var(--primary);
}
.oxford-option input[type="radio"] { flex-shrink: 0; }
.oxford-option-label {
  font-size: var(--font-size-base);
  color: var(--text-primary);
}
.oxford-option:has(input:checked) {
  background: var(--green-50);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Oxford Score Result */
.oxford-result-card {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}
.oxford-result-score {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}
.oxford-result-total {
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.5;
}
.oxford-result-label {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-top: var(--space-sm);
  color: var(--text-primary);
}
.oxford-result-description {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.oxford-result-date {
  margin-top: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.oxford-comparison {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--green-50);
  border-radius: var(--radius-lg);
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.oxford-compare-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
}
.oxford-compare-result {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
}
.oxford-compare-result.positive { background: #dcfce7; color: #166534; }
.oxford-compare-result.negative { background: #fef2f2; color: #991b1b; }
.oxford-compare-result.neutral { background: #f3f4f6; color: #374151; }

/* ===== MOUNTAIN JOURNEY ===== */
.mountain-journey-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.mountain-title {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  font-weight: 600;
}
.mountain-svg {
  width: 100%;
  max-height: 200px;
  border-radius: var(--radius-md);
}
.mountain-days {
  margin: var(--space-sm) 0 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
}

/* ===== RATING SELECTOR ===== */
.rating-selector {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}
.rating-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.rating-option span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: var(--font-size-lg);
  transition: all 0.15s;
  line-height: 1.1;
}
.rating-option small { font-size: 0.6rem; font-weight: 400; }
.rating-option input { display: none; }
.rating-option:has(input:checked) span {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.rating-option:hover span {
  border-color: var(--primary);
  background: var(--green-50);
}

/* ============================================
   FEEDBACK - floating button + star rating
   ============================================ */
.feedback-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--green-800);
  color: var(--text-on-green);
  border: none;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.feedback-fab:hover {
  transform: translateY(-2px);
  background: var(--green-700);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
}
.feedback-fab-label { color: var(--text-on-green); }
.feedback-fab-icon { font-size: 1.15rem; line-height: 1; }

.feedback-stars {
  display: flex;
  gap: 4px;
}
.feedback-star {
  background: none;
  border: none;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  color: var(--amber-500, #f59e0b);
  padding: 0;
  transition: transform 0.1s ease;
}
.feedback-star:hover { transform: scale(1.15); }
.feedback-star.filled { color: var(--amber-500, #f59e0b); }

/* On small screens, collapse the FAB to just the icon */
@media (max-width: 600px) {
  .feedback-fab { padding: 12px; }
  .feedback-fab-label { display: none; }
}

/* ============================================
   PER-EXERCISE DIFFICULTY CONTROLS
   ============================================ */
.exercise-difficulty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-left: auto;
  padding-left: var(--space-sm);
  flex-shrink: 0;
}
.diff-btn {
  width: 30px;
  height: 26px;
  border: 1px solid var(--border, #d7ddd5);
  background: var(--surface, #fff);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--primary, #475953);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.08s ease;
}
.diff-btn:hover:not(:disabled) { background: var(--green-50, #eef3ec); }
.diff-btn:active:not(:disabled) { transform: scale(0.92); }
.diff-btn:disabled { opacity: 0.35; cursor: default; }
.diff-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted, #7a7a8a);
  text-align: center;
  min-width: 48px;
  white-space: nowrap;
}
.intensity-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--green-50, #eef3ec);
  color: var(--primary, #475953);
  vertical-align: middle;
}

/* ============================================
   VIDEO MODAL (in-app overlay)
   ============================================ */
.jj-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md, 16px);
  animation: jjFadeIn 0.15s ease;
}
@keyframes jjFadeIn { from { opacity: 0; } to { opacity: 1; } }
.jj-video-dialog {
  width: 100%;
  max-width: 880px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.jj-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm, 8px);
  padding: 10px 14px;
  background: var(--primary, #475953);
  color: #fff;
}
.jj-video-title {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jj-video-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.jj-video-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.jj-video-yt {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
  opacity: 0.9;
}
.jj-video-yt:hover { opacity: 1; }
.jj-video-close:hover { background: rgba(255, 255, 255, 0.3); }
