@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* =============================================================================
   AAFE Feature Tabs Widget — style.css
   ============================================================================= */

/* --- Font Assignments -------------------------------------------------------- */
.aafe-feature-tabs__wrapper h1,
.aafe-feature-tabs__wrapper h2,
.aafe-feature-tabs__wrapper h3,
.aafe-feature-tabs__wrapper h4,
.aafe-feature-tabs__wrapper h5,
.aafe-feature-tabs__wrapper h6 {
    font-family: 'Sora', sans-serif;
}

.aafe-feature-tabs__wrapper p,
.aafe-feature-tabs__wrapper span,
.aafe-feature-tabs__wrapper li,
.aafe-feature-tabs__wrapper a,
.aafe-feature-tabs__wrapper button {
    font-family: 'Inter', sans-serif;
}

/* =============================================================================
   WRAPPER
   ============================================================================= */
.aafe-feature-tabs__wrapper {
    background-color: #16231b;
    padding: 80px 32px;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* =============================================================================
   GRID — Mobile First
   ============================================================================= */
.aafe-feature-tabs__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    align-items: start;
}

@media (min-width: 768px) {
    .aafe-feature-tabs__grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 80px;
        row-gap: 0;
        align-items: stretch;
    }
}

/* Reversed layout */
.aafe-feature-tabs__wrapper--reverse .aafe-feature-tabs__left  { order: 2; }
.aafe-feature-tabs__wrapper--reverse .aafe-feature-tabs__right { order: 1; }

/* =============================================================================
   LEFT COLUMN
   ============================================================================= */
.aafe-feature-tabs__left {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- Header ------------------------------------------------------------------ */
.aafe-feature-tabs__header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

/* =============================================================================
   LABEL BADGE
   ============================================================================= */
.aafe-feature-tabs__label-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 100px;
    padding: 4px 16px;
    color: #f9f5eb;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 16px;
}

/* =============================================================================
   HEADINGS
   — Scroll animation: only fires on FRONTEND (not in editor)
   — In editor: headings are always fully visible
   ============================================================================= */

.aafe-feature-tabs__heading-wrap {
    max-width: 528px;
}

.aafe-feature-tabs__heading-line {
    overflow: hidden;
    padding-bottom: 4px;
}

/* Base: always visible (editor + frontend default) */
.aafe-feature-tabs__heading {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: clamp(32px, 5vw, 72px);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: #f9f5eb;
    display: block;
    will-change: transform;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.aafe-feature-tabs__heading--delayed {
    transition-delay: 0.15s;
}

/*
 * SCROLL ANIMATION STATES
 * .aafe-feature-tabs__wrapper--animated = scroll animations enabled
 * .is-in-view = added by JS when element enters viewport
 *
 * Hidden state: only when animated class is present AND not yet in view
 */
.aafe-feature-tabs__wrapper--animated:not(.is-in-view) .aafe-feature-tabs__heading {
    transform: translateY(105%);
}

.aafe-feature-tabs__wrapper--animated.is-in-view .aafe-feature-tabs__heading {
    transform: translateY(0);
}

/* Label badge fade-in */
.aafe-feature-tabs__label-badge {
    transition: opacity 0.7s ease, transform 0.7s ease;
    -webkit-transition: opacity 0.7s ease, transform 0.7s ease;
}

.aafe-feature-tabs__wrapper--animated:not(.is-in-view) .aafe-feature-tabs__label-badge {
    opacity: 0;
    transform: translateY(12px);
}

.aafe-feature-tabs__wrapper--animated.is-in-view .aafe-feature-tabs__label-badge {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================================================
   TAB MENU
   ============================================================================= */
.aafe-feature-tabs__tab-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.aafe-feature-tabs__tab-link {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: rgba(249, 245, 235, 0.70);
    padding: 16px;
    border-radius: 8px;
    position: relative;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-transition: background-color 0.25s ease, color 0.25s ease;
}

.aafe-feature-tabs__tab-link:hover,
.aafe-feature-tabs__tab-link:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
    color: #f9f5eb;
    outline: none;
}

.aafe-feature-tabs__tab-link:hover .aafe-feature-tabs__tab-icon,
.aafe-feature-tabs__tab-link:focus-visible .aafe-feature-tabs__tab-icon {
    color: #f9f5eb;
}

.aafe-feature-tabs__tab-link.is-active {
    background-color: rgba(255, 255, 255, 0.16);
    color: #f9f5eb;
}

/* Active left indicator */
.aafe-feature-tabs__tab-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 55%;
    background-color: #f9f5eb;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.aafe-feature-tabs__tab-link.is-active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Autoplay Progress Bar */
.aafe-feature-tabs__progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aafe-feature-tabs__wrapper[data-autoplay="yes"] .aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__progress-track {
    opacity: 1;
}

.aafe-feature-tabs__progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background-color: #f9f5eb;
}

.aafe-feature-tabs__wrapper[data-autoplay="yes"] .aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__progress-fill {
    animation: aafeProgressFill var(--autoplay-speed, 3000ms) linear forwards;
}

.aafe-feature-tabs__wrapper.is-paused .aafe-feature-tabs__progress-fill {
    animation-play-state: paused;
}

@keyframes aafeProgressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Accordion row */
.aafe-feature-tabs__accordion-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* Icon */
.aafe-feature-tabs__tab-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(249, 245, 235, 0.70);
    transition: color 0.25s ease;
    -webkit-transition: color 0.25s ease;
}

.aafe-feature-tabs__tab-icon i {
    font-size: 22px;
    line-height: 1;
}

.aafe-feature-tabs__tab-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__tab-icon {
    color: #f9f5eb;
}

/* Tab title */
.aafe-feature-tabs__tab-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.aafe-feature-tabs__tab-title-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.aafe-feature-tabs__tab-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(249, 245, 235, 0.6);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    white-space: normal;
    word-wrap: break-word;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
    -webkit-transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__tab-desc {
    max-height: 200px;
    opacity: 1;
    margin-top: 8px;
}

/* =============================================================================
   RIGHT COLUMN — Panels
   ============================================================================= */
.aafe-feature-tabs__right {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/*
 * PANELS CONTAINER
 * — Uses position: relative so it holds natural document height
 * — Active panel is position: relative (in flow), contributes to height
 * — Inactive panels are position: absolute, overlapping the active one
 * — This avoids the "zero-height container" bug
 */
.aafe-feature-tabs__panels {
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ALL panels: start as absolutely positioned, invisible */
.aafe-feature-tabs__panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 500ms ease,
                transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-transition: opacity 500ms ease,
                        -webkit-transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* 1. FADE & ZOOM (Default) */
.aafe-feature-tabs__wrapper[data-anim="fade-zoom"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: scale(0.97) translateY(8px);
}

/* 2. SLIDE RIGHT */
.aafe-feature-tabs__wrapper[data-anim="slide-right"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: translateX(40px);
}

/* 3. SLIDE UP */
.aafe-feature-tabs__wrapper[data-anim="slide-up"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: translateY(40px);
}

/* 4. 3D FLIP */
.aafe-feature-tabs__wrapper[data-anim="flip"] .aafe-feature-tabs__panels {
    perspective: 1000px;
}
.aafe-feature-tabs__wrapper[data-anim="flip"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: rotateX(15deg) scale(0.95);
    transform-origin: center center;
}

/* ACTIVE panel: pull back into flow so container gets height */
.aafe-feature-tabs__panel.is-active {
    position: relative;
    inset: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    flex-grow: 1;
}

/* Panel image container */
.aafe-feature-tabs__panel-wrap {
    position: relative;
    width: 100%;
    flex-grow: 1;
    border-radius: 12px;
    overflow: hidden;
}

/* Cover image / video */
.aafe-feature-tabs__panel-img,
.aafe-feature-tabs__panel-video {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
}

lottie-player {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* =============================================================================
   OVERLAY BADGE (Glassmorphism)
   ============================================================================= */
.aafe-feature-tabs__overlay-badge {
    position: absolute;
    max-width: 260px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: #f9f5eb;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.07px;
    text-transform: uppercase;
    z-index: 2;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
    -webkit-transition: opacity 0.4s ease 0.25s, -webkit-transform 0.4s ease 0.25s;
}

.aafe-feature-tabs__panel.is-active .aafe-feature-tabs__overlay-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Position variants */
.aafe-feature-tabs__overlay-badge--top-right    { top: 20px; right: 20px; }
.aafe-feature-tabs__overlay-badge--top-left     { top: 20px; left: 20px; }
.aafe-feature-tabs__overlay-badge--bottom-right { bottom: 20px; right: 20px; }
.aafe-feature-tabs__overlay-badge--bottom-left  { bottom: 20px; left: 20px; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 767px) {
    .aafe-feature-tabs__wrapper {
        padding: 48px 16px;
    }

    /* panel-wrap uses height: 100% globally */

    .aafe-feature-tabs__panels {
        min-height: 380px;
    }

    .aafe-feature-tabs__tab-title {
        font-size: 16px;
    }

    .aafe-feature-tabs__tab-icon {
        width: 20px;
        height: 20px;
    }

    .aafe-feature-tabs__tab-icon i {
        font-size: 18px;
    }

    .aafe-feature-tabs__overlay-badge {
        max-width: 170px;
        font-size: 10px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .aafe-feature-tabs__wrapper {
        padding: 64px 24px;
    }

    .aafe-feature-tabs__grid {
        column-gap: 48px;
    }

    /* panel-wrap uses height: 100% globally */

    .aafe-feature-tabs__panels {
        min-height: 480px;
    }
}

/* =============================================================================
   ELEMENTOR EDITOR: always show headings (no scroll-hidden state in editor)
   The editor adds .elementor-editor-active on <body>
   ============================================================================= */
.elementor-editor-active .aafe-feature-tabs__wrapper--animated:not(.is-in-view) .aafe-feature-tabs__heading {
    transform: translateY(0) !important;
}

.elementor-editor-active .aafe-feature-tabs__wrapper--animated:not(.is-in-view) .aafe-feature-tabs__label-badge {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Fix for position: sticky inside Elementor editor wrappers */
.elementor-editor-active .elementor-element:has(.aafe-feature-tabs__wrapper--sticky),
.elementor-editor-active .elementor-widget-wrap:has(.aafe-feature-tabs__wrapper--sticky),
.elementor-editor-active .elementor-widget-container:has(.aafe-feature-tabs__wrapper--sticky),
.elementor-editor-active .elementor-section-wrap:has(.aafe-feature-tabs__wrapper--sticky) {
    overflow: visible !important;
    transform: none !important;
    perspective: none !important;
    contain: none !important;
}

/* =============================================================================
   STICKY SCROLL MODE (Desktop / Tablet Only)
   ============================================================================= */
.aafe-feature-tabs__scroll-track {
    position: relative;
    width: 100%;
}

@media (max-width: 767px) {
    .aafe-feature-tabs__scroll-track {
        height: auto !important;
    }
}

@media (min-width: 768px) {
    .aafe-feature-tabs__wrapper--sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        z-index: 10;
    }

    /* Ensure grid doesn't overflow 100vh */
    .aafe-feature-tabs__wrapper--sticky .aafe-feature-tabs__grid {
        max-height: 90vh;
    }
}
