@import "../../../../themes/recast2025/style.css";

/* Features Table Widget Styles */

.recast-features-table-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-base, 56px);
  width: 100%;
  margin: 0 auto;
  padding: var(--margins-base-vert, 100px) var(--margins-base-hori, 100px);
}

.recast-features-table__wrapper {
  max-width: var(--global-maxwidth-maxwidth-m, 1200px);
}

/* Section Header */
.recast-features-table-header-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-m, 24px);
  width: 100%;
}

.recast-features-table-title {
  font-family: var(--font-family-headings, "Host Grotesk");
  font-size: var(--size-heading-l, 48px);
  font-weight: 400;
  line-height: 100%;
  letter-spacing: 0.96px;
  color: var(--neutrals-black, #161F5B);
  margin: 0;
  width: 100%;
}

.recast-features-table-title .highlight {
  color: var(--primary-recast-blue, #0372FF);
}

.recast-features-table-description {
  font-family: var(--font-family-body, "Host Grotesk");
  font-size: var(--size-body-s, 20px);
  font-weight: 300;
  line-height: 100%;
  color: var(--neutrals-black, #161F5B);
  margin: 0;
  width: 100%;
  margin-bottom: var(--gap-m);
}

/* Table Container */
.recast-features-table-container {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l, 32px);
  width: 100%;
}

/* Table Header Row */
.recast-features-table-header-row {
  display: grid;
  grid-template-columns: 1fr 176px 176px;
  background: var(--primary-royal-blue, #1F289C);
}

.recast-features-table-header-cell {
  flex: 0 0 176px;
}
.recast-features-table-header-cell.features-header {
  flex: 1 1;
  align-self: center;
}

.recast-features-table-header-cell.column-header {
    border-left: var(--neutrals-white) 2px solid;
}


.recast-features-table-header-row.features-only {
  grid-template-columns: 1fr;
}

.recast-features-table-header-cell.full-width {
  border-right: none;
}

.recast-features-table-header-cell {
  display: flex;
  padding: 20px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--gap-xs, 8px);
}

.recast-features-table-header-cell:last-child {
  border-right: none;
}

.recast-features-table-header-cell.features-header .header-title {
  color: var(--primary-recast-teal, #31D1FF);
  font-family: var(--font-family-headings, "Host Grotesk");
  font-size: var(--size-heading-xs, 20px);
  font-weight: 500;
  line-height: 100%;
  letter-spacing: 0.6px;
}

.column-content {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs, 8px);
  width: 100%;
}

.column-title {
  color: var(--primary-recast-teal, #31D1FF);
  font-family: var(--font-family-headings, "Host Grotesk");
  font-size: var(--size-heading-xs, 20px);
  font-weight: 500;
  line-height: 100%;
  letter-spacing: 0.6px;
}

.column-description {
  color: var(--neutrals-white, #FFF);
  font-family: var(--font-family-body, "Host Grotesk");
  font-size: var(--size-body-sub, 14px);
  font-weight: 400;
  line-height: 100%;
}

/* Mobile Header Buttons - Hidden by default */
.recast-features-table-mobile-buttons {
  width: 67%;
  display: none;
  padding: 2px;
  background: var(--primary-recast-blue, #0372FF);
}

.mobile-cta-items{
  display: flex;
  flex-direction: row;
  background: var(--primary-royal-blue, #1F289C);
  padding: 5px;
  @media(min-width: 768px) {
    display: none;
  }
  
}

.mobile-cta-items .header-title-cta {
  width: 33%;
  padding: 6px 10px;
  justify-content: flex-start;
  align-items: center;
}

.mobile-cta-items .header-title-cta .header-title{
  color: var(--primary-recast-teal, #31D1FF);
  font-family: var(--font-family-headings, "Host Grotesk");
  font-size: var(--size-heading-xs, 20px);
  font-weight: 500;
  line-height: 100%;
  letter-spacing: 0.6px;
}

.mobile-cta-items.features-only {
  justify-content: center;
}

.mobile-cta-items.features-only .header-title-cta.full-width {
  width: 100%;
  text-align: center;
}

.mobile-column-btn {
  display: flex;
  border: none;
  justify-content: center;
  align-items: center;
  flex: 1;
  height: 32px;
  padding: 0px 10px 0 10px;
  background: var(--primary-royal-blue, #1F289C);
  color: var(--neutrals-white, #FFF);
  font-family: var(--font-family-body, "Host Grotesk");
  font-size: var(--size-body-sub, 14px);
  font-weight: 700;
  line-height: 100%;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 50%;
  border-radius: 0;
  text-wrap: wrap;
}

.mobile-column-btn.active {
  background: var(--primary-recast-blue, #0372FF);
}

.mobile-column-btn:hover {
  background: rgba(3, 114, 255, 0.2);
}

/* Table Body */
.recast-features-table-body {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s, 16px);
}

/* Feature Section */
.recast-features-section {
  border: var(--stroke-width, 2px) solid var(--neutrals-grey-1, #E1E9F9);
  background: var(--neutrals-white, #FFF);
  overflow: hidden;
}

.recast-features-section.collapsed .recast-features-section-content {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* allow for tooltips to overflow */
.recast-features-section.expanded {
    overflow: visible;
}

.recast-features-section.expanded .recast-features-section-content {
  /* max-height: 1000px; */
  opacity: 1;
  pointer-events: auto;
}


.recast-features-section.expanded .recast-features-accordion-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Section Header */
.recast-features-section-header {
  display: grid;
  grid-template-columns: 1fr 176px 176px;
  padding: 20px;
  background: var(--neutrals-grey-1, #E1E9F9);
  border-bottom: var(--stroke-width, 2px) solid var(--neutrals-grey-1, #E1E9F9);
  cursor: pointer;
  position: relative;
}

.recast-features-table-container.columns-hidden .recast-features-section-header {
  grid-template-columns: 1fr;
}

.section-title {
  color: var(--neutrals-black, #161F5B);
  font-family: var(--font-family-body, "Host Grotesk");
  font-size: var(--size-body-xs, 18px);
  font-weight: 400;
  line-height: 100%;
  grid-column: 1 / span 1;
  display: flex;
  align-items: center;
}

.recast-features-accordion-arrow {
  width: 24px;
  height: 24px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  will-change: transform;
}


/* Features Content */
.recast-features-section-content {
  display: grid;
  grid-template-columns: 1fr;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.recast-features-row {
  display: grid;
  grid-template-columns: 1fr 176px 176px;
  border-bottom: var(--stroke-width, 2px) solid var(--neutrals-grey-1, #E1E9F9);
}

.recast-features-table-container.columns-hidden .recast-features-row {
  grid-template-columns: 1fr;
}

.recast-features-row:last-child {
  border-bottom: none;
}

.recast-features-cell {
  display: flex;
  padding: 20px;
  align-items: center;
  border-right: var(--stroke-width, 2px) solid var(--neutrals-grey-1, #E1E9F9);
}

.recast-features-cell:last-child {
  border-right: none;
}

.recast-features-cell.feature-name {
  gap: 4px;
}

.recast-features-cell.feature-name span {
  color: var(--neutrals-black, #161F5B);
  font-family: var(--font-family-body, "Host Grotesk");
  font-size: var(--size-body-xs, 18px);
  font-weight: 400;
  line-height: 100%;
}

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

.recast-features-cell.status-cell {
  justify-content: center;
}

.status-icon {
  width: 24px;
  height: 24px;
}


/* Utility Classes */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .recast-features-table-widget {
    padding: var(--margins-base-vert, 100px) var(--margins-base-hori, 100px);
    gap: var(--gap-base, 56px);
    max-width: var(--global-maxwidth-maxwidth-s, 600px);
  }

  /* Show mobile elements, hide desktop elements */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex;
  }

  /* Adjust grid layouts for mobile */
  .recast-features-table-header-row {
    grid-template-columns: 1fr;
  }

  .recast-features-table-header-cell {
    border-right: none;
    border-bottom: var(--stroke-width, 2px) solid var(--neutrals-white, #FFF);
  }

  .recast-features-table-header-cell:last-child {
    border-bottom: none;
  }

  .recast-features-section-header {
    grid-template-columns: 1fr;
  }

  .recast-features-row {
    grid-template-columns: 1fr 56px;
  }

  .recast-features-table-container.columns-hidden .recast-features-row {
    grid-template-columns: 1fr;
  }

  .recast-features-cell.status-cell.column-2 {
    display: none;
  }

  /* Show/hide columns based on mobile button selection */
  .recast-features-table-container[data-active-column="2"] .recast-features-cell.status-cell.column-1 {
    display: none !important;
  }

  .recast-features-table-container[data-active-column="2"] .recast-features-cell.status-cell.column-2.desktop-only {
    display: flex !important;
    justify-content: center;
    align-items: center;
  }

  .recast-features-table-container[data-active-column="1"] .recast-features-cell.status-cell.column-1 {
    display: flex !important;
    justify-content: center;
    align-items: center;
    border: none;
  }

  .recast-features-table-container[data-active-column="1"] .recast-features-cell.status-cell.column-2.desktop-only {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .recast-features-table-title {
    font-size: var(--size-heading-m, 40px);
  }

  .recast-features-table-description {
    font-size: var(--size-body-xs, 18px);
  }
}

/* Tooltip Styles */
.tooltip-container {
  position: relative;
  display: inline-block;
  margin-right: 8px;
  margin-bottom: -3px;
}

.tooltip-trigger {
  cursor: pointer;
  transition: fill 0.2s ease;
}

.tooltip-trigger:hover {
  fill: var(--primary-recast-blue, #0372FF);
}

.tooltip-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--neutrals-grey-8, #2C3E50);
  color: var(--neutrals-white, #FFF);
  padding: 12px 16px;
  border-radius: 4px;
  font-family: var(--font-family-body, "Host Grotesk");
  font-size: var(--size-body-sub, 14px);
  font-weight: 400;
  line-height: 1.4;
  min-width: 300px;
  max-width: 400px;
  width: max-content;
  white-space: normal;
  word-wrap: break-word;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-top: 5px;
}

.tooltip-content::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 8px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--neutrals-grey-8, #2C3E50);
}

.tooltip-container.tooltip-active .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* Mobile tooltip adjustments */
@media (max-width: 767px) {
  .tooltip-content {
    position: absolute;
    left: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    top: 75% !important;
    max-width: none;
    width: auto;
    text-align: center;
  }
  
  .tooltip-content::before {
    display: none;
  }
}

/* Focus and accessibility */

.mobile-column-btn:focus {
  outline: 2px solid var(--neutrals-white, #FFF);
  outline-offset: 2px;
}

.tooltip-trigger:focus {
  outline: 2px solid var(--primary-recast-blue, #0372FF);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Animation for smooth transitions */
.recast-features-section-content {
  transition: all 0.3s ease;
}

.mobile-column-btn {
  transition: all 0.3s ease;
}

/* iOS/WebKit-specific fixes for arrow positioning */
@supports (-webkit-appearance: none) {
  .recast-features-accordion-arrow {
    -webkit-transform: translateY(-50%) rotate(180deg);
    -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .recast-features-section.expanded .recast-features-accordion-arrow {
    -webkit-transform: translateY(-50%) rotate(0deg);
  }
}
