<template>
  <section class="features-section">
    <div class="container">
      <div class="section-label">The Solution</div>
      <h2 class="section-heading">A System That Actually Works</h2>
      <p class="section-subheading">
        Chorly gives your family a structured, fun, and rewarding system — so chores become
        something kids want to do.
      </p>
      <div class="features-list">
        <div
          v-for="(feature, index) in features"
          :key="feature.title"
          class="feature-row"
          :class="{ 'feature-row-reverse': index % 2 !== 0 }"
        >
          <div class="feature-screenshot">
            <img :src="feature.screenshot" :alt="feature.screenshotLabel" class="screenshot-img" />
          </div>
          <div class="feature-text">
            <div class="feature-tag">{{ feature.tag }}</div>
            <h3 class="feature-title">{{ feature.title }}</h3>
            <p class="feature-body">{{ feature.body }}</p>
          </div>
        </div>
      </div>
    </div>
  </section>
</template>

<script setup lang="ts">
const features = [
  {
    tag: 'Points & Chores',
    title: 'Chores Worth Collecting',
    body: 'Create chores with fully customizable point values. Kids earn points for every task they complete, turning daily responsibilities into something genuinely satisfying to collect.',
    screenshotLabel: 'Chore Dashboard',
    screenshot: '/images/feature00.png',
  },
  {
    tag: 'Rewards',
    title: 'Goals Kids Actually Care About',
    body: "Set up custom rewards that mean something to your child — screen time, a special outing, a toy they've been wanting. Saving up points teaches patience and goal-setting.",
    screenshotLabel: 'Reward Store',
    screenshot: '/images/feature01.png',
  },
  {
    tag: 'Child View',
    title: 'Kids Stay in the Loop',
    body: 'A simple, beautiful child interface shows exactly which chores need to be done today and which rewards are within reach — no confusion, no excuses.',
    screenshotLabel: 'Child Dashboard',
    screenshot: '/images/feature02.png',
  },
  {
    tag: 'Parent Controls',
    title: 'Powerful Parental Controls',
    body: "Hidden behind a PIN, the parent panel lets you add chores, adjust rewards, review history, and manage everything — without interrupting your child's flow.",
    screenshotLabel: 'Parent Panel',
    screenshot: '/images/feature03.png',
  },
]
</script>

<style scoped>
.features-section {
  background: var(--header-bg);
  padding: 5rem 1.5rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.6rem;
  text-align: center;
}

.section-heading {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--landing-feature-heading);
  text-align: center;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.section-subheading {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--landing-feature-body);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 4rem;
  line-height: 1.65;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.feature-row-reverse {
  direction: rtl;
}

.feature-row-reverse > * {
  direction: ltr;
}

.screenshot-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1.5px solid var(--landing-placeholder-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  object-fit: cover;
}

.feature-tag {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.5rem;
}

.feature-title {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 800;
  color: var(--landing-feature-heading);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.feature-body {
  font-size: 0.97rem;
  color: var(--landing-feature-body);
  line-height: 1.7;
  margin: 0;
}

/* Tablet */
@media (max-width: 800px) {
  .feature-row,
  .feature-row-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 1.5rem;
  }

  .feature-row-reverse > * {
    direction: ltr;
  }
}

/* Mobile */
@media (max-width: 560px) {
  .features-section {
    padding: 3.5rem 1rem;
  }

  .features-list {
    gap: 3rem;
  }
}
</style>
