@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;
}

/* ── 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: none;
    background-color: #eee;
    letter-spacing: 3px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: .3s;
}

.tfsc-list .tfsc-item .tfsc-buttons button:nth-child(2) {
    background-color: transparent;
    border: 1px solid #fff;
    color: #eee;
}

.tfsc-list .tfsc-item .tfsc-buttons button:hover {
    opacity: 0.85;
}

/* ── 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: #eee4;
    border: none;
    color: #fff;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: .5s;
}

.tfsc-arrows button:hover {
    background-color: #fff;
    color: #000;
}

/* ── 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; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
    .tfsc-list .tfsc-item .tfsc-content {
        padding-right: 0;
    }
    .tfsc-list .tfsc-item .title {
        font-size: 30px;
    }
}
