/* Runwalkapp shared styles */

:root {
  --bg-deep: #0d0d12;
  --bg-surface: #16161d;
  --bg-elevated: #1c1c24;
  --bg-card: #22222c;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-muted: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-coral: #f43f5e;
  --accent-amber: #f59e0b;
  --glow-blue: rgba(59, 130, 246, 0.25);
  --glow-emerald: rgba(16, 185, 129, 0.2);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-muted);
  --transition: 0.25s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Header (shared) */
.header {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  padding: 32px 20px 36px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 24px;
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

.header-brand:hover {
  color: var(--accent-cyan);
}

.header-brand:hover h1 {
  color: var(--accent-cyan);
}

.header-brand:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

.header-brand:hover .app-icon {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .header-brand:hover .app-icon { transform: none; }
  .app-store-link:not(.app-store-link--placeholder):hover { transform: none; }
  .screen-preview:hover img { transform: none; }
}

.header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}


/* Footer (shared) */
.footer {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  padding: 48px 24px 40px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  margin-top: 48px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-link:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.footer-copyright {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Home page: hero, app store CTA, screens */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.hero-text {
  text-align: center;
  margin-bottom: 56px;
}

.hero-text h2 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.app-store-cta {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

.app-store-link {
  display: inline-block;
  line-height: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.app-store-link img {
  height: 48px;
  width: auto;
  display: block;
}

.app-store-link:not(.app-store-link--placeholder):hover {
  transform: scale(1.03);
}

.app-store-link:not(.app-store-link--placeholder):focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 8px;
}

.app-store-link--placeholder {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.app-store-cta-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.app-store-coming-soon-msg {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.03em;
}

@media (min-width: 769px) {
  .app-store-link img {
    height: 56px;
  }
}

.screens-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: start;
}

.screen-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-preview img {
  width: 90%;
  max-width: 450px;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.screen-preview:hover img {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.screen-caption {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

/* Center third image on tablet sizes (iPad Air, iPad Pro, etc.) */
@media (min-width: 769px) and (max-width: 1280px) {
  .screens-container {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
  }
  
  .screens-container .screen-preview:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 450px;
  }
}

/* Privacy policy page: content, policy block */
.content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.privacy-policy {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.privacy-policy h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 16px;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-cyan);
}

.privacy-policy section {
  margin-bottom: 40px;
}

.privacy-policy h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 15px;
  margin-top: 30px;
}

.privacy-policy h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  margin-top: 20px;
}

.privacy-policy p {
  color: var(--text-secondary);
  margin-bottom: 15px;
  font-size: 1rem;
  line-height: 1.7;
}

.privacy-policy ul,
.privacy-policy ol {
  color: var(--text-secondary);
  margin-left: 24px;
  margin-bottom: 15px;
  line-height: 1.8;
}

.privacy-policy li {
  margin-bottom: 8px;
}

.privacy-policy a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition);
}

.privacy-policy a:hover {
  color: var(--text-primary);
}

.privacy-policy a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

.privacy-policy strong {
  color: var(--text-primary);
}

/* Error pages (404, 500) */
.error-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  position: relative;
  z-index: 1;
}

.error-content {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.error-icon {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.6s ease;
}

.error-title {
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.error-subtitle {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.error-message {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-blue);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-muted);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive: shared and home */
@media (max-width: 768px) {
  .header {
    padding: 24px 16px 28px;
  }

  .header h1 {
    font-size: 1.65rem;
  }

  .hero {
    padding: 48px 16px 64px;
  }

  .hero-text {
    margin-bottom: 40px;
  }

  .app-store-cta {
    margin-bottom: 40px;
  }

  .hero-text h2 {
    font-size: 1.75rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .screens-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .screen-preview img {
    width: 90%;
    max-width: 360px;
  }

  /* Privacy policy responsive */
  .content {
    padding: 48px 16px 64px;
  }

  .privacy-policy {
    padding: 28px 20px;
  }

  .privacy-policy h1 {
    font-size: 1.5rem;
  }

  .privacy-policy h2 {
    font-size: 1.25rem;
  }

  /* Error pages responsive */
  .error-page {
    padding: 32px 16px;
    min-height: calc(100vh - 150px);
  }

  .error-title {
    font-size: 3rem;
  }

  .error-subtitle {
    font-size: 1.5rem;
  }

  .error-message {
    font-size: 1rem;
  }

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

  .btn {
    width: 100%;
    max-width: 280px;
  }
}
