/* Critical CSS for Above-the-Fold Content */
/* BibleLearn - Above the fold styles for optimal loading */

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: sans-serif;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #2d3748;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  min-height: 100vh;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #1c4a85;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

/* Container utility */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Flex utilities */
.flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.flex > * {
  flex-shrink: 0;
}

/* Header styles */
.header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1c4a85;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  order: -2; /* Ensure logo appears first (before nav) */
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

/* Navigation */
.nav {
  width: 100%;
}

@media (max-width: 767px) {
  .nav {
    order: -1;
  }
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-list a {
  color: #333;
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
}

.nav-list a:hover,
.nav-list a:focus,
.nav-list a[aria-current="page"] {
  color: #1c4a85;
}

.nav-list a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #1c4a85;
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #333;
}

/* Hero section - Critical above-the-fold content */
.hero {
  background: linear-gradient(135deg, #1c4a85 0%, #2c5aa0 50%, #3182ce 100%);
  color: white;
  padding: 5rem 0 7rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.03"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.03"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.02"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0 0 1.5rem;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  margin: 0 0 2.5rem;
  line-height: 1.7;
  font-weight: 400;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 3rem 0;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-features {
  font-size: 1rem;
  opacity: 0.9;
  margin: 2.5rem 0;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-link {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  margin: 0 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-weight: 500;
}

.hero-link:hover {
  color: white;
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.hero-trust {
  font-size: 1rem;
  opacity: 0.9;
  margin: 3rem 0 0;
  animation: fadeInUp 1s ease-out 0.8s both;
}

.hero-trust li {
  margin: 0.5rem 0;
  position: relative;
  padding-left: 1.5rem;
}

.hero-trust li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #48bb78;
  font-weight: bold;
}

.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, #a31c0c 0%, #c53030 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(163, 28, 12, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before,
.btn-primary:focus::before {
  left: 100%;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(163, 28, 12, 0.4);
}

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

.btn-outline {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline:hover,
.btn-outline:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.btn-outline:active {
  transform: translateY(-1px);
}

.hero-trust {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 2rem 0 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    max-width: 300px;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
  }

  .nav.open {
    display: block;
    background: white;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  .nav-list {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid #1c4a85;
  outline-offset: 2px;
}

/* Enhanced focus styles */
*:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Subtle micro-interactions */
.btn-primary:active,
.btn-outline:active {
  transform: translateY(1px);
}

/* Enhanced hover states */
.btn-primary:hover {
  transform: translateY(-4px) !important;
}

.btn-outline:hover {
  transform: translateY(-4px) !important;
}

/* Print styles */
@media print {
  .nav-toggle,
  .hero-cta {
    display: none !important;
  }

  .hero {
    background: white !important;
    color: black !important;
  }

  .btn-primary {
    background: black !important;
    color: white !important;
  }
}