/* Tutorial Styles */
.tutorial-wrapper {
  max-width: 480px;
  margin: 0 auto;
}

.accordion-container {
  border: 1px solid #D5D5D5;
  border-radius: 4px;
  background: var(--plugin-bg);
  overflow: hidden;
  margin: 26px 16px 16px 16px;
}

.accordion-section {
  border-bottom: 1px solid #D5D5D5;
}

.accordion-section:last-child {
  border-bottom: none;
}

.accordion-header {
  position: relative;
  width: 100%;
  height: 44px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  z-index: 1;
}

.accordion-label {
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
  color: #2C2C2C;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--plugin-bg);
  padding: 0 16px;
}

.icon-text-component {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-text-component .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-text-component .text {
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
}

.tutorial-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.examples-container {
  overflow-x: auto;
  margin-bottom: 0;
  padding-bottom: 8px;
  padding-left: 10px;
}

/* Features area should center grid but not affect content inside cards */
.section[data-section="2"] .features-area {
  align-items: center !important;
  justify-content: center !important;
}

/* How It Works Styles - Base */
.how-it-works-grid .step-card,
.how-it-works-grid .feature-card.step-card,
.section .how-it-works-grid .step-card {
  background: var(--bg-primary) !important;
  border: 1px solid white !important;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;

  /* Initial state - hidden */
  opacity: 0;
  transform: translateY(60px);
  will-change: opacity, transform;
}

/* Animated state - triggers when .animate class is added */
.how-it-works-grid .step-card.animate,
.how-it-works-grid .feature-card.step-card.animate,
.section .how-it-works-grid .step-card.animate {
  animation: stepFadeInUp 1.2s ease-out forwards !important;
}

/* Stagger delay for each step */
.how-it-works-grid .step-card.animate:nth-child(1),
.how-it-works-grid .feature-card.step-card.animate:nth-child(1),
.section .how-it-works-grid .step-card.animate:nth-child(1) {
  animation-delay: 0.2s;
}

.how-it-works-grid .step-card.animate:nth-child(2),
.how-it-works-grid .feature-card.step-card.animate:nth-child(2),
.section .how-it-works-grid .step-card.animate:nth-child(2) {
  animation-delay: 1.0s;
}

.how-it-works-grid .step-card.animate:nth-child(3),
.how-it-works-grid .feature-card.step-card.animate:nth-child(3),
.section .how-it-works-grid .step-card.animate:nth-child(3) {
  animation-delay: 1.8s;
}

/* Mobile: No fade-in animation, only active card is visible */
@media (max-width: 767px) {
  .how-it-works-grid .step-card.active-card {
    opacity: 1 !important;
    transform: none !important;
  }

  .how-it-works-grid .step-card {
    opacity: 1;
    transform: none;
  }
}

/* Keyframes for fade-in-up animation */
@keyframes stepFadeInUp {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.how-it-works-grid .feature-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}

.how-it-works-grid .feature-icon {
  width: 56px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.how-it-works-grid .feature-icon img {
  width: 56px;
  height: 48px;
  display: block;
}

.how-it-works-grid .feature-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  width: 100%;
}

.section .how-it-works-grid h3,
.section .how-it-works-grid .step-card h3,
.section .how-it-works-grid .feature-card h3,
.section .how-it-works-grid .feature-card.step-card h3 {
  font-family: 'Fira Sans', sans-serif !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  text-align: left !important;
}

.how-it-works-grid .feature-description,
.how-it-works-grid .feature-card .feature-description,
.how-it-works-grid .step-card .feature-description,
.how-it-works-grid .feature-card:nth-child(1) .feature-description,
.how-it-works-grid .feature-card:nth-child(2) .feature-description,
.how-it-works-grid .feature-card:nth-child(3) .feature-description {
  font-family: 'Fira Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  color: var(--text-secondary) !important;
  margin: 0;
  display: block !important;
}

/* Hide pagination on desktop/tablet */
.how-it-works-grid .feature-pagination {
  display: none;
}

/* Override landscape tablet styles from section2.css */
@media (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
  .how-it-works-grid .feature-icon {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
  }

  .how-it-works-grid .feature-content-wrapper {
    align-items: flex-start !important;
  }
}

/* How It Works - Tablet: Stack vertically, full width (12 columns = 724px) */
@media (min-width: 768px) and (max-width: 991px) {
  .how-it-works-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    overflow-x: visible;
  }

  .how-it-works-grid .step-card {
    width: 100%;
    max-width: var(--container-md);
  }

  /* Force correct color for h3 and description on tablet */
  .section .how-it-works-grid h3,
  .section .how-it-works-grid .step-card h3,
  .section .how-it-works-grid .feature-card h3,
  .section .how-it-works-grid .feature-card.step-card h3 {
    color: var(--text-primary) !important;
    font-weight: 400 !important;
  }

  .how-it-works-grid .feature-description {
    color: var(--text-secondary) !important;
  }
}

/* Desktop LG: 992-1199px */
@media (min-width: 992px) and (max-width: 1199px) {
  .how-it-works-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--gutter-lg);
    max-width: 960px; /* 12 columns LG */
    width: 100%;
    /* Single border for entire container */
    background: var(--bg-primary) !important;
    border: 1px solid white !important;
    border-radius: 12px;
    padding: 16px;
  }

  .how-it-works-grid .step-card,
  .how-it-works-grid .feature-card.step-card,
  .section .how-it-works-grid .step-card {
    flex: 1 1 0;
    width: auto;
    display: flex;
    flex-direction: column;
    /* Remove individual card borders */
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .how-it-works-grid .feature-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .how-it-works-grid .feature-content {
    flex: 1;
  }

  /* Force correct color for h3 */
  .section .how-it-works-grid h3,
  .section .how-it-works-grid .step-card h3,
  .section .how-it-works-grid .feature-card h3,
  .section .how-it-works-grid .feature-card.step-card h3 {
    color: var(--text-primary) !important;
    font-weight: 400 !important;
  }
}

/* Desktop: 1200-1439px */
@media (min-width: 1200px) and (max-width: 1439px) {
  .how-it-works-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--gutter-desktop);
    max-width: 1170px; /* 12 columns Desktop */
    width: 100%;
  }

  .how-it-works-grid .step-card {
    flex: 1 1 0;
    width: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .how-it-works-grid .feature-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .how-it-works-grid .feature-content {
    flex: 1;
  }

  /* Force correct color for h3 */
  .section .how-it-works-grid h3,
  .section .how-it-works-grid .step-card h3,
  .section .how-it-works-grid .feature-card h3,
  .section .how-it-works-grid .feature-card.step-card h3 {
    color: var(--text-primary) !important;
    font-weight: 400 !important;
  }
}

/* XL: 1440-1919px */
@media (min-width: 1440px) and (max-width: 1919px) {
  .how-it-works-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--gutter-xl);
    max-width: 1320px; /* 12 columns XL */
    width: 100%;
  }

  .how-it-works-grid .step-card {
    flex: 1 1 0;
    width: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .how-it-works-grid .feature-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .how-it-works-grid .feature-content {
    flex: 1;
  }
}

/* XXL: 1920px+ */
@media (min-width: 1920px) {
  .how-it-works-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--gutter-xxl);
    max-width: 1680px; /* 12 columns XXL */
    width: 100%;
  }

  .how-it-works-grid .step-card {
    flex: 1 1 0;
    width: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .how-it-works-grid .feature-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .how-it-works-grid .feature-content {
    flex: 1;
  }
}

/* How It Works - Mobile: Simple card switching */
@media (max-width: 767px) {
  .features-area {
    padding: 16px !important;
  }

  .how-it-works-grid {
    width: 100%;
  }

  /* Hide all cards by default */
  .how-it-works-grid .step-card {
    display: none !important;
    width: 100% !important;
    padding: 24px !important;
    gap: 16px !important;
    flex-direction: column !important;
  }

  /* Show only active card */
  .how-it-works-grid .step-card.active-card {
    display: flex !important;
  }

  /* Content wrapper - order 1 */
  .how-it-works-grid .feature-content-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    order: 1 !important;
    flex: 1 !important;
  }

  /* Icon - 56x48px on mobile */
  .how-it-works-grid .feature-icon {
    width: 56px !important;
    height: 48px !important;
    min-width: 56px !important;
    min-height: 48px !important;
    max-width: 56px !important;
    max-height: 48px !important;
    flex-shrink: 0 !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }

  .how-it-works-grid .feature-icon img {
    width: 56px !important;
    height: 48px !important;
  }

  /* Content container */
  .how-it-works-grid .feature-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 !important;
  }

  /* Title */
  .section .how-it-works-grid h3,
  .section .how-it-works-grid .step-card h3,
  .section .how-it-works-grid .feature-card h3 {
    text-align: left !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Description - dark color */
  .how-it-works-grid .feature-description {
    font-size: 16px !important;
    line-height: 22px !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Pagination - order 2, at bottom */
  .how-it-works-grid .feature-pagination {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    order: 2 !important;
  }

  .how-it-works-grid .pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px; /* Rounded square that looks like a dot */
    background: rgba(44, 44, 44, 0.3);
    cursor: pointer;
    transition: width 1s ease-in-out, background 1s ease-in-out !important;
    transform-origin: center;
  }

  .how-it-works-grid .pagination-dot.active {
    background: #2C2C2C;
    width: 24px;
    /* border-radius stays 4px - same shape, just wider */
  }

  .how-it-works-grid .pagination-dot:hover {
    background: rgba(44, 44, 44, 0.5);
  }

  /* ====== ANIMATION: FADE + FLIP ====== */
  /* Text fade out animation */
  .how-it-works-grid .feature-content-wrapper.slide-out-left h3,
  .how-it-works-grid .feature-content-wrapper.slide-out-right h3,
  .how-it-works-grid .feature-content-wrapper.slide-out-left .feature-description,
  .how-it-works-grid .feature-content-wrapper.slide-out-right .feature-description {
    animation: textFadeOut 0.6s ease forwards;
  }

  /* Text fade in animation */
  .how-it-works-grid .feature-content-wrapper.slide-in-right h3,
  .how-it-works-grid .feature-content-wrapper.slide-in-left h3,
  .how-it-works-grid .feature-content-wrapper.slide-in-right .feature-description,
  .how-it-works-grid .feature-content-wrapper.slide-in-left .feature-description {
    animation: textFadeIn 0.6s ease forwards;
  }

  /* Icon flip out to LEFT (swipe left) */
  .how-it-works-grid .feature-content-wrapper.slide-out-left .feature-icon {
    animation: iconFlipOutLeft 0.6s ease forwards;
    transform-style: preserve-3d;
    backface-visibility: hidden;
  }

  /* Icon flip out to RIGHT (swipe right) */
  .how-it-works-grid .feature-content-wrapper.slide-out-right .feature-icon {
    animation: iconFlipOutRight 0.6s ease forwards;
    transform-style: preserve-3d;
    backface-visibility: hidden;
  }

  /* Icon flip in from RIGHT (swipe left) */
  .how-it-works-grid .feature-content-wrapper.slide-in-right .feature-icon {
    animation: iconFlipInRight 0.6s ease forwards;
    transform-style: preserve-3d;
    backface-visibility: hidden;
  }

  /* Icon flip in from LEFT (swipe right) */
  .how-it-works-grid .feature-content-wrapper.slide-in-left .feature-icon {
    animation: iconFlipInLeft 0.6s ease forwards;
    transform-style: preserve-3d;
    backface-visibility: hidden;
  }

  /* Keyframes */
  @keyframes textFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }

  @keyframes textFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes iconFlipOutLeft {
    0% {
      opacity: 1;
      transform: perspective(400px) rotateY(0deg);
    }
    100% {
      opacity: 0;
      transform: perspective(400px) rotateY(90deg);
    }
  }

  @keyframes iconFlipOutRight {
    0% {
      opacity: 1;
      transform: perspective(400px) rotateY(0deg);
    }
    100% {
      opacity: 0;
      transform: perspective(400px) rotateY(-90deg);
    }
  }

  @keyframes iconFlipInRight {
    0% {
      opacity: 0;
      transform: perspective(400px) rotateY(-90deg);
    }
    100% {
      opacity: 1;
      transform: perspective(400px) rotateY(0deg);
    }
  }

  @keyframes iconFlipInLeft {
    0% {
      opacity: 0;
      transform: perspective(400px) rotateY(90deg);
    }
    100% {
      opacity: 1;
      transform: perspective(400px) rotateY(0deg);
    }
  }
}

/* Reduce padding for very short screens */
@media (max-width: 767px) and (max-height: 650px) {
  .how-it-works-grid .step-card {
    padding: 8px 16px 16px 16px !important; /* Top reduced by 8px: 16px → 8px */
  }

  .how-it-works-grid .feature-content-wrapper {
    gap: 6px !important; /* Match second slide: 12px → 6px */
  }

  .how-it-works-grid .feature-content {
    gap: 6px !important; /* Match second slide: 12px → 6px */
  }

  .how-it-works-grid .feature-pagination {
    padding-top: 4px; /* 16px → 8px → 4px (freed 4px for icon spacing) */
  }
}

/* Reduce padding for very tall screens */
@media (max-width: 767px) and (min-height: 800px) {
  .how-it-works-grid .step-card {
    padding-top: 16px !important; /* Reduced by 8px from default 24px */
  }
}

/* Tutorial responsive adjustments */
@media (max-width: 767px) {
  .tutorial-wrapper {
    padding: 24px 0;
  }

  #plugin-logo {
    padding: 16px;
  }
}
