/* --- Expanding Card Slider Styles --- */

:root {
    --transition-speed: 1.5s;
    --slide-ease: cubic-bezier(0.85, 0, 0.15, 1);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
}

/* Fix for overlapping features section */
.tj-features-section {
    position: relative;
    z-index: 1000 !important;
}

/* Ensure Social Icons stay on top */
.slider_socials {
    z-index: 12000 !important;
}

/* --- The Slider Wrapper --- */
#slide {
    width: max-content;
    height: 100%;
}

/* --- The Individual Cards --- */
.item {
    width: 200px;
    height: 300px;
    background-position: 50% 50%;
    display: inline-block;
    
    /* REMOVED box-shadow from transition to stop vibration */
    transition: width var(--transition-speed) var(--slide-ease),
                height var(--transition-speed) var(--slide-ease),
                left var(--transition-speed) var(--slide-ease),
                top var(--transition-speed) var(--slide-ease),
                border-radius var(--transition-speed) var(--slide-ease),
                opacity var(--transition-speed) var(--slide-ease),
                transform var(--transition-speed) var(--slide-ease);
                
    background-size: cover;
    position: absolute;
    z-index: 1;
    top: 50%;
    
    /* GPU Acceleration: Use translate3d instead of translate */
    transform: translate3d(0, -50%, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: width, height, left, top; /* Hint to browser */

    border-radius: 20px;
    box-shadow: 0 30px 50px rgba(0,0,0,0.5);
    left: calc(50% + 110px);
}

/* State 1 & 2: Full Screen Background */
.item:nth-child(1),
.item:nth-child(2) {
    left: 0;
    top: 0;
    /* Reset using 3D transform */
    transform: translate3d(0, 0, 0);
    border-radius: 0;
    width: 100%;
    height: 100%;
    box-shadow: none;
    z-index: 0; 
}

/* Overlay for readability */
.item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.item:nth-child(1)::after,
.item:nth-child(2)::after {
    opacity: 1;
}


/* State 3, 4, 5...: Thumbnails */
.item:nth-child(3) {
    left: 50%;
    z-index: 20; 
}
.item:nth-child(4) {
    left: calc(50% + 220px);
    z-index: 19;
}
.item:nth-child(5) {
    left: calc(50% + 440px);
    z-index: 18;
}
/* Hidden state for smoother rotation */
.item:nth-child(n+6) {
    left: calc(50% + 660px);
    opacity: 0;
    z-index: 17;
}

/* --- Content Text Animation --- */
.content {
    position: absolute;
    top: 50%;
    left: 100px;
    width: 600px;
    text-align: left;
    padding: 0;
    color: #eee;
    transform: translate(0, -50%);
    z-index: 30;
    /* Default Hidden State for ALL cards (prevents flying text) */
    opacity: 0;
    visibility: hidden; 
}

/* Only the active (2nd) item's content becomes visible */
.item:nth-child(2) .content {
    opacity: 1;
    visibility: visible;
}

/* Initial State for Text Elements: Invisible & Shifted Down */
.item .content .sub-title,
.item .content .main-title,
.item .content .description,
.item .content .cta-group {
    opacity: 0;
    transform: translateY(50px);
}

/* Animation Trigger for Active Card */
/* Delay must match transition-speed (1.5s) to ensure card stops moving first */
.item:nth-child(2) .content .sub-title {
    animation: showcontent 0.8s ease-in-out 1.5s 1 forwards;
}

.item:nth-child(2) .content .main-title {
    font-family: var(--tj-ff-heading, 'Montserrat', sans-serif);
    font-size: 80px;
    line-height: 1.1;
    margin-bottom: 30px;
    color: white;
    font-weight: 700;
    animation: showcontent 0.8s ease-in-out 1.6s 1 forwards;
}

.item:nth-child(2) .content .description {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
    margin-bottom: 40px;
    max-width: 500px;
    animation: showcontent 0.8s ease-in-out 1.7s 1 forwards;
}

.item:nth-child(2) .content .cta-group {
    animation: showcontent 0.8s ease-in-out 1.8s 1 forwards;
}

/* Define the Animation */
@keyframes showcontent {
    0% {
        opacity: 0;
        transform: translateY(50px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.content .sub-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 25px;
    color: #eb5fc1;
    font-weight: 600;
}

/* --- Card Inner Text (Small cards) --- */
.item .card-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    opacity: 1;
    transition: opacity 1s;
    z-index: 35; 
    font-family: var(--tj-ff-heading, 'Montserrat', sans-serif);
}

.item:nth-child(1) .card-content,
.item:nth-child(2) .card-content {
    opacity: 0; 
}

.card-content h3 {
    text-transform: uppercase;
    font-size: 1.2rem;
    font-weight: 700;
}

/* --- Controls --- */
.buttons {
    position: absolute;
    top: calc(50% + 170px); /* Just below the 300px tall thumbnails */
    left: 50%;
    z-index: 222222;
    display: flex;
    gap: 20px;
}

.buttons button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(255,255,255,0.05);
    color: #fff;
    transition: 0.3s;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.buttons button:hover {
    background-color: #eb5fc1;
    border-color: #eb5fc1;
    color: #fff;
}

/* Disabled State */
.buttons button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: rgba(255,255,255,0.05); /* Reset hover if stuck */
    border-color: rgba(255,255,255,0.1);
}

/* Pagination */
.pagination-num {
    position: absolute;
    bottom: 50px;
    right: 5%;
    color: white;
    font-size: 6rem;
    font-weight: 800;
    opacity: 0.1;
    line-height: 1;
    z-index: 5;
    pointer-events: none;
    font-family: var(--tj-ff-heading, 'Montserrat', sans-serif);
}

/* --- RESPONSIVE --- */

@media (max-width: 1200px) {
    .item:nth-child(2) .content .main-title { font-size: 60px; }
    .item { width: 180px; height: 260px; }
    .item:nth-child(3) { left: 50%; }
    .item:nth-child(4) { left: calc(50% + 200px); }
    .item:nth-child(5) { left: calc(50% + 400px); }
    .buttons { left: 40px; }
    .pagination-num { font-size: 4rem; }
}

@media (max-width: 991px) {
    .content { left: 50px; width: 80%; }
    .item:nth-child(2) .content .main-title { font-size: 42px; }
    .item:nth-child(2) .content .description { font-size: 16px; }
    
    .item { width: 140px; height: 200px; }
    .item:nth-child(3) { left: 60%; }
    .item:nth-child(4) { left: calc(60% + 160px); }
    .item:nth-child(5) { display: none; }
    
    .buttons { 
        left: 50%; 
        transform: translateX(-50%); 
        bottom: 30px; 
    }
    .pagination-num { display: none; }
}

@media (max-width: 576px) {
    /* 1. Content (Text & Button) - Lowered to clear navbar */
    .content { 
        top: 40%; /* Pushed down from 25% */
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%; 
        text-align: center;
        z-index: 100;
    }
    .content .sub-title {
        justify-content: center;
        font-size: 12px;
        margin-bottom: 10px;
    }
        .item:nth-child(2) .content .main-title { 
            font-size: 38px; /* Increased from 28px */
            margin-bottom: 15px;
        }
        .item:nth-child(2) .content .description { 
            margin: 0 auto 20px; 
            font-size: 15px; /* Slightly increased */
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 4; /* More lines */
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        /* --- Card Inner Text (Thumbnails on mobile) --- */
        .item .card-content h3 {
            font-size: 0.8rem; /* Significantly smaller for thumbnails */
            font-weight: 700;
            margin: 0;
        }
        .item .card-content {
            bottom: 10px;
            left: 10px;
        }    
    /* 2. Thumbnails (Deck) - Larger & Smoother Transition */
    .item { 
        width: 130px; /* Increased size */
        height: 190px; 
        border-radius: 12px;
    }
    
    /* Active Background */
    .item:nth-child(1),
    .item:nth-child(2) {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    /* Thumbnail 1: Left */
    .item:nth-child(3) { 
        left: calc(50% - 70px); /* Tighter spacing */
        top: 72%; 
        transform: translate3d(-50%, -50%, 0);
        opacity: 1;
        z-index: 20;
    }
    
    /* Thumbnail 2: Right */
    .item:nth-child(4) { 
        left: calc(50% + 70px); 
        top: 72%;
        transform: translate3d(-50%, -50%, 0);
        opacity: 1; 
        z-index: 19;
        display: block;
    }
    
    /* FIX: The "Exit" Slide (Position 5) */
    /* Must be DISPLAY: BLOCK (not none) to allow smooth fade out */
    .item:nth-child(5) { 
        display: block; 
        left: calc(50% + 200px); /* Move further right */
        top: 72%;
        transform: translate3d(-50%, -50%, 0);
        opacity: 0; /* Fade out smoothly */
        z-index: 18;
        pointer-events: none;
    }
    
    /* Deep Storage (Position 6+) */
    .item:nth-child(n+6) { 
        opacity: 0;
        z-index: 1;
    }
    
    /* 3. Navigation Buttons */
    .buttons {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        gap: 15px;
    }
    
    .slider_socials {
        display: none !important;
    }
}