/* ============================================================================
   BENEFITS SECTION COMPONENT

   Grid of feature/benefit cards with icons, displayed in a two-tier responsive
   layout showing Free+Premium and Premium Only features.

   Purpose: Showcase key product features in visually appealing clickable cards
   with hover effects, organized by pricing tier.

   Required HTML Structure:

   <section class="features benefits">
     <div class="container">
       <h2 class="section-title">Our Features</h2>
       <p class="section-subtitle">Optional subtitle text</p>

       <!-- Free + Premium Tier -->
       <div class="features-tier">
         <h3 class="tier-title">Free Core Features Forever</h3>
         <div class="features-grid">
           <a href="#feature-url" class="feature-card-link">
             <div class="feature-card">
               <div class="feature-icon">
                 <i class="fas fa-icon-name"></i>
               </div>
               <h4>Feature Title</h4>
               <p>Feature description text goes here.</p>
             </div>
           </a>
           <!-- More feature cards -->
         </div>
       </div>

       <!-- Premium Only Tier -->
       <div class="features-tier features-tier--premium">
         <h3 class="tier-title tier-title--premium">Premium Only</h3>
         <div class="features-grid">
           <!-- Premium feature cards -->
         </div>
       </div>
     </div>
   </section>

   Dependencies:
   - Font Awesome (for icons)

   Features:
   - Two-tier layout (Free+Premium and Premium Only)
   - Responsive grid (auto-fit, min 280px columns)
   - Glassmorphism card effect
   - Clickable cards wrapped in anchor tags
   - Hover lift animation
   - Gradient top border animation
   - Icon scale and rotate on hover

   Accessibility:
   - Semantic heading hierarchy
   - Clickable cards with proper focus states
   - Icon alternatives via text content
   - Sufficient color contrast

   Notes:
   - Section uses .features class (not .benefits for legacy reasons)
   - Cards have backdrop-filter blur effect
   - Grid automatically wraps on smaller screens
   - Top border gradient animation on hover
   - Cards are wrapped in anchor tags for navigation
   ============================================================================ */

/* ===== Section Container ===== */

.features {
  padding: 30px 0 120px;
  background: transparent;
  position: relative;
  overflow: hidden;
}

/* Continue gradient from features-showcase when combined */
.features.benefits {
  background: transparent;
  padding: 60px 0 120px;
}


/* ===== Section Title and Subtitle ===== */

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  position: relative;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}


/* ===== Feature Tiers ===== */

.features-tier {
  margin-bottom: 4rem;
}

.features-tier:last-child {
  margin-bottom: 0;
}

.tier-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
  position: relative;
}

.tier-title--premium {
  background: linear-gradient(135deg, var(--sky-blue), var(--light-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ===== Features Grid ===== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Center the 7th card in the middle column when it's alone (index.html - 7 cards) */
.feature-card:nth-child(7):last-child {
  grid-column: 2 / 3;
}

/* Center the 10th card in the middle column when it's alone (premium.html - 10 cards) */
.feature-card:nth-child(10):last-child {
  grid-column: 2 / 3;
}


/* ===== Feature Card Wrapper ===== */
/* Note: Cards are currently non-clickable. For clickable restoration, see docs/premium-features/clickable-feature-cards.html */

.feature-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  outline: none;
  transition: transform 0.2s ease;
  max-width: 100%;
  width: 100%;
}

.feature-card-link:focus {
  outline: none;
}

.feature-card-link:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
}


/* ===== Feature Card ===== */

.feature-card {
  background: linear-gradient(
    145deg,
    rgba(30, 58, 138, 0.8),
    rgba(30, 64, 175, 0.6)
  );
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(147, 197, 253, 0.1);
  height: 100%;
}

/* Premium Badge */
.premium-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(16, 185, 129, 0.6);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Hover effects enabled for visual feedback (cards are non-clickable) */
.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--sky-blue),
    var(--light-blue)
  );
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-8px);
  background: linear-gradient(
    145deg,
    rgba(37, 99, 235, 0.9),
    rgba(30, 64, 175, 0.7)
  );
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(96, 165, 250, 0.2);
  border-color: var(--sky-blue);
}


/* ===== Feature Icon ===== */

.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--sky-blue), var(--navy-light));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 28px;
  color: var(--white);
  transition: all var(--transition-normal);
  box-shadow: 0 10px 20px rgba(96, 165, 250, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Icon hover effects enabled for visual feedback */
.feature-card:hover .feature-icon {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 12px 24px rgba(91, 141, 201, 0.3);
}


/* ===== Feature Content ===== */

.feature-card h3,
.feature-card h4 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--white);
  font-weight: 600;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.7;
}


/* ===== Responsive ===== */

/* Medium screens (tablet): 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Span 7th card across both columns and center it (index.html - 7 cards) */
  .feature-card:nth-child(7):last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.75rem);
    margin: 0 auto;
  }

  /* Reset 10th card centering for 2-column layout (premium.html - 10 cards flow naturally) */
  .feature-card:nth-child(10):last-child {
    grid-column: auto;
  }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
  .features {
    padding: 20px 0 60px;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .tier-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  .features-tier {
    margin-bottom: 3rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Reset 7th card to normal flow on mobile (index.html - 7 cards) */
  .feature-card:nth-child(7):last-child {
    grid-column: auto;
    max-width: none;
    margin: 0;
  }

  /* Reset 10th card to normal flow on mobile (premium.html - 10 cards) */
  .feature-card:nth-child(10):last-child {
    grid-column: auto;
  }

  .feature-card {
    padding: 1.25rem;
  }
}
