/* Comparison Tabs and Cards Layout */
.comparison-section {
    position: relative;
    padding: 4rem 0;
    scroll-margin-top: 80px; /* For smooth scrolling */
}

/* Tabs styling */
.comparison-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0 2.5rem 0;
    position: relative;
    z-index: 25;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, opacity;
}

.comparison-tab {
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.comparison-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.comparison-tab.active {
    background: linear-gradient(90deg, #3730a3, #4f46e5);
    box-shadow: 0 8px 15px -3px rgba(79, 70, 229, 0.4);
}

/* Card styles */
.comparison-cards-container {
    margin-top: 1.5rem;
    position: relative;
    min-height: 460px; /* Prevent layout shifts when switching cards */
}

.comparison-card {
    display: none;
    opacity: 0;
    transition: all 0.4s ease-out;
    margin-bottom: 0;
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
}

.comparison-card.active {
    display: block;
    opacity: 1;
    animation: fadeInCard 0.5s forwards;
    position: relative;
}

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

/* Hide card preview in tab mode */
.comparison-card .card-preview {
    display: none;
}

/* Enhance tabs with indicators */
.comparison-tab {
    position: relative;
}

.comparison-tab.active:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #3730a3;
}

/* Ensure smooth transitions */
.comparison-content {
    background-color: white;
    border-radius: 1.5rem;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.08), 0 5px 15px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(229, 231, 235, 0.5);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Mobile styles */
@media (max-width: 768px) {
    .comparison-tabs {
        gap: 0.5rem;
        overflow-x: auto;
        padding: 0.5rem;
        padding-bottom: 1.25rem;
        justify-content: flex-start;
        position: sticky;
        top: 0;
        z-index: 30;
        background: rgba(252, 253, 255, 0.95);
        backdrop-filter: blur(8px);
        margin: 0 -1rem;
        width: calc(100% + 2rem);
        border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    }
    
    .comparison-tab {
        padding: 0.65rem 1rem;
        font-size: 0.75rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .comparison-tab.active:after {
        bottom: -8px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid #3730a3;
    }
    
    .comparison-cards-container {
        margin-top: 0.5rem;
    }
    
    .comparison-side {
        padding: 1.5rem;
    }
    
    .vs-badge {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }
    
    .compare-label {
        font-size: 0.8rem;
        padding: 0.4rem 1.5rem;
    }
}
