@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
    --tfsc-topic-color: #f1683a;
    --tfsc-time-color: #f1683a;
}

.tfsc-carousel {
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: relative;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    background: #000;
    color: #eee;
    --tfsc-cta-btn-bg: #eee;
    --tfsc-cta-btn-text: #000;
    --tfsc-cta-btn-border: none;
    --tfsc-cta-btn-shadow: none;
    --tfsc-cta-btn-secondary-bg: transparent;
    --tfsc-cta-btn-secondary-text: #eee;
    --tfsc-cta-btn-secondary-border: 1px solid #fff;
    --tfsc-nav-btn-bg: rgba(238, 238, 238, 0.27);
    --tfsc-nav-btn-color: #fff;
    --tfsc-nav-btn-border: none;
    --tfsc-nav-btn-shadow: none;
    --tfsc-nav-btn-bg-hover: #fff;
    --tfsc-nav-btn-color-hover: #000;
}

/* ── List items ─────────────────────────────────────────────── */
.tfsc-list {
    position: absolute;
    inset: 0;
}

.tfsc-list .tfsc-item {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.tfsc-list .tfsc-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tfsc-list .tfsc-item .tfsc-content {
    position: absolute;
    top: 20%;
    width: 1140px;
    max-width: 80%;
    left: 50%;
    transform: translateX(-50%);
    padding-right: 30%;
    box-sizing: border-box;
    color: #fff;
    text-shadow: 0 5px 10px #0004;
}

.tfsc-list .tfsc-item .tfsc-content.tfsc-glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.tfsc-list .tfsc-item .author {
    font-weight: bold;
    letter-spacing: 10px;
    color: var(--author-color, #fff);
}

.tfsc-list .tfsc-item .title,
.tfsc-list .tfsc-item .topic {
    font-size: 5em;
    font-weight: bold;
    line-height: 1.3em;
}

.tfsc-list .tfsc-item .title {
    color: var(--title-color, #fff);
}

.tfsc-list .tfsc-item .topic {
    color: var(--topic-color, var(--tfsc-topic-color, #f1683a));
    font-size: 1.3em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 5px;
}

.tfsc-list .tfsc-item .des {
    color: var(--desc-color, #fff);
}

.tfsc-list .tfsc-item .tfsc-buttons {
    display: grid;
    grid-template-columns: repeat(2, 130px);
    grid-template-rows: 40px;
    gap: 5px;
    margin-top: 20px;
}

.tfsc-list .tfsc-item .tfsc-buttons button {
    border: var(--tfsc-cta-btn-border, none);
    background-color: var(--tfsc-cta-btn-bg, #eee);
    color: var(--tfsc-cta-btn-text, #000);
    letter-spacing: 3px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: .3s;
    box-shadow: var(--tfsc-cta-btn-shadow, none);
}

.tfsc-list .tfsc-item .tfsc-buttons button:nth-child(2) {
    background-color: var(--tfsc-cta-btn-secondary-bg, transparent);
    border: var(--tfsc-cta-btn-secondary-border, 1px solid #fff);
    color: var(--tfsc-cta-btn-secondary-text, #eee);
}

.tfsc-list .tfsc-item .tfsc-buttons button:hover {
    opacity: 0.85;
}

.tfsc-buttons--glass button {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Thumbnail strip ────────────────────────────────────────── */
.tfsc-thumbnail {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(0);
    width: max-content;
    z-index: 100;
    display: flex;
    gap: 20px;
}

.tfsc-thumbnail .tfsc-thumb-item {
    width: 150px;
    height: 220px;
    flex-shrink: 0;
    position: relative;
}

.tfsc-thumbnail .tfsc-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.tfsc-thumbnail .tfsc-thumb-content {
    color: #fff;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
}

.tfsc-thumbnail .tfsc-thumb-title {
    font-weight: 500;
}

.tfsc-thumbnail .tfsc-thumb-desc {
    font-weight: 300;
}

/* ── Arrows ─────────────────────────────────────────────────── */
.tfsc-arrows {
    position: absolute;
    top: 80%;
    right: 52%;
    z-index: 100;
    width: 300px;
    max-width: 30%;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tfsc-arrows button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--tfsc-nav-btn-bg, rgba(238, 238, 238, 0.27));
    border: var(--tfsc-nav-btn-border, none);
    color: var(--tfsc-nav-btn-color, #fff);
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: .5s;
    box-shadow: var(--tfsc-nav-btn-shadow, none);
}

.tfsc-arrows button:hover {
    background-color: var(--tfsc-nav-btn-bg-hover, #fff);
    color: var(--tfsc-nav-btn-color-hover, #000);
}

.tfsc-arrows--glass button {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ── Progress bar ───────────────────────────────────────────── */
.tfsc-time {
    position: absolute;
    z-index: 1000;
    width: 0%;
    height: 3px;
    background-color: var(--tfsc-time-color, #f1683a);
    left: 0;
    top: 0;
}

/* ── Initial first item ─────────────────────────────────────── */
.tfsc-list .tfsc-item:nth-child(1) {
    z-index: 1;
}

/* Content animation on initial load */
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .author,
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .title,
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .topic,
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .des,
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .tfsc-buttons {
    transform: translateY(50px);
    filter: blur(20px);
    opacity: 0;
    animation: tfsc-showContent .5s 1s linear 1 forwards;
}

@keyframes tfsc-showContent {
    to {
        transform: translateY(0px);
        filter: blur(0px);
        opacity: 1;
    }
}

.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .title    { animation-delay: 1.2s !important; }
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .topic    { animation-delay: 1.4s !important; }
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .des      { animation-delay: 1.6s !important; }
.tfsc-list .tfsc-item:nth-child(1) .tfsc-content .tfsc-buttons { animation-delay: 1.8s !important; }

/* ── Next transition ────────────────────────────────────────── */
.tfsc-carousel.tfsc-next .tfsc-list .tfsc-item:nth-child(1) img {
    width: 150px;
    height: 220px;
    position: absolute;
    bottom: 50px;
    left: 50%;
    border-radius: 30px;
    animation: tfsc-showImage .5s linear 1 forwards;
}

@keyframes tfsc-showImage {
    to {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.tfsc-carousel.tfsc-next .tfsc-thumbnail .tfsc-thumb-item:nth-last-child(1) {
    overflow: hidden;
    animation: tfsc-showThumbnail .5s linear 1 forwards;
}

@keyframes tfsc-showThumbnail {
    from {
        width: 0;
        opacity: 0;
    }
}

.tfsc-carousel.tfsc-next .tfsc-thumbnail {
    animation: tfsc-effectNext .5s linear 1 forwards;
}

@keyframes tfsc-effectNext {
    from {
        transform: translateX(150px);
    }
}

/* ── Prev transition ────────────────────────────────────────── */
.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item img {
    z-index: 100;
}

.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) {
    z-index: 2;
}

.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) img {
    animation: tfsc-outFrame 0.5s linear 1 forwards;
    position: absolute;
    bottom: 0;
    left: 0;
}

@keyframes tfsc-outFrame {
    to {
        width: 150px;
        height: 220px;
        bottom: 50px;
        left: 50%;
        border-radius: 20px;
    }
}

.tfsc-carousel.tfsc-prev .tfsc-thumbnail .tfsc-thumb-item:nth-child(1) {
    overflow: hidden;
    opacity: 0;
    animation: tfsc-showThumbnail .5s linear 1 forwards;
}

.tfsc-carousel.tfsc-next .tfsc-arrows button,
.tfsc-carousel.tfsc-prev .tfsc-arrows button {
    pointer-events: none;
}

.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) .tfsc-content .author,
.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) .tfsc-content .title,
.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) .tfsc-content .topic,
.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) .tfsc-content .des,
.tfsc-carousel.tfsc-prev .tfsc-list .tfsc-item:nth-child(2) .tfsc-content .tfsc-buttons {
    animation: tfsc-contentOut 1.5s linear 1 forwards !important;
}

@keyframes tfsc-contentOut {
    to {
        transform: translateY(-150px);
        filter: blur(20px);
        opacity: 0;
    }
}

/* ── Time bar animation ─────────────────────────────────────── */
.tfsc-carousel.tfsc-next .tfsc-time,
.tfsc-carousel.tfsc-prev .tfsc-time {
    animation: tfsc-runningTime 3s linear 1 forwards;
}

@keyframes tfsc-runningTime {
    from { width: 100%; }
    to   { width: 0; }
}

/* ── Text-only variation ───────────────────────────────────────── */
.tfsc-carousel--text-only {
    background: transparent;
}

.tfsc-carousel--text-only .tfsc-list .tfsc-item {
    background: transparent;
}

.tfsc-carousel--text-only .tfsc-list .tfsc-item img,
.tfsc-carousel--text-only .tfsc-thumbnail {
    display: none !important;
}

.tfsc-carousel--text-only .tfsc-list .tfsc-item .tfsc-content {
    padding-right: 0;
    max-width: 60%;
    text-shadow: none;
}

/* Base styles: fully visible by default so that content is readable if JS fails/is disabled */
.tfsc-carousel--text-only .tfsc-list .tfsc-item .tfsc-content > * {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Disable legacy CSS load animation for text-only (handled exclusively by GSAP) */
.tfsc-carousel--text-only .tfsc-list .tfsc-item:nth-child(1) .tfsc-content .author,
.tfsc-carousel--text-only .tfsc-list .tfsc-item:nth-child(1) .tfsc-content .title,
.tfsc-carousel--text-only .tfsc-list .tfsc-item:nth-child(1) .tfsc-content .topic,
.tfsc-carousel--text-only .tfsc-list .tfsc-item:nth-child(1) .tfsc-content .des {
    animation: none !important;
}

/* Animated State (Applied once JS initializes and prepares the elements) */
.tfsc-carousel--text-only.tfsc-js-ready .tfsc-list .tfsc-item .tfsc-content > * {
    opacity: 0;
    transform: translateY(60px);
    filter: blur(12px);
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
                filter 1.1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, filter;
}

/* Staggered entrance when visible in viewport */
.tfsc-carousel--text-only.tfsc-js-ready.tfsc-animate-in .tfsc-list .tfsc-item .tfsc-content .author {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition-delay: 0.15s;
}

.tfsc-carousel--text-only.tfsc-js-ready.tfsc-animate-in .tfsc-list .tfsc-item .tfsc-content .title {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition-delay: 0.3s;
}

.tfsc-carousel--text-only.tfsc-js-ready.tfsc-animate-in .tfsc-list .tfsc-item .tfsc-content .topic {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition-delay: 0.45s;
}

.tfsc-carousel--text-only.tfsc-js-ready.tfsc-animate-in .tfsc-list .tfsc-item .tfsc-content .des {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition-delay: 0.6s;
}

/* Fluid reverse exit animation when leaving the viewport */
.tfsc-carousel--text-only.tfsc-js-ready.tfsc-animate-out .tfsc-list .tfsc-item .tfsc-content > * {
    opacity: 0;
    transform: translateY(-40px);
    filter: blur(10px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0s;
}

.tfsc-carousel--text-only .tfsc-list .tfsc-item .author {
    letter-spacing: 8px;
}

.tfsc-carousel--text-only .tfsc-list .tfsc-item .title {
    font-size: clamp(2.5rem, 6vw, 4.8rem);
}

.tfsc-carousel--text-only .tfsc-arrows {
    right: 10%;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
    .tfsc-list .tfsc-item .tfsc-content {
        padding-right: 0;
    }
    .tfsc-list .tfsc-item .title {
        font-size: 30px;
    }
}
