/* StretchStrong - iOS Native Styles */
/* All styles scoped to html[data-platform="ios"] or html[data-platform="ios-web"] */

/* ============================================
   Safe Areas
   ============================================ */
html[data-platform="ios"] body,
html[data-platform="ios-web"] body {
  padding-top: env(safe-area-inset-top, 0px);
  overflow-wrap: break-word;
}

/* ============================================
   Hide desktop-only elements
   ============================================ */
html[data-platform="ios"] .auth-banner,
html[data-platform="ios"] .site-footer,
html[data-platform="ios"] .hero-visual,
html[data-platform="ios"] .nav-innovation,
html[data-platform="ios"] .auth-buttons,
html[data-platform="ios"] .nav-brand {
  display: none !important;
}

/* ============================================
   Bottom Tab Bar Navigation
   ============================================ */
html[data-platform="ios"] .navbar {
  position: fixed;
  bottom: 0;
  top: auto;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: none;
  border-top: 1px solid var(--border-light);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

html[data-platform="ios"] .nav-container {
  padding: 0;
  justify-content: center;
}

html[data-platform="ios"] .nav-menu {
  display: flex;
  width: 100%;
  justify-content: space-around;
  gap: 0;
  padding: 6px 0 2px;
}

html[data-platform="ios"] .nav-item {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  font-size: 10px;
  color: var(--text-muted);
  flex: 1;
  border-radius: 0;
  min-width: 0;
}

html[data-platform="ios"] .nav-item i {
  font-size: 20px;
  display: block !important;
}

html[data-platform="ios"] .nav-item span {
  display: block !important;
  font-size: 10px;
  line-height: 1.2;
}

html[data-platform="ios"] .nav-item.active {
  color: var(--primary-color);
  background: transparent;
}

html[data-platform="ios"] .nav-item .nav-badge {
  display: none;
}

/* ============================================
   Main Content - Account for bottom tab bar
   ============================================ */
html[data-platform="ios"] .main-content {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}

/* ============================================
   Hero Section - iOS
   ============================================ */
html[data-platform="ios"] .hero-content {
  grid-template-columns: 1fr;
  gap: 24px;
  min-height: auto;
  text-align: center;
}

html[data-platform="ios"] .hero-title {
  font-size: 28px;
  line-height: 1.15;
}

html[data-platform="ios"] .hero-subtitle {
  font-size: 16px;
  line-height: 1.5;
}

html[data-platform="ios"] .hero-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

html[data-platform="ios"] .hero-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 12px;
}

html[data-platform="ios"] .hero-stats {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

/* ============================================
   Cards & Grids - iOS
   ============================================ */
html[data-platform="ios"] .features-grid,
html[data-platform="ios"] .protocols-grid,
html[data-platform="ios"] .testimonials-grid,
html[data-platform="ios"] .stats-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

html[data-platform="ios"] .feature-card,
html[data-platform="ios"] .protocol-card,
html[data-platform="ios"] .glass-card {
  border-radius: 14px;
}

html[data-platform="ios"] .feature-card {
  padding: 20px;
}

/* ============================================
   Modals - Full screen on iOS
   ============================================ */
html[data-platform="ios"] .modal-content {
  margin: 0;
  border-radius: 0;
  max-height: 100vh;
  height: 100vh;
  max-width: 100vw;
  width: 100vw;
}

html[data-platform="ios"] .modal-header {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

/* ============================================
   Section padding adjustments
   ============================================ */
html[data-platform="ios"] .section {
  padding: 20px 16px;
}

html[data-platform="ios"] .features {
  padding: 32px 16px;
}

/* ============================================
   Buttons - iOS feel
   ============================================ */
html[data-platform="ios"] .btn {
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   Assessment - iOS
   ============================================ */
html[data-platform="ios"] .assessment-container {
  border-radius: 14px;
  margin: 0;
}

/* ============================================
   Progress cards - iOS
   ============================================ */
html[data-platform="ios"] .progress-overview {
  grid-template-columns: 1fr;
}

html[data-platform="ios"] .progress-card {
  border-radius: 14px;
}

/* ============================================
   CTA Section - iOS
   ============================================ */
html[data-platform="ios"] .cta-section {
  border-radius: 14px;
  padding: 32px 16px;
}

html[data-platform="ios"] .cta-actions {
  flex-direction: column;
  align-items: stretch;
  padding: 0 16px;
}

html[data-platform="ios"] .cta-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ============================================
   Login Page - iOS
   ============================================ */
html[data-platform="ios"] body {
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-platform="ios"] .auth-container {
  box-shadow: none;
  border: none;
  border-radius: 0;
  max-width: 100%;
}

html[data-platform="ios"] .auth-form {
  padding: 24px 20px;
}

html[data-platform="ios"] .auth-form .btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 12px;
  justify-content: center;
}

html[data-platform="ios"] .social-login .btn {
  border-radius: 12px;
  padding: 14px 20px;
}

html[data-platform="ios"] .form-input,
html[data-platform="ios"] input[type="email"],
html[data-platform="ios"] input[type="password"],
html[data-platform="ios"] input[type="text"] {
  font-size: 16px; /* Prevents iOS zoom on focus */
  border-radius: 10px;
  padding: 14px 16px;
}

/* ============================================
   Dashboard - iOS Bottom Tab Bar
   ============================================ */
html[data-platform="ios"] .dashboard-header {
  position: fixed;
  bottom: 0;
  top: auto;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: none;
  border-top: 1px solid var(--border-light, #e5e7eb);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -1px 3px rgb(0 0 0 / 0.05);
}

html[data-platform="ios"] .header-container {
  flex-direction: row;
  padding: 0;
  justify-content: center;
}

/* Hide logo and user menu in bottom bar */
html[data-platform="ios"] .dashboard-header .logo,
html[data-platform="ios"] .dashboard-header .user-menu {
  display: none !important;
}

html[data-platform="ios"] .main-nav {
  display: flex;
  width: 100%;
  justify-content: space-around;
  gap: 0;
  padding: 6px 0 2px;
  overflow-x: visible;
}

html[data-platform="ios"] .nav-btn {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  font-size: 10px;
  color: var(--text-muted, #9ca3af);
  flex: 1;
  border-radius: 0;
  min-width: 0;
  background: none;
  border: none;
}

html[data-platform="ios"] .nav-btn i {
  font-size: 20px;
  display: block;
}

html[data-platform="ios"] .nav-btn span {
  display: block !important;
  font-size: 10px;
  line-height: 1.2;
}

html[data-platform="ios"] .nav-btn.active {
  color: var(--primary-color, #2563eb);
  background: transparent;
}

/* Dashboard content area - space for bottom tab bar and top safe area */
html[data-platform="ios"] .dashboard-container {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

html[data-platform="ios"] body.dashboard-active {
  padding-top: 0;
  padding-bottom: 0;
}

/* Dashboard grids single column */
html[data-platform="ios"] .active-protocols {
  grid-template-columns: 1fr;
  padding: 16px;
  gap: 12px;
}

/* Hide "Back to StretchStrong" on iOS native */
html[data-platform="ios"] .back-to-site {
  display: none !important;
}

/* ============================================
   iOS Safari (web, not Capacitor)
   ============================================ */
html[data-platform="ios-web"] .navbar {
  position: sticky;
  top: 0;
}
