/* =============================================
   PURPOSE-BUILT TOOLS SECTION - Guesty-Inspired Tabs
   ============================================== */

/* Header Section */
.purpose-tools-header-section {
  position: relative;
  padding: 120px 0 0;
}

.purpose-tools-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.purpose-tools-header-content {
  flex: 1;
  max-width: 700px;
}

.purpose-tools-cta {
  flex-shrink: 0;
  padding-top: 48px;
}

.purpose-tools-cta .more-button {
  display: inline-block;
  width: 185px;
  line-height: 50px;
  text-align: center;
  border-radius: 6px;
  color: #fff;
  box-shadow: 0px 10px 40px 0px rgba(16, 117, 105, 0.25);
  background: var(--kepple-gradient-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.purpose-tools-cta .more-button::after {
  content: '→';
  position: absolute;
  right: 20px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.purpose-tools-cta .more-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0px 15px 50px rgba(16, 117, 105, 0.35);
  color: #fff;
  text-decoration: none;
  padding-left: 10px;
  padding-right: 40px;
}

.purpose-tools-cta .more-button:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Dark Green Content Section */
.purpose-tools-section {
  position: relative;
  padding: 80px 0;
  background: #072d22;
  overflow: hidden;
}

/* Inner wrapper */
.purpose-tools-inner {
  position: relative;
  z-index: 2;
}

/* Tabs Wrapper */
.purpose-tools-tabs-wrapper {
  margin-top: 60px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--neutral-200);
}

/* Tabs Navigation - Guesty Style */
.purpose-tools-tabs {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0;
}

.purpose-tools-tabs::-webkit-scrollbar {
  display: none;
}

.purpose-tools-tab {
  flex-shrink: 0;
  padding: 16px 0 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--neutral-400);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  margin-bottom: -1px;
}

.purpose-tools-tab:hover {
  color: var(--neutral-700);
}

.purpose-tools-tab.active {
  color: var(--neutral-950);
  font-weight: 600;
}

/* Progress bar underline */
.purpose-tools-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--neutral-950);
  transition: none;
}

.purpose-tools-tab.active::after {
  animation: tabProgress 10s linear forwards;
}

/* When user has selected manually, show full underline */
.purpose-tools-tab.active.user-selected::after {
  animation: none;
  width: 100%;
}

/* Pause animation on hover */
.purpose-tools-tabs-wrapper:hover .purpose-tools-tab.active::after {
  animation-play-state: paused;
}

@keyframes tabProgress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Tab Content Panels */
.purpose-tools-content {
  position: relative;
}

.purpose-tools-panel {
  display: none;
  animation: fadeInPanel 0.4s ease;
}

.purpose-tools-panel.active {
  display: block;
}

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

/* Panel Layout - Card + Image */
.panel-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: stretch;
}

/* Content Card (gradient blends from background at top-left) */
.panel-card {
  background: linear-gradient(135deg,
    transparent 0%,
    rgba(21, 183, 159, 0.12) 100%);
  border-radius: 20px;
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-headline {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* Tag Pills */
.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.panel-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--kepple-300);
  background: rgba(21, 183, 159, 0.12);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(21, 183, 159, 0.2);
}

/* Bullet Points */
.panel-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
}

.panel-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
}

.panel-features li:last-child {
  margin-bottom: 0;
}

.panel-features li::before {
  content: '→';
  flex-shrink: 0;
  color: var(--kepple-400);
  font-weight: 600;
  font-size: 14px;
  margin-top: 2px;
}

/* Panel CTA Button */
.panel-cta {
  display: inline-block;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--kepple-gradient-primary);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.panel-cta::after {
  content: '→';
  position: absolute;
  right: 20px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.panel-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 183, 159, 0.3);
  padding-right: 45px;
  text-decoration: none;
  color: #ffffff;
}

.panel-cta:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Panel Image - Right card with subtle gradient only at bottom-right corner */
.panel-image {
  position: relative;
  background: radial-gradient(
    circle at 100% 100%,
    rgba(21, 183, 159, 0.08) 0%,
    transparent 50%);
  border-radius: 20px;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Image placeholder - contains image without stretching card */
.panel-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.panel-image-placeholder img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Integrations logos special layout */
.panel-image-placeholder.integrations-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.panel-image-placeholder.integrations-logos img {
  width: auto;
  max-width: 180px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: all 0.3s ease;
}

.panel-image-placeholder.integrations-logos img:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .purpose-tools-tabs {
    gap: 30px;
  }

  .panel-layout {
    gap: 40px;
  }

  .panel-card {
    padding: 40px;
  }

  .panel-headline {
    font-size: 28px;
  }
}

@media (max-width: 992px) {
  .purpose-tools-header-section {
    padding: 90px 0 0;
  }

  .purpose-tools-section {
    padding: 60px 0;
  }

  .purpose-tools-header {
    flex-direction: column;
    gap: 30px;
  }

  .purpose-tools-cta {
    padding-top: 0;
  }

  .purpose-tools-tabs-wrapper {
    margin-top: 40px;
  }

  .purpose-tools-tabs {
    gap: 20px;
    justify-content: flex-start;
  }

  .panel-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .panel-image {
    order: -1;
  }
}

/* =============================================
   MOBILE ACCORDION - Guesty Style
   ============================================== */

/* Hidden by default on desktop */
.purpose-tools-mobile-accordion {
  display: none;
}

.mobile-panel-image-container {
  display: none;
}

@media (max-width: 768px) {
  .purpose-tools-header-section {
    padding: 70px 0 0;
  }

  .purpose-tools-section {
    padding: 40px 0;
  }

  /* Hide desktop tabs on mobile */
  .purpose-tools-tabs-wrapper {
    display: none;
  }

  /* Hide desktop panels on mobile */
  .purpose-tools-content {
    display: none;
  }

  /* Show mobile accordion */
  .purpose-tools-mobile-accordion {
    display: block !important;
    margin-bottom: 24px;
  }

  .panel-card {
    padding: 32px;
  }

  .panel-headline {
    font-size: 24px;
  }

  .panel-features li {
    font-size: 15px;
  }

  .purpose-tools-cta .more-button {
    width: 100%;
  }
}

/* Mobile Accordion Item */
.mobile-accordion-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
}

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

/* Vertical Progress Bar */
.accordion-progress-bar {
  width: 3px;
  background: transparent;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
  margin-right: 16px;
}

.accordion-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  transition: background 0.3s ease;
}

/* Active item - green animating progress */
.mobile-accordion-item.active .accordion-progress-bar {
  overflow: hidden;
}

.mobile-accordion-item.active .accordion-progress-fill {
  background: transparent;
}

.mobile-accordion-item.active .accordion-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, var(--kepple-400) 0%, var(--kepple-500) 100%);
  border-radius: 2px;
  animation: accordionProgress 10s linear forwards;
}

/* User selected - full green bar immediately */
.mobile-accordion-item.active.user-selected .accordion-progress-fill {
  background: linear-gradient(180deg, var(--kepple-400) 0%, var(--kepple-500) 100%);
}

.mobile-accordion-item.active.user-selected .accordion-progress-fill::after {
  display: none;
}

@keyframes accordionProgress {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

/* Accordion Item Content Wrapper */
.accordion-item-content {
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-accordion-item:last-child .accordion-item-content {
  border-bottom: none;
}

/* Accordion Header */
.mobile-accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 18px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
}

.mobile-accordion-header span {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.mobile-accordion-item.active .mobile-accordion-header span {
  color: #ffffff;
  font-weight: 600;
}

/* Accordion Content */
.mobile-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0;
}

.mobile-accordion-item.active .mobile-accordion-content {
  max-height: 500px;
  padding-bottom: 16px;
}

/* Accordion Features List */
.mobile-accordion-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-accordion-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
  padding-left: 4px;
}

.mobile-accordion-features li:last-child {
  margin-bottom: 0;
}

.mobile-accordion-features li::before {
  content: '→';
  flex-shrink: 0;
  color: var(--kepple-400);
  font-weight: 600;
  font-size: 14px;
}

/* Mobile Panel Image Container */
@media (max-width: 768px) {
  .mobile-panel-image-container {
    display: block;
    margin-top: 32px;
    background: radial-gradient(
      circle at 100% 100%,
      rgba(21, 183, 159, 0.08) 0%,
      transparent 50%);
    border-radius: 16px;
    padding: 24px;
    min-height: 280px;
    position: relative;
  }

  .mobile-panel-image-container .panel-animation {
    width: 100%;
    height: 100%;
  }

  .mobile-panel-image-container .panel-image-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
  }

  .mobile-panel-image-container .panel-image-placeholder.integrations-logos {
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
  }

  .mobile-panel-image-container .panel-image-placeholder.integrations-logos img {
    max-width: 140px;
    max-height: 60px;
  }
}

@media (max-width: 480px) {
  .purpose-tools-header-section {
    padding: 60px 0 0;
  }

  .purpose-tools-section {
    padding: 30px 0;
  }

  /* Mobile accordion adjustments for smaller screens */
  .accordion-progress-bar {
    width: 2px;
    margin-right: 12px;
  }

  .mobile-accordion-header {
    padding: 14px 0;
  }

  .mobile-accordion-header span {
    font-size: 15px;
  }

  .mobile-accordion-features li {
    font-size: 14px;
    gap: 10px;
    margin-bottom: 10px;
  }

  .mobile-panel-image-container {
    margin-top: 24px;
    padding: 20px;
    min-height: 220px;
  }

  .mobile-panel-image-container .panel-image-placeholder {
    min-height: 200px;
  }

  .panel-card {
    padding: 24px;
  }

  .panel-headline {
    font-size: 22px;
  }

  .panel-tags {
    gap: 8px;
  }

  .panel-tag {
    font-size: 11px;
    padding: 5px 12px;
  }

  .panel-features li {
    font-size: 14px;
  }
}
