/* ======= Modern Carousel & Tops ======= */

.carousel {
    margin-bottom: 2rem;
}

.carousel-tops {
    padding: 0;
    margin-bottom: 0;
    height: 100%;
}

.carousel-tops .carousel-inner {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    height: 100%;
}

.carousel-tops .carousel-inner:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.carousel-item {
    position: relative;
    max-height: 480px;
    min-height: 320px;
    background-color: var(--bg-secondary);
    height: 100%;
}

.carousel-item>img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-tops .carousel-inner:hover .carousel-item>img {
    transform: scale(1.03);
}

/* Detail Banner Carousel & Swipe Series */
.carousel-item.item-sm {
    height: 380px;
    min-height: 380px;
    max-height: 380px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.carousel-item.item-sm .swipeSeriesPicture,
.carousel-item.item-sm > div.first-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
}

.carousel-item.item-sm .swipeSeriesPicture.activeSwipe,
.carousel-item.item-sm > div.first-slide.activeSwipe {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
    transform: translate3d(0, 0, 0);
}

/* Swipe Series Keyframe Animations (Pure smooth slide without scale distortion) */
@keyframes swipeSlideInRight {
    0% {
        transform: translate3d(100%, 0, 0);
        opacity: 0.85;
    }
    100% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

@keyframes swipeSlideOutLeft {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
    100% {
        transform: translate3d(-100%, 0, 0);
        opacity: 0.85;
    }
}

@keyframes swipeSlideInLeft {
    0% {
        transform: translate3d(-100%, 0, 0);
        opacity: 0.85;
    }
    100% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

@keyframes swipeSlideOutRight {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
    100% {
        transform: translate3d(100%, 0, 0);
        opacity: 0.85;
    }
}

.swipe-anim-in-right {
    animation: swipeSlideInRight 0.38s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    z-index: 4 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.swipe-anim-out-left {
    animation: swipeSlideOutLeft 0.38s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    z-index: 3 !important;
    visibility: visible !important;
    pointer-events: none !important;
}

.swipe-anim-in-left {
    animation: swipeSlideInLeft 0.38s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    z-index: 4 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.swipe-anim-out-right {
    animation: swipeSlideOutRight 0.38s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    z-index: 3 !important;
    visibility: visible !important;
    pointer-events: none !important;
}

/* Swipe Series Navigation Arrows */
.swipeSeries {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.swipeSeries i {
    pointer-events: auto;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
}

.swipeSeries i:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(255, 255, 255, 0.85);
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.swipeSeries i:active {
    transform: scale(0.92);
}

/* Swipe Series Indicators (Pill Dots) */
.swipeSeries-indicators {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 14;
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 5px 12px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.swipeSeries-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    border: none;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.swipeSeries-dot:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

.swipeSeries-dot.active {
    width: 24px;
    background-color: var(--custom2-color, #ea4242);
    box-shadow: 0 0 10px color-mix(in srgb, var(--custom2-color, #ea4242) 60%, transparent);
}

/* Copyright Badge on Detail Banner */
.carousel-copyright-bg {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
    padding: 1.5rem 1rem 0.5rem 1rem;
}

.carousel-copyright {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    margin: 0;
}

.carousel-copyright p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.85) !important;
}

.carousel-caption-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 55%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4.5rem 2.25rem 2rem 2.25rem;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, 0.12) 18%,
        rgba(15, 23, 42, 0.4) 38%,
        rgba(15, 23, 42, 0.72) 65%,
        rgba(15, 23, 42, 0.92) 85%,
        rgba(15, 23, 42, 0.98) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.15) 18%,
        rgba(0, 0, 0, 0.55) 42%,
        rgba(0, 0, 0, 0.9) 70%,
        rgba(0, 0, 0, 1) 100%
    );
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.15) 18%,
        rgba(0, 0, 0, 0.55) 42%,
        rgba(0, 0, 0, 0.9) 70%,
        rgba(0, 0, 0, 1) 100%
    );
}

.carousel-caption {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 10;
    padding: 0;
    width: 100%;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.carousel-caption h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 0.5rem;
}

.carousel-caption p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88) !important;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .carousel-item {
        max-height: 340px;
        min-height: 240px;
    }

    .carousel-item>img {
        height: 340px;
    }

    .carousel-item.item-sm {
        height: 260px;
        min-height: 260px;
        max-height: 260px;
    }

    .carousel-item.item-sm .swipeSeriesPicture,
    .carousel-item.item-sm > div.first-slide {
        min-height: unset;
    }

    .carousel-caption-bg {
        padding: 3rem 1.25rem 1.25rem 1.25rem;
        min-height: 60%;
    }

    .carousel-caption h2 {
        font-size: 1.35rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }
}

/* Carousel Indicators (Pill Style with Custom2 Accent) */
.carousel-indicators {
    margin-bottom: 1.25rem;
    gap: 0.5rem;
    z-index: 20;
}

.carousel-indicators [data-bs-target],
.carousel-indicators button,
.carousel-indicators li {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    border: none;
    background-color: rgba(255, 255, 255, 0.45);
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.carousel-indicators [data-bs-target].active,
.carousel-indicators button.active,
.carousel-indicators li.active {
    width: 24px;
    height: 8px;
    border-radius: var(--radius-pill);
    background-color: var(--custom2-color) !important;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px color-mix(in srgb, var(--custom2-color) 40%, transparent);
}