/* ==========================================================================
   KhoTruyen Home Page Stylesheet (v3.2.0)
   Hero Banner, Infinite Marquee, View Mode Switcher, Partner Banners
   ========================================================================== */

/* ==========================================================================
   1. HOME HERO SWIPER SLIDER SECTION
   ========================================================================== */
.kt-home-hero-swiper {
    width: 100%;
    min-height: 480px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    margin-bottom: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    background-color: #121214;
}

.kt-hero-slide {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #ffffff;
    box-sizing: border-box;
}

/* Background image layer */
.kt-hero-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    z-index: 1;
    transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(1.0);
}

.swiper-slide-active .kt-hero-slide-bg {
    transform: scale(1.04);
}

/* Gradient overlay - Crisp background with clear text readability */
.kt-hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #101014f5 0%, #101014db 32%, rgba(16, 16, 20, 0.45) 65%, rgba(16, 16, 20, 0.12) 100%),
                linear-gradient(to top, rgba(16, 16, 20, 0.6) 0%, transparent 40%);
    z-index: 2;
}

.dark-mode .kt-hero-slide-overlay {
    background: linear-gradient(90deg, #0d0d10f8 0%, #0d0d10e0 32%, rgba(13, 13, 16, 0.5) 65%, rgba(13, 13, 16, 0.15) 100%),
                linear-gradient(to top, rgba(13, 13, 16, 0.7) 0%, transparent 40%);
}

/* Slide Container */
.kt-hero-slide-container {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 48px 56px;
    box-sizing: border-box;
}

.kt-hero-slide-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 48px;
    align-items: center;
}

/* Left Column Info */
.kt-hero-slide-info {
    display: flex;
    flex-direction: column;
    max-width: 680px;
}

.kt-hero-badges-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.kt-hero-badge-featured {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff4500, #ff8c00);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.4);
}

.kt-hero-badge-status {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.kt-hero-badge-genre {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.kt-hero-badge-genre:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.kt-hero-slide-title {
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.kt-hero-slide-title a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.kt-hero-slide-title a:hover {
    color: var(--c-primary, #ff7a00) !important;
}

.kt-hero-slide-desc {
    color: #e2e8f0;
    font-size: 14.5px;
    line-height: 1.65;
    margin: 0 0 20px;
    max-width: 580px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.kt-hero-slide-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.8);
}

.kt-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kt-hero-meta-item i {
    color: var(--c-primary, #ff7a00);
}

.kt-hero-meta-item strong {
    color: #ffffff;
}

/* CTA Actions */
.kt-hero-slide-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.kt-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kt-hero-btn-read {
    background: var(--c-btn-gradient, linear-gradient(135deg, #ff7a00, #ff4500));
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.4);
}

.kt-hero-btn-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 122, 0, 0.5);
    filter: brightness(1.08);
}

.kt-hero-btn-details {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
}

.kt-hero-btn-details:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Right Column: Floating Poster Card */
.kt-hero-slide-poster {
    display: flex;
    justify-content: center;
    align-items: center;
}

.kt-hero-poster-card {
    position: relative;
    width: 200px;
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: #1a1a1e;
}

.kt-hero-poster-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 26px 45px rgba(0, 0, 0, 0.65), 0 0 0 2px var(--c-primary, #ff7a00);
}

.kt-hero-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kt-hero-poster-glass {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.kt-hero-poster-card:hover .kt-hero-poster-glass {
    opacity: 1;
}

.kt-hero-poster-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--c-primary, #ff7a00);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transform: scale(0.85);
    transition: transform 0.25s ease;
}

.kt-hero-poster-card:hover .kt-hero-poster-play {
    transform: scale(1);
}

/* Navigation Buttons */
.kt-hero-swiper-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 20, 24, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    cursor: pointer;
    transition: all 0.25s ease;
}

.kt-hero-swiper-prev {
    left: 18px;
}

.kt-hero-swiper-next {
    right: 18px;
}

.kt-hero-swiper-btn:hover {
    background: var(--c-primary, #ff7a00);
    border-color: var(--c-primary, #ff7a00);
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 18px rgba(255, 122, 0, 0.4);
}

/* Pagination Bullets */
.kt-hero-swiper-pagination {
    position: absolute;
    bottom: 18px !important;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.kt-hero-swiper-pagination .swiper-pagination-bullet {
    width: 20px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.35);
    margin: 0 !important;
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.kt-hero-swiper-pagination .swiper-pagination-bullet-active {
    width: 38px;
    background: var(--c-primary, #ff7a00);
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.6);
}

/* Fallback static hero */
.home-hero {
    border-radius: 18px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 480px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    transition: transform 0.6s ease;
}

.home-hero:hover .home-hero-bg {
    transform: scale(1.02);
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #141414f0 0%, #141414cc 40%, #14141466 75%, #14141433 100%);
    z-index: -1;
}

.home-hero-content {
    max-width: 680px;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 18px;
    width: fit-content;
}

.home-hero-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d9ff43;
    box-shadow: 0 0 10px #d9ff43;
    flex-shrink: 0;
}

.home-hero-title {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 14px;
    color: #ffffff;
    letter-spacing: -0.8px;
}

.home-hero-title-accent {
    background: var(--c-hero-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.home-hero-desc {
    color: #d3d0c8;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 520px;
}

.home-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.home-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 26px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.home-hero-btn-primary {
    background: var(--c-hero-accent);
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(255, 68, 0, 0.35);
}

/* 2. INFINITE MARQUEE ANNOUNCEMENT RIBBON */
.home-hero-marquee {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    background: var(--c-hero-accent, linear-gradient(135deg, #ff7a00, #ff4500));
    height: 48px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(255, 122, 0, 0.25);
}

.home-hero-marquee-track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: home-hero-marquee-scroll 45s linear infinite;
    will-change: transform;
}

.home-hero-marquee:hover .home-hero-marquee-track {
    animation-play-state: paused;
}

.home-hero-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 28px;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-decoration: none !important;
}

.home-hero-marquee-item:hover {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.home-hero-marquee-icon {
    font-size: 16px;
    color: #ffd700;
    flex-shrink: 0;
}

@keyframes home-hero-marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 3. DISPLAY MODE TOOLBAR */
.kt-mode-toolbar {
    background: var(--c-canvas);
    border: 1px solid var(--c-hairline);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.kt-view-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap !important;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease;
}

.kt-view-mode-btn.active {
    background: #0f0f0f;
    color: #ffffff;
}

.dark-mode .kt-view-mode-btn.active {
    background: #ffffff;
    color: #0f0f0f;
}

@media (max-width: 575.98px) {
    .kt-mode-toolbar {
        padding: 8px 12px;
        margin-bottom: 16px;
    }
    .kt-view-mode-btn {
        padding: 5px 10px;
        font-size: 12px;
        gap: 5px;
    }
}

/* 4. PARTNER / ADS ROW BANNER */
.partner-banner {
    width: 100%;
    margin: 28px 0;
}

.partner-banner-inner {
    display: flex;
    align-items: center;
    background: #1b1b1b;
    border-radius: 14px;
    padding: 20px 24px;
    gap: 32px;
    overflow: hidden;
    position: relative;
}

.partner-banner-heading {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.partner-banner-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Responsive Home Adjustments */
@media (max-width: 991px) {
    .kt-hero-slide-container {
        padding: 40px 36px;
    }
    .kt-hero-slide-grid {
        grid-template-columns: 1fr 180px;
        gap: 32px;
    }
    .kt-hero-poster-card {
        width: 170px;
    }
}

@media (max-width: 768px) {
    .kt-home-hero-swiper,
    .kt-hero-slide {
        min-height: 400px;
        border-radius: 16px;
    }

    .kt-hero-slide-container {
        padding: 28px 20px 44px;
    }

    .kt-hero-slide-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .kt-hero-slide-poster {
        display: none;
    }

    .kt-hero-slide-title {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .kt-hero-slide-desc {
        font-size: 13px;
        line-height: 1.55;
        margin-bottom: 16px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .kt-hero-slide-meta {
        font-size: 12.5px;
        gap: 14px;
        margin-bottom: 18px;
    }

    .kt-hero-btn {
        height: 38px;
        padding: 0 18px;
        font-size: 13px;
    }

    .kt-hero-swiper-btn {
        display: none;
    }

    .home-hero {
        min-height: 380px;
        border-radius: 14px;
    }

    .home-hero-content {
        padding: 24px 20px;
        max-width: 100%;
    }

    .home-hero-title {
        font-size: 24px;
    }

    .home-hero-desc {
        font-size: 13.5px;
        margin-bottom: 20px;
    }

    .home-hero-stats {
        gap: 16px;
        margin-bottom: 20px;
    }

    .home-hero-stat-value {
        font-size: 22px;
    }

    .home-hero-marquee {
        height: 38px;
        border-radius: 8px;
    }

    .home-hero-marquee-item {
        font-size: 12px;
        padding: 0 16px;
    }

    .partner-banner-inner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 18px;
    }
}
