/* impact-studies.css */

/* Impact Studies Page Specific Styles */

/* Hero Section */
.impact-hero {
  background: linear-gradient(135deg, rgba(10, 92, 54, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
  position: relative;
  overflow: hidden;
  /* Add padding-top to create space for fixed menu */
  padding-top: 100px !important;
  background: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.95)), 
                url('https://nammafamilybuilder.com/wp-content/uploads/2022/02/Farm-land-for-sale.jpg') center/cover;
}

.impact-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

/* Add margin to push content down from menu */
.impact-hero > div {
  margin-top: 20px !important;
}

/* Evidence-Based Results Badge - Moved lower */
.impact-hero .inline-flex {
  margin-top: 20px !important;
  margin-bottom: 25px !important;
}

/* Stats Cards */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 168, 116, 0.1);
  min-width: 180px;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 168, 116, 0.15);
}

/* Impact Study Cards */
.study-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 168, 116, 0.1);
  height: 100%;
}

.study-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 168, 116, 0.15);
}

.study-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Key Metrics */
.metric-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(240, 253, 244, 0.5);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 168, 116, 0.1);
}

.metric-item:hover {
  background: rgba(240, 253, 244, 1);
  transform: translateX(5px);
  border-color: rgba(0, 168, 116, 0.2);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Comparison Charts */
.comparison-bar {
  height: 8px;
  border-radius: 4px;
  background: #E5E7EB;
  overflow: hidden;
  position: relative;
}

.comparison-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #22C55E, #16A34A);
  position: relative;
  transition: width 1s ease-in-out;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* Key Insights Section */
.insight-card {
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
  border-left: 4px solid #22C55E;
  padding: 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid #E5E7EB;
}

.insight-card:hover {
  background: linear-gradient(135deg, #F0FDF4, #E2F7EB);
  transform: translateX(5px);
  border-color: #22C55E;
}

/* Download Buttons */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
  color: white;
  background: linear-gradient(135deg, #16A34A, #15803D);
}

/* Impact Numbers */
.impact-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #16A34A, #22C55E);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* Floating animation for study cards */
@keyframes floatCard {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

.study-card {
  animation: floatCard 6s ease-in-out infinite;
}

.study-card:nth-child(2) {
  animation-delay: 2s;
}

.study-card:nth-child(3) {
  animation-delay: 4s;
}

/* =================================================== */
/* RESPONSIVE DESIGN - MOBILE FIRST APPROACH */
/* =================================================== */

/* Extra small devices (phones, less than 400px) */
@media (max-width: 400px) {
  .impact-hero {
    padding-top: 90px !important;
    padding-bottom: 2rem !important;
  }
  
  .impact-hero .inline-flex {
    margin-top: 10px !important;
    margin-bottom: 20px !important;
    padding: 0.4rem 0.8rem !important;
    font-size: 0.85rem !important;
  }
  
  .impact-hero h1 {
    font-size: 2rem !important;
    margin-bottom: 1rem !important;
  }
  
  .impact-hero p {
    font-size: 1rem !important;
    padding: 0 0.5rem !important;
  }
  
  .stat-card {
    min-width: 100% !important;
    margin-bottom: 0.75rem !important;
    padding: 1rem !important;
  }
  
  .stat-card .text-3xl {
    font-size: 1.75rem !important;
  }
  
  .stat-card .text-gray-700 {
    font-size: 0.9rem !important;
  }
  
  .impact-number {
    font-size: 1.75rem !important;
  }
}

/* Small devices (phones, 400px to 640px) */
@media (max-width: 640px) {
  .impact-hero {
    padding-top: 100px !important;
    padding-bottom: 3rem !important;
  }
  
  .impact-hero::before {
    width: 300px !important;
    height: 300px !important;
    top: -20% !important;
    right: -50% !important;
  }
  
  .impact-hero .text-center {
    padding: 0 1rem !important;
  }
  
  .impact-hero .inline-flex {
    margin-top: 15px !important;
    margin-bottom: 25px !important;
    padding: 0.5rem 1rem !important;
  }
  
  .impact-hero h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }
  
  .impact-hero p {
    font-size: 1.1rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
  }
  
  .flex-wrap.justify-center {
    gap: 0.75rem !important;
  }
  
  .stat-card {
    min-width: calc(50% - 0.5rem) !important;
    padding: 1.25rem !important;
  }
  
  /* Summary Stats Section */
  section.bg-gray-50 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .grid.grid-cols-2 {
    gap: 0.75rem !important;
  }
  
  .text-center.p-6 {
    padding: 1.25rem 0.75rem !important;
  }
  
  .impact-number {
    font-size: 2rem !important;
  }
  
  /* Main Content */
  section.py-16 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  
  .mb-16.text-center {
    margin-bottom: 2rem !important;
  }
  
  .text-3xl {
    font-size: 1.75rem !important;
  }
  
  .study-card {
    margin-bottom: 1.5rem !important;
    border-radius: 16px !important;
  }
  
  .study-badge {
    font-size: 0.7rem !important;
    padding: 0.3rem 0.8rem !important;
    top: 0.75rem !important;
    left: 0.75rem !important;
  }
  
  .p-6.md\:p-8 {
    padding: 1.25rem !important;
  }
  
  .text-2xl {
    font-size: 1.5rem !important;
  }
  
  .download-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.6rem 1rem !important;
    margin-top: 1rem !important;
    font-size: 0.9rem !important;
  }
  
  .flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  
  .metric-item {
    padding: 0.75rem !important;
  }
  
  .metric-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.25rem !important;
  }
  
  .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Key Insights Section */
  .grid.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .p-6.bg-white {
    padding: 1.25rem !important;
  }
  
  /* Methodology Section */
  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  
  /* Stop floating animation on mobile for performance */
  .study-card {
    animation: none !important;
  }
}

/* Medium devices (tablets, 641px to 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .impact-hero {
    padding-top: 110px !important;
    padding-bottom: 3.5rem !important;
  }
  
  .impact-hero::before {
    width: 500px !important;
    height: 500px !important;
    top: -30% !important;
    right: -30% !important;
  }
  
  .impact-hero h1 {
    font-size: 3rem !important;
  }
  
  .impact-hero p {
    font-size: 1.2rem !important;
  }
  
  .stat-card {
    min-width: 160px !important;
  }
  
  .grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .grid.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .study-badge {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.9rem !important;
  }
}

/* Large devices (desktops, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .impact-hero {
    padding-top: 120px !important;
    padding-bottom: 4rem !important;
  }
  
  .impact-hero h1 {
    font-size: 3.5rem !important;
  }
  
  .grid.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .study-badge {
    font-size: 0.85rem !important;
  }
}

/* Extra large devices (large desktops, 1025px and up) */
@media (min-width: 1025px) {
  .impact-hero {
    padding-top: 130px !important;
    padding-bottom: 5rem !important;
  }
  
  .impact-hero h1 {
    font-size: 4rem !important;
  }
}

/* Print styles */
@media print {
  .impact-hero::before,
  .study-card:hover,
  .metric-item:hover,
  .insight-card:hover,
  .download-btn:hover {
    transform: none !important;
  }
  
  .download-btn {
    background: #16A34A !important;
    color: white !important;
    box-shadow: none !important;
  }
  
  .study-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .study-card,
  .stat-card,
  .metric-item,
  .insight-card,
  .download-btn {
    transition: none !important;
    animation: none !important;
  }
  
  .animate-fadeInUp {
    animation: none;
    opacity: 1;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .impact-hero {
    background: linear-gradient(135deg, rgba(10, 92, 54, 0.2), rgba(34, 197, 94, 0.1));
  }
  
  .stat-card,
  .study-card,
  .metric-item,
  .insight-card {
    background: #1F2937;
    border-color: #374151;
    color: #E5E7EB;
  }
  
  .stat-card:hover,
  .study-card:hover {
    background: #111827;
  }
  
  .impact-hero::before {
    background: radial-gradient(circle, rgba(34, 197, 94, 0.05) 0%, transparent 70%);
  }
  
  .metric-item {
    background: rgba(34, 197, 94, 0.1);
  }
  
  .insight-card {
    background: linear-gradient(135deg, #1F2937, #111827);
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #F9FAFB;
  }
  
  p, span:not(.impact-number) {
    color: #D1D5DB;
  }
  
  .comparison-bar {
    background: #4B5563;
  }
}

/* Loading states */
.study-card.loading {
  position: relative;
  overflow: hidden;
}

.study-card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Focus states for accessibility */
.download-btn:focus,
a:focus {
  outline: 2px solid #22C55E;
  outline-offset: 2px;
}

/* Scroll animation triggers */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].animated {
  opacity: 1;
  transform: translateY(0);
}

/* Fix for flex-wrap spacing on mobile */
@media (max-width: 640px) {
  .flex-wrap {
    justify-content: space-around !important;
  }
  
  .stat-card {
    flex: 0 0 calc(50% - 0.5rem) !important;
    max-width: calc(50% - 0.5rem) !important;
  }
}

/* Ensure proper spacing in hero section */
.impact-hero .text-center.mb-12 {
  margin-bottom: 2rem !important;
}

@media (max-width: 640px) {
  .impact-hero .text-center.mb-12 {
    margin-bottom: 1.5rem !important;
  }
}

/* Fix for CTA section on mobile */
@media (max-width: 640px) {
  .flex-col.sm\:flex-row {
    flex-direction: column !important;
  }
  
  .flex-col.sm\:flex-row.gap-4 a {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 0.75rem !important;
  }
}

/* Consistent Metrics Styling */
.study-badge {
  background: linear-gradient(135deg, var(--badge-color, #22C55E), #16A34A);
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.study-badge.bg-amber-500 {
  --badge-color: #F59E0B;
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

.study-badge.bg-emerald-500 {
  --badge-color: #10B981;
  background: linear-gradient(135deg, #10B981, #059669);
}

.study-badge.bg-blue-500 {
  --badge-color: #3B82F6;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
}

/* Consistent metrics cards */
.p-4.bg-white.border {
  transition: all 0.3s ease;
}

.p-4.bg-white.border:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Comparison table styling */
table.w-full {
  border-collapse: separate;
  border-spacing: 0;
}

table.w-full tr:hover {
  background-color: #F9FAFB;
}

table.w-full td {
  border-bottom: 1px solid #F3F4F6;
}

table.w-full tr:last-child td {
  border-bottom: none;
}

