<section id="challenges" class="py-24 bg-white relative overflow-hidden">
  <!-- Background elements -->
  <div class="absolute inset-0 bg-gradient-to-br from-purple-50 to-indigo-50 opacity-30"></div>
  <div class="absolute inset-0 overflow-hidden">
    <div class="absolute inset-0 opacity-[0.03]" aria-hidden="true">
      <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
        <defs>
          <pattern id="challenges-dots" width="20" height="20" patternUnits="userSpaceOnUse">
            <circle cx="10" cy="10" r="1" fill="currentColor" />
          </pattern>
        </defs>
        <rect width="100%" height="100%" fill="url(#challenges-dots)" />
      </svg>
    </div>
  </div>
  
  <div class="relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
    <!-- Section header -->
    <div class="text-center max-w-3xl mx-auto mb-16" data-aos="fade-up">
      <h2 class="text-4xl font-bold text-gray-900 mb-4">
        {{ sections.challenges.title }}
      </h2>
      <p class="text-lg text-gray-600 max-w-2xl mx-auto">
        {{ sections.challenges.subtitle }}
      </p>
      <div class="mt-6 mx-auto w-20 h-1 bg-indigo-600 rounded-full"></div>
    </div>
    
    <!-- Challenges grid -->
    {% if sections.challenges.layout == 'grid' %}
    <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-8">
      {% for item in sections.challenges.items %}
      <div class="bg-white rounded-xl shadow-md p-8 border border-gray-100 transition-all duration-300 hover:shadow-lg hover:border-indigo-200" data-aos="fade-up" data-aos-delay="{{ loop.index0 * 100 }}">
        <div class="flex flex-col items-center text-center">
          <div class="w-16 h-16 rounded-full bg-{{ item.color|default('indigo') }}-100 flex items-center justify-center text-{{ item.color|default('indigo') }}-600 mb-6">
            <i class="{{ item.icon }}" aria-hidden="true"></i>
          </div>
          <div class="text-4xl font-bold text-gray-900 mb-2">{{ item.value }}</div>
          <div class="text-lg font-medium text-gray-700">{{ item.label }}</div>
          {% if item.description %}
          <p class="mt-3 text-gray-600">{{ item.description }}</p>
          {% endif %}
        </div>
      </div>
      {% endfor %}
    </div>
    {% else %}
    <!-- Alternative layout for challenges -->
    <div class="space-y-12">
      {% for item in sections.challenges.items %}
      <div class="bg-white rounded-xl shadow-md p-8 border border-gray-100 transition-all duration-300 hover:shadow-lg hover:border-indigo-200" data-aos="fade-up" data-aos-delay="{{ loop.index0 * 100 }}">
        <div class="flex flex-col md:flex-row md:items-center gap-8">
          <div class="md:w-1/4 flex flex-col items-center text-center">
            <div class="w-16 h-16 rounded-full bg-{{ item.color|default('indigo') }}-100 flex items-center justify-center text-{{ item.color|default('indigo') }}-600 mb-4">
              <i class="{{ item.icon }}" aria-hidden="true"></i>
            </div>
            <div class="text-4xl font-bold text-gray-900 mb-2">{{ item.value }}</div>
            <div class="text-lg font-medium text-gray-700">{{ item.label }}</div>
          </div>
          
          <div class="md:w-3/4">
            {% if item.description %}
            <p class="text-gray-600">{{ item.description }}</p>
            {% endif %}
            
            {% if item.details %}
            <div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
              {% for detail in item.details %}
              <div class="flex items-start">
                <svg class="w-5 h-5 text-indigo-500 mr-2 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
                </svg>
                <span class="text-gray-600">{{ detail }}</span>
              </div>
              {% endfor %}
            </div>
            {% endif %}
          </div>
        </div>
      </div>
      {% endfor %}
    </div>
    {% endif %}
  </div>
</section>
