/*
 * iOS-Inspired Design System for Reps
 * Matching the app's clean, modern aesthetic
 */

:root {
  /* SF Pro-inspired Typography Scale */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  /* iOS Color Palette */
  --color-orange: #FF6B35;
  --color-orange-light: #FF8856;
  --color-orange-gradient-start: #FF7B4A;
  --color-orange-gradient-end: #FF9768;
  --color-green: #34C759;
  --color-blue: #007AFF;

  /* Neutral Palette */
  --color-background: #FFFFFF;
  --color-surface: #F9FAFB;
  --color-surface-elevated: #FFFFFF;
  --color-border: rgba(0, 0, 0, 0.06);
  --color-text-primary: #1C1C1E;
  --color-text-secondary: #6B7280;
  --color-text-tertiary: #9CA3AF;

  /* Shadows (iOS-style subtle) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 8px -2px rgba(0, 0, 0, 0.06), 0 4px 12px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 16px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 50px -10px rgba(0, 0, 0, 0.10);

  /* Border Radius (iOS-style generous) */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-full: 9999px;

  /* Spacing Scale */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

/* Typography System */
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* iOS-Style Cards */
.ios-card {
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* .ios-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
} */

.ios-card-elevated {
  background: var(--color-surface-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
}

/* iOS-Style Buttons */
.ios-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.ios-button-primary {
  background: linear-gradient(135deg, var(--color-orange-gradient-start), var(--color-orange-gradient-end));
  color: white;
  box-shadow: 0 4px 14px -2px rgba(255, 107, 53, 0.35);
}

.ios-button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(255, 107, 53, 0.45);
}

.ios-button-primary:active {
  transform: translateY(0);
}

/* Gradient Backgrounds (matching lock screen widget) */
.ios-gradient-warm {
  background: linear-gradient(135deg,
    #FF7B4A 0%,
    #FF8C5E 25%,
    #FF9D72 50%,
    #FFB08A 100%
  );
}

.ios-gradient-subtle {
  background: linear-gradient(180deg,
    rgba(107, 114, 128, 0.02) 0%,
    rgba(107, 114, 128, 0.00) 100%
  );
}

/* Badge/Pill Components */
.ios-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(107, 114, 128, 0.06);
  border: 1px solid rgba(107, 114, 128, 0.12);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  backdrop-filter: blur(10px);
}

/* Stats Cards (matching app's progress cards) */
.ios-stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: all 0.2s ease;
}

.ios-stat-card:hover {
  background: rgba(107, 114, 128, 0.04);
}

.ios-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.ios-stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Hero Section Styling */
.hero-gradient-bg {
  position: relative;
  background: linear-gradient(180deg,
    #F8F9FA 0%,
    #FFFFFF 50%,
    #FAFBFC 100%
  );
}

.hero-gradient-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 700px;
  background: radial-gradient(circle at center,
    rgba(107, 114, 128, 0.03) 0%,
    rgba(156, 163, 175, 0.02) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Phone Mockup Enhancement */
.ios-phone-mockup {
  position: relative;
  background: linear-gradient(135deg,
    rgba(249, 250, 251, 1) 0%,
    rgba(243, 244, 246, 1) 100%
  );
  border-radius: var(--radius-2xl);
  padding: 20px;
  box-shadow: var(--shadow-xl);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
}

.ios-phone-screen {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ios-phone-screen-inner {
  aspect-ratio: 9/19.5;
  overflow: hidden;
  border-radius: 20px;
  background: #1C1C1E;
}

/* Feature Section Cards */
.feature-section {
  position: relative;
  padding: var(--space-3xl) 0;
}

.feature-section:nth-child(even) {
  background: var(--color-surface);
}

.feature-image-container {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.feature-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* List Styling */
.ios-feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ios-feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.ios-feature-item:hover {
  background: rgba(107, 114, 128, 0.04);
  transform: translateX(4px);
}

.ios-feature-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-orange-gradient-start), var(--color-orange-gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 14px;
}

/* Navigation Enhancement */
.ios-nav {
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.ios-nav.scrolled {
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Footer Styling */
.ios-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Set initial state to prevent flicker */
.animate-fade-in-up,
.animate-fade-in,
.animate-scale-in {
  opacity: 0;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --space-2xl: 32px;
    --space-3xl: 48px;
  }

  .ios-stat-number {
    font-size: 1.75rem;
  }
}

/* Link Styling */
.ios-link {
  color: var(--color-orange);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ios-link:hover {
  color: var(--color-orange-light);
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Selection Styling */
::selection {
  background: rgba(255, 107, 53, 0.2);
  color: var(--color-text-primary);
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Loading State */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.ios-loading {
  background: linear-gradient(
    90deg,
    var(--color-surface) 0%,
    rgba(255, 107, 53, 0.04) 50%,
    var(--color-surface) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}
