/**
 * Aceternity UI Animated Tabs (Vanilla CSS Equivalent)
 * Implements 3D perspective stacked cards, sliding active pill indicator, and hover-peek physics.
 */

:root {
    --aceternity-tabs-perspective: 1000px;
    --aceternity-tabs-duration: 0.55s;
    --aceternity-tabs-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --aceternity-spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Outer Container */
.aceternity-tabs-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* Tab Header Navigation Bar */
.aceternity-tabs-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    width: auto;
    padding: 6px;
    background: rgba(8, 58, 96, 0.05);
    border: 1px solid rgba(8, 58, 96, 0.08);
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    scrollbar-width: none;
    -ms-overflow-style: none;
    perspective: var(--aceternity-tabs-perspective);
    transform-style: preserve-3d;
    box-sizing: border-box;
}

.aceternity-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* Individual Tab Button */
.aceternity-tab-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 9999px;
    border: none;
    outline: none;
    background: transparent;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transform-style: preserve-3d;
    transition: color 0.25s ease;
    z-index: 2;
    text-decoration: none !important;
}

.aceternity-tab-button:hover {
    color: #083a60;
}

.aceternity-tab-button.is-active {
    color: #ffffff;
}

/* Sliding Background Pill */
.aceternity-tab-pill {
    position: absolute;
    top: 6px;
    left: 0;
    height: calc(100% - 12px);
    background: linear-gradient(135deg, #083a60 0%, #155586 100%);
    border-radius: 9999px;
    pointer-events: none;
    z-index: 1;
    transition: transform var(--aceternity-tabs-duration) var(--aceternity-spring-ease),
                width var(--aceternity-tabs-duration) var(--aceternity-spring-ease),
                opacity 0.3s ease;
    box-shadow: 0 4px 14px rgba(8, 58, 96, 0.35);
    will-change: transform, width;
}

/* Alternative Light Mode Pill Variant */
.aceternity-tabs-nav.pill-light .aceternity-tab-pill {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.aceternity-tabs-nav.pill-light .aceternity-tab-button.is-active {
    color: #083a60;
}

/* 3D Cards Viewport (FadeInDiv equivalent) */
.aceternity-tabs-viewport {
    position: relative;
    width: 100%;
    min-height: 440px;
    height: 480px;
    margin-top: 32px;
    perspective: var(--aceternity-tabs-perspective);
    transform-style: preserve-3d;
}

@media (max-width: 768px) {
    .aceternity-tabs-viewport {
        height: 380px;
        min-height: 360px;
        margin-top: 24px;
    }
}

/* Each Card in Stack */
.aceternity-tab-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    box-sizing: border-box;
    overflow: hidden;
    transform-origin: top center;
    box-shadow: 0 25px 50px -12px rgba(8, 58, 96, 0.22),
                0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transition: transform var(--aceternity-tabs-duration) var(--aceternity-ease),
                top var(--aceternity-tabs-duration) var(--aceternity-ease),
                opacity var(--aceternity-tabs-duration) ease,
                filter var(--aceternity-tabs-duration) ease,
                box-shadow var(--aceternity-tabs-duration) ease;
    will-change: transform, top, opacity;
}

/* Active Front Card */
.aceternity-tab-card.is-active {
    z-index: 25;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
    top: 0;
}

/* Animated Entrance Pop for Active Card */
.aceternity-tab-card.just-activated {
    animation: aceternityCardPop 0.6s var(--aceternity-spring-ease) forwards;
}

@keyframes aceternityCardPop {
    0% {
        transform: scale(0.96) translateY(36px);
        opacity: 0.4;
    }
    60% {
        transform: scale(1.01) translateY(-6px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Stacked Behind Cards */
.aceternity-tab-card.stack-depth-1 {
    z-index: 20;
    opacity: 0.9;
    pointer-events: none;
    transform: scale(0.95) translateY(0);
    top: 0;
    filter: brightness(0.92);
}

.aceternity-tab-card.stack-depth-2 {
    z-index: 15;
    opacity: 0.75;
    pointer-events: none;
    transform: scale(0.9) translateY(0);
    top: 0;
    filter: brightness(0.85);
}

.aceternity-tab-card.stack-depth-3 {
    z-index: 10;
    opacity: 0.55;
    pointer-events: none;
    transform: scale(0.85) translateY(0);
    top: 0;
    filter: brightness(0.78);
}

.aceternity-tab-card.stack-hidden {
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(0);
    top: 0;
}

/* Hover-Peek Expansion (Aceternity UI Signature effect) */
.aceternity-tabs-viewport.is-hovering .aceternity-tab-card.stack-depth-1 {
    top: -24px;
    transform: scale(0.96) translateY(0);
    opacity: 0.95;
    filter: brightness(0.96);
}

.aceternity-tabs-viewport.is-hovering .aceternity-tab-card.stack-depth-2 {
    top: -48px;
    transform: scale(0.92) translateY(0);
    opacity: 0.85;
    filter: brightness(0.90);
}

.aceternity-tabs-viewport.is-hovering .aceternity-tab-card.stack-depth-3 {
    top: -70px;
    transform: scale(0.88) translateY(0);
    opacity: 0.7;
    filter: brightness(0.82);
}

/* Card Content Styling Presets */
.aceternity-card-gradient-purple {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 50%, #311042 100%);
    color: #ffffff;
}

.aceternity-card-gradient-teal {
    background: linear-gradient(135deg, #083a60 0%, #0d5c8a 50%, #35b398 100%);
    color: #ffffff;
}

.aceternity-card-gradient-dark {
    background: linear-gradient(135deg, #111827 0%, #1f2937 60%, #0f172a 100%);
    color: #ffffff;
}

.aceternity-card-gradient-blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #38bdf8 100%);
    color: #ffffff;
}

.aceternity-card-gradient-emerald {
    background: linear-gradient(135deg, #064e3b 0%, #059669 60%, #34d399 100%);
    color: #ffffff;
}

/* Card Inner Content Layout */
.aceternity-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 768px) {
    .aceternity-card-inner {
        padding: 24px;
    }
}

.aceternity-card-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
    color: #ffffff;
    letter-spacing: -0.5px;
}

@media (min-width: 768px) {
    .aceternity-card-title {
        font-size: 38px;
    }
}

.aceternity-card-desc {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin-bottom: 24px;
}

/* Dummy Content / Illustrative Image */
.aceternity-card-image {
    position: absolute;
    bottom: -30px;
    right: 5%;
    width: 80%;
    max-height: 65%;
    object-fit: cover;
    object-position: top center;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.5s ease;
}

@media (max-width: 768px) {
    .aceternity-card-image {
        right: 50%;
        transform: translateX(50%);
        width: 90%;
        bottom: -20px;
    }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .aceternity-tab-card,
    .aceternity-tab-pill,
    .aceternity-tab-button {
        transition: none !important;
        animation: none !important;
    }
}
