/* ==============================================
   CAPSULE TABS COMPONENT
   Reusable tab-based content switcher
   ============================================== */

/* ---------------------------------------------
   Base Container
   --------------------------------------------- */
.capsule-tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* ---------------------------------------------
   Preview Area (Top)
   --------------------------------------------- */
.capsule-preview {
    position: relative;
    width: 100%;
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 450px;
    height: 500px;
}

.capsule-preview::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(1, 109, 183, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.capsule-preview-glow {
    position: absolute;
    bottom: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 200px;
    background: linear-gradient(to top, rgba(1, 109, 183, 0.3), transparent);
    filter: blur(40px);
    pointer-events: none;
}

.capsule-preview-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: calc(100% - 60px);
    max-height: calc(100% - 60px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

.capsule-preview-item.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.capsule-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.capsule-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* Placeholder */
.capsule-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100% - 60px);
    height: calc(100% - 60px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 40px;
}

.capsule-preview-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
}

.capsule-preview-placeholder span {
    font-size: 14px;
}

/* ---------------------------------------------
   Tabs Container (Bottom)
   --------------------------------------------- */
.capsule-tabs-nav {
    display: flex;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 6px;
    gap: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sliding Indicator (The Fish!) */
.capsule-tabs-indicator {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    background: transparent;
    border: 2px solid var(--primary, #016db7);
    border-radius: 50px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 0 15px rgba(1, 109, 183, 0.3);
}

.capsule-tab {
    position: relative;
    z-index: 1;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light, #64748b);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.capsule-tab:hover {
    color: var(--primary, #016db7);
}

.capsule-tab.active {
    color: var(--primary, #016db7);
}

/* ---------------------------------------------
   Description Area
   --------------------------------------------- */
.capsule-description {
    text-align: center;
    max-width: 600px;
    min-height: 80px;
}

.capsule-description-item {
    display: none;
}

.capsule-description-item.active {
    display: block;
    animation: capsuleFadeIn 0.4s ease;
}

.capsule-description-item p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-light, #64748b);
    margin: 0 0 16px;
}

.capsule-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    position: relative;
    transition: gap 0.3s ease;
}

.capsule-cta::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.capsule-cta:hover {
    gap: 12px;
}

.capsule-cta:hover::after {
    width: calc(100% - 20px);
}

.capsule-cta i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.capsule-cta:hover i {
    transform: translateX(3px);
}

@keyframes capsuleFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ---------------------------------------------
   Variant: Light Background
   --------------------------------------------- */
.capsule-tabs.capsule-light .capsule-preview {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.capsule-tabs.capsule-light .capsule-preview::before {
    background: radial-gradient(circle, rgba(1, 109, 183, 0.1) 0%, transparent 70%);
}

.capsule-tabs.capsule-light .capsule-preview-glow {
    background: linear-gradient(to top, rgba(1, 109, 183, 0.15), transparent);
}

.capsule-tabs.capsule-light .capsule-preview-item img,
.capsule-tabs.capsule-light .capsule-preview-item video {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

.capsule-tabs.capsule-light .capsule-tabs-nav {
    background: white;
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.capsule-tabs.capsule-light .capsule-tab:hover {
    color: var(--primary, #016db7);
}

.capsule-tabs.capsule-light .capsule-tab.active {
    color: var(--primary, #016db7);
}

.capsule-tabs.capsule-light .capsule-tabs-indicator {
    border-color: var(--primary, #016db7);
    box-shadow: 0 0 12px rgba(1, 109, 183, 0.25);
}

/* ---------------------------------------------
   Variant: Reversed (Tabs on Top)
   --------------------------------------------- */
.capsule-tabs.capsule-reversed {
    flex-direction: column-reverse;
}

/* ---------------------------------------------
   Responsive
   --------------------------------------------- */
@media (max-width: 768px) {
    .capsule-preview {
        min-height: 300px;
        height: 350px;
    }
    
    .capsule-tabs-nav {
        flex-wrap: wrap;
        border-radius: 16px;
        padding: 8px;
        gap: 6px;
    }
    
    .capsule-tab {
        padding: 10px 18px;
        font-size: 13px;
        border-radius: 20px;
    }
    
    .capsule-description-item p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .capsule-preview {
        min-height: 250px;
        height: 280px;
    }
    
    .capsule-tab {
        padding: 8px 14px;
        font-size: 12px;
    }
}


/* ---------------------------------------------
   How It Works Section Sizing Integration
   --------------------------------------------- */
/* Heading Size - Tab Buttons */
.how-it-works-section.hiw-heading-sm .capsule-tab { font-size: 13px; }
.how-it-works-section.hiw-heading-md .capsule-tab { font-size: 15px; }
.how-it-works-section.hiw-heading-lg .capsule-tab { font-size: 16px; }
.how-it-works-section.hiw-heading-xl .capsule-tab { font-size: 17px; }

/* Text Size - Description & CTA */
.how-it-works-section.hiw-text-sm .capsule-description-item p,
.how-it-works-section.hiw-text-sm .capsule-cta { font-size: 13px; }

.how-it-works-section.hiw-text-md .capsule-description-item p,
.how-it-works-section.hiw-text-md .capsule-cta { font-size: 15px; }

.how-it-works-section.hiw-text-lg .capsule-description-item p,
.how-it-works-section.hiw-text-lg .capsule-cta { font-size: 17px; }