/**
 * Platform Features Section
 * Interactive feature showcase with cards and dynamic content
 */

/* ========================================
   ROOT VARIABLES
   ======================================== */
:root {
  --primary-blue: #002a65;
  --secondary-green: #56814f;
  --background: #F8F9FB;
  --accent: #E8EDF3;
  --border-color: #E9EDF3;
  --white: #ffffff;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================
   SECTION CONTAINER
   ======================================== */
.platform-features {
  padding: 5rem 0;
  background: var(--white);
}

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

/* ========================================
   SECTION HEADER
   ======================================== */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gradient-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  background: linear-gradient(to right, var(--secondary-green), var(--secondary-green), var(--primary-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.section-header .gradient-heading {
  font-size: clamp(2rem, 5vw, 3rem);
}

.section-header p {
  font-size: 1.125rem;
  color: rgba(0, 42, 101, 0.75);
  max-width: 42rem;
  margin: 0 auto;
}

/* ========================================
   FEATURE CARDS (Top Row - Clickable Tabs)
   ======================================== */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature-card {
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 1rem;
  background: var(--background);
  cursor: pointer;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--secondary-green);
  box-shadow: 0 4px 12px rgba(0, 42, 101, 0.08);
}

.feature-card.active {
  border-color: var(--primary-blue);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(0, 42, 101, 0.12);
  transform: scale(1.05);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: var(--white);
  transition: background 0.3s ease;
}

.feature-card.active .card-icon {
  background: var(--primary-blue);
}

.card-icon svg {
  width: 28px;
  height: 28px;
  display: block;
  margin: auto;
  stroke: var(--secondary-green);
  fill: none;
  transition: all 0.3s ease;
  transform: translateY(1px);
}

.feature-card.active .card-icon svg {
  stroke: var(--white);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.feature-card p {
  font-size: 0.875rem;
  color: rgba(0, 42, 101, 0.7);
  line-height: 1.5;
}

/* ========================================
   FEATURE DISPLAY (Bottom Section)
   ======================================== */
.feature-display {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .feature-display {
    grid-template-columns: 1fr 1.2fr;
  }
}

/* ========================================
   FEATURE CONTENT (Left Side)
   ======================================== */
.feature-content {
  position: relative;
}

.content-panel {
  display: none;
  animation: fadeIn 0.5s ease;
}

.content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-panel .gradient-heading {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.subtitle {
  font-size: 1.25rem;
  color: rgba(0, 42, 101, 0.8);
  margin-bottom: 1rem;
}

.body-text {
  color: rgba(0, 42, 101, 0.7);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Callout Box (Privacy Feature) */
.callout-box {
  display: flex;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  background: rgba(86, 129, 79, 0.1);
  border: 2px solid rgba(86, 129, 79, 0.2);
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}

.callout-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--secondary-green);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.callout-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--white);
  fill: none;
}

.callout-box p {
  color: var(--primary-blue);
  line-height: 1.6;
  padding-top: 0.25rem;
}

/* Feature List (Bullet Points with Icons) */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-item {
  display: flex;
  gap: 1rem;
  align-items: start;
}

.item-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(86, 129, 79, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--secondary-green);
  fill: none;
}

.feature-item h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
}

.feature-item p {
  font-size: 0.875rem;
  color: rgba(0, 42, 101, 0.7);
  line-height: 1.6;
}

/* Footer Box (Rewards & Deals) */
.footer-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  background: rgba(0, 42, 101, 0.05);
  border: 1px solid rgba(0, 42, 101, 0.1);
  border-radius: 0.75rem;
  margin-top: 1.5rem;
}

.footer-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary-blue);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--white);
  fill: none;
}

.footer-box p {
  font-weight: 600;
  color: var(--primary-blue);
}

/* ========================================
   FEATURE IMAGE (Right Side)
   ======================================== */
.feature-image {
  position: sticky;
  top: 6rem;
}

.image-wrapper {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 4px solid var(--white);
  box-shadow: 0 20px 60px rgba(0, 42, 101, 0.15);
}

.image-wrapper .wp-block-image{
  display:none;
  margin:0;
}

.image-wrapper .wp-block-image.active{
  display:block;
}

.image-wrapper img{
  width:100%;
  height:auto;
  display:block;
  border-radius:1rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .platform-features {
    padding: 3rem 0;
  }

  .feature-cards {
    grid-template-columns: 1fr;
  }

  .feature-card.active {
    transform: scale(1.02);
  }

  .feature-image {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  /* Force the display area to stack */
  .feature-display {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Hide the image wrapper on mobile so it doesn't take up space */
  .image-wrapper {
    display: none !important;
  }

  /* Ensure panels render immediately after the clicked card */
  .content-panel {
    display: none !important;
    order: 2; 
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
  }

  /* Show the active panel */
  .content-panel.active {
    display: block !important;
  }
}