/* ==================== PRPT MOBILE WEB APP STYLES ==================== */
/* Shared across plan.html, analysis.html, app.html */

/* Bottom Navigation Bar — 4-tab nav (CMO-01 design, CTO-01 implementation) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(17, 17, 17, 0.95);
  border-top: 1px solid var(--border, #252525);
  z-index: 200;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 6px));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bottom-nav.nav-hidden {
  transform: translateY(100%);
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 8px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--faint, #555);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 12px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
/* Active indicator — dot above icon (CMO-01 spec) */
.bottom-nav-item::before {
  content: '';
  position: absolute;
  top: 2px; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: var(--accent, #F97316);
  transform: translateX(-50%);
  transition: all 0.2s ease;
}
.bottom-nav-item.active::before {
  width: 4px; height: 4px;
}
.bottom-nav-item.active {
  color: var(--accent, #F97316);
}
/* Touch feedback — scale down on press */
.bottom-nav-item:active {
  transform: scale(0.95);
  background: rgba(249, 115, 22, 0.08);
}
.bottom-nav-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s ease;
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.05);
}
.bottom-nav-icon svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke-width 0.2s ease;
}
.bottom-nav-item.active .bottom-nav-icon svg {
  stroke: var(--accent, #F97316);
  stroke-width: 2.2;
}

/* ==================== SKELETON LOADING ==================== */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  background: linear-gradient(90deg, #111 0%, #1a1a1a 50%, #111 100%);
  background-size: 200px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-card {
  height: 80px; border-radius: 12px; margin-bottom: 12px;
}

/* ==================== CARD INTERACTIONS ==================== */
.wod-card, .quick-link, .notification-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* Shared press feedback — overridden by more specific rules in app.html */
.wod-card:active, .quick-link:active {
  transform: scale(0.98);
}
/* Remove default mobile tap flash across all pages */
a, button, [onclick], [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* ==================== SCREEN TRANSITIONS ==================== */
.screen {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.screen.entering {
  opacity: 0; transform: translateY(8px);
}
.screen.active {
  opacity: 1; transform: translateY(0);
}

/* ==================== MOBILE OVERRIDES ==================== */
@media (max-width: 768px) {
  /* Show bottom nav */
  .bottom-nav { display: block; }

  /* Add padding at bottom for the nav bar (prevent content overlap) */
  body { padding-bottom: 72px; }

  /* Simplify top nav on mobile — hide text links, keep logo + avatar */
  .top-nav .nav-links { display: none !important; }
  .top-nav { padding: 10px 16px; }
  .top-nav .nav-brand img { height: 26px !important; }
  .top-nav .nav-user .nav-name { display: none; }

  /* Better readability */
  .container { padding: 16px 12px; }
  .page-title { font-size: 1.25rem; }
  .page-sub { font-size: 0.82rem; }

  /* Cards — more breathing room */
  .card { padding: 16px; margin-bottom: 12px; border-radius: 10px; }

  /* Range boxes — stack on very narrow screens */
  .range-box {
    gap: 8px;
  }
  .range-value { font-size: 1.6rem; }
  .range-label { font-size: 0.6rem; }

  /* Pacing breakdown — better mobile readability */
  .pacing-summary {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pacing-stat { min-width: 70px; }
  .pacing-stat-label { font-size: 0.6rem; }
  .pacing-stat-value { font-size: 0.9rem; }

  /* Day tabs */
  .day-tabs { gap: 3px; }
  .day-tab { padding: 10px 6px; font-size: 0.72rem; }

  /* Tables */
  .set-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .set-table th, .set-table td {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  /* Coach instruction — more readable */
  .coach-text, [class*="coach"] p {
    font-size: 0.88rem;
    line-height: 1.7;
  }

  /* Floating logo off on mobile */
  .floating-logo { display: none !important; }

  /* Round details — better spacing */
  .round-header { font-size: 0.82rem; }
}

/* ==================== TOUCH TARGET ENFORCEMENT (all mobile) ==================== */
@media (max-width: 768px) {
  /* Ensure minimum 44px touch targets for all interactive elements */
  .quick-link {
    min-height: 44px;
    padding: 14px 10px;
  }
  .status-chip {
    min-height: 36px;
    padding: 8px 14px;
  }
  .bottom-nav-item {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 10px;
  }
  .option-card {
    min-height: 44px;
    padding: 14px 12px;
  }
  .checkbox-item {
    min-height: 44px;
    padding: 12px;
  }
  .auth-tab {
    min-height: 44px;
    padding: 14px 0;
  }
  .btn-nav {
    min-height: 48px;
    padding: 14px 16px;
  }
  .submit-button {
    min-height: 48px;
    padding: 16px;
  }

  /* Strength lift cards: ensure grid doesn't get too cramped */
  .strength-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }
  .strength-lift-card {
    padding: 10px 8px;
  }

  /* PR grid: 2 columns but with tighter gap */
  .pr-grid {
    gap: 10px;
  }

  /* Auth container: less padding on mobile */
  .auth-container {
    padding: 28px 20px;
  }

  /* Onboarding: better mobile layout */
  .barbell-inputs {
    gap: 10px;
  }
  .onboarding-nav {
    gap: 8px;
  }

}

/* ==================== SMALL PHONES (≤480px) ==================== */
@media (max-width: 480px) {
  /* Quick-links: switch to 2-column grid for better readability */
  .quick-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Dashboard content: tighter side padding */
  .dashboard-content {
    padding: 0 14px 100px;
  }

  /* Home header: slightly smaller avatar */
  .home-avatar {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
  .home-name { font-size: 1.1rem; }
  .home-date { font-size: 0.78rem; }

  /* Section title smaller */
  .section-title { font-size: 1.1rem; }

  /* Auth container: even more compact */
  .auth-container {
    padding: 24px 16px;
    border-radius: 10px;
  }
  .form-header h2 { font-size: 1.3rem; }
  .screen-auth { padding: 24px 12px; }

  /* PR grid: stack to single column on small phones */
  .pr-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Barbell inputs: stack on small phones */
  .barbell-inputs {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Option grid: 2 columns max */
  .option-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .option-label { font-size: 0.88rem; }
  .option-desc { font-size: 0.7rem; }

  /* Landing page adjustments */
  .landing-content {
    padding: 40px 16px 30px;
  }
  .hero-tagline {
    font-size: 1rem;
    letter-spacing: 1.5px;
  }
  .hero-subtitle {
    font-size: 0.92rem;
  }
  .cta-button {
    padding: 16px 32px;
    font-size: 1rem;
    border-radius: 12px;
  }
  .landing-features { gap: 20px; }
  .landing-feat { font-size: 0.75rem; }
}

/* ==================== EXTRA SMALL PHONES (≤380px) ==================== */
@media (max-width: 380px) {
  .range-box { grid-template-columns: 1fr 1fr; }
  .range-value { font-size: 1.4rem; }
  .container { padding: 12px 8px; }
  .bottom-nav-item { padding: 5px 6px 4px; font-size: 0.58rem; }
  .bottom-nav-item::before { height: 2px; }
  .bottom-nav-item.active::before { width: 20px; }

  /* Quick-links: stay 2-column but tighter */
  .quick-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .quick-link {
    padding: 12px 8px;
    border-radius: 10px;
  }
  /* Dashboard even tighter */
  .dashboard-content {
    padding: 0 10px 100px;
  }

  /* Home header: most compact */
  .home-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
  .home-name { font-size: 1rem; }

  /* Auth: most compact */
  .auth-container {
    padding: 20px 14px;
  }

  /* Strength grid: single column on very small screens */
  .strength-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  /* Option grid: also 2 columns but very tight */
  .option-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .option-card { padding: 10px 8px; }
}

/* ==================== PWA / FULLSCREEN MODE ==================== */
@media (display-mode: standalone) {
  /* When running as installed PWA */
  .top-nav {
    padding-top: env(safe-area-inset-top, 12px);
  }
}