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

/* Home Wrapper - Constrained to max-width and centered horizontally in main column */
.kt-home-wrapper {
    width: 100%;
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
}

.kt-home-hero-swiper {
    width: 100%;
    min-height: 380px;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    margin-bottom: 20px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
    background-color: #0d1420;
}

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

/* Background image layer */
.kt-hero-slide-bg {
    position: absolute;
    inset: -15px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    filter: blur(8px) saturate(1.1);
    opacity: 0.85;
    transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(1.06);
}

.has-custom-banner .kt-hero-slide-bg {
    filter: none;
    opacity: 0.95;
    background-position: center right;
}

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

/* Gradient overlay with radial warm ambient glow */
.kt-hero-slide-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(9, 15, 26, 0.94) 0%, rgba(9, 15, 26, 0.82) 42%, rgba(9, 15, 26, 0.45) 72%, rgba(9, 15, 26, 0.25) 100%),
        radial-gradient(120% 120% at 88% 12%, rgba(var(--c-primary-rgb), 0.22), transparent 55%);
    z-index: 2;
}

.dark-mode .kt-hero-slide-overlay {
    background:
        linear-gradient(100deg, rgba(7, 11, 20, 0.96) 0%, rgba(7, 11, 20, 0.85) 42%, rgba(7, 11, 20, 0.5) 72%, rgba(7, 11, 20, 0.3) 100%),
        radial-gradient(120% 120% at 88% 12%, rgba(var(--c-primary-rgb), 0.18), transparent 55%);
}

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

.kt-hero-slide-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(0, 0.62fr);
    gap: 36px;
    align-items: center;
}

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

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

.kt-hero-badge-featured {
    display: inline-flex;
    align-items: center;
    background: var(--c-primary-gradient);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 8px var(--c-primary-glow);
}

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

.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.16);
    color: rgba(255, 255, 255, 0.88);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 999px;
    text-decoration: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    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.4rem, 2.8vw, 2.2rem);
    font-weight: 800;
    line-height: 1.18;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

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

.kt-hero-slide-title a:hover {
    color: #ffd9b8 !important;
}

.kt-hero-slide-desc {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13.5px;
    line-height: 1.55;
    margin: 0 0 14px;
    max-width: 580px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kt-hero-slide-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
}

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

.kt-hero-meta-item i {
    color: var(--c-primary);
    font-size: 13px;
}

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

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

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

.kt-hero-btn-read {
    background: var(--c-btn-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--c-primary-glow);
}

.kt-hero-btn-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--c-primary-glow);
    filter: brightness(1.06);
}

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

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

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

.kt-hero-poster-card {
    position: relative;
    width: min(210px, 100%);
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transform: rotate(1.4deg);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    background: #0d1420;
}

.kt-hero-poster-card:hover {
    transform: rotate(0deg) translateY(-4px) scale(1.02);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.65), 0 0 0 2px var(--c-primary);
}

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

/* Navigation Buttons */
.kt-hero-swiper-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(9, 15, 26, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    z-index: 10;
    cursor: pointer;
    transition: all 0.25s ease;
}

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

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

.kt-hero-swiper-btn:hover {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 18px var(--c-primary-glow);
}

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

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

.kt-hero-swiper-pagination .swiper-pagination-bullet-active {
    width: 44px;
    background: var(--c-primary);
    box-shadow: 0 0 10px var(--c-primary-glow);
}

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

.home-hero-bg {
    position: absolute;
    inset: -15px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    filter: blur(8px) brightness(0.75);
    opacity: 0.85;
    transition: transform 0.6s ease;
}

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

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(16, 16, 20, 0.88) 0%, rgba(16, 16, 20, 0.7) 48%, rgba(16, 16, 20, 0.25) 100%);
    z-index: -1;
}

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

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    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: 4px 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 12px;
    width: fit-content;
}

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

.home-hero-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 10px;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.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: #cbd5e1;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    margin: 0 0 16px;
    max-width: 520px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.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-primary-gradient);
    height: 44px;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
    margin-bottom: 22px;
    box-shadow: 0 4px 14px var(--c-primary-glow);
}

.home-hero-marquee-track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: home-hero-marquee-scroll 34s 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 24px;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    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: 13px;
    color: #ffffff;
    flex-shrink: 0;
}

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

/* 3. DISPLAY MODE TOOLBAR (WebNovelify Segmented Bar) */
.kt-mode-toolbar {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.kt-mode-toolbar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-ink-48, #64748b);
}

.kt-mode-segment {
    display: inline-flex;
    align-items: center;
    background: var(--c-canvas, #ffffff);
    border: 1px solid var(--c-hairline, rgba(0, 0, 0, 0.08));
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark-mode .kt-mode-segment {
    background: #161e2a;
    border-color: rgba(255, 255, 255, 0.1);
}

.kt-view-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-ink-48, #64748b);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap !important;
    line-height: 1;
}

.kt-view-mode-btn:hover:not(.active) {
    color: var(--c-ink-88, #18191b);
}

.dark-mode .kt-view-mode-btn:hover:not(.active) {
    color: #f1f5f9;
}

.kt-view-mode-btn.active {
    background: #12202f;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(18, 32, 47, 0.25);
}

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

/* Section Title & View All Header styling */
.kt-section-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--c-hairline, rgba(0, 0, 0, 0.06));
    padding-bottom: 10px;
}

.kt-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--c-ink-88, #18191b);
    letter-spacing: -0.01em;
}

.dark-mode .kt-section-title {
    color: #f1f5f9;
}

.kt-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
}

.kt-section-icon-fire { color: #f26522; filter: drop-shadow(0 2px 6px rgba(242, 101, 34, 0.35)); }
.kt-section-icon-clock { color: #ff9800; }
.kt-section-icon-check { color: var(--c-primary); }
.kt-section-icon-default { color: var(--c-primary); }

.kt-section-view-all {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-ink-48, #64748b);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease;
}

.kt-section-view-all:hover {
    color: var(--c-primary);
}

@media (max-width: 575.98px) {
    .kt-mode-toolbar {
        margin-bottom: 14px;
    }
    .kt-view-mode-btn {
        padding: 0 9px;
        font-size: 12px;
        height: 28px;
    }
}

/* 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: 1199px) {
    .kt-home-hero-swiper,
    .kt-hero-slide,
    .home-hero {
        min-height: 350px;
        height: 370px;
    }
    .kt-hero-slide-container,
    .home-hero-content {
        padding: 24px 36px;
    }
    .kt-hero-slide-grid {
        grid-template-columns: 1fr 140px;
        gap: 24px;
    }
    .kt-hero-poster-card {
        width: 140px;
    }
}

@media (max-width: 991px) {
    .kt-home-hero-swiper,
    .kt-hero-slide,
    .home-hero {
        min-height: 320px;
        height: 340px;
    }
    .kt-hero-slide-container,
    .home-hero-content {
        padding: 20px 24px;
    }
    .kt-hero-slide-grid {
        grid-template-columns: 1fr 125px;
        gap: 20px;
    }
    .kt-hero-poster-card {
        width: 125px;
    }
}

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

    .kt-hero-slide-container {
        padding: 20px 16px 36px;
    }

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

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

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

    .kt-hero-slide-desc {
        font-size: 12.5px;
        line-height: 1.5;
        margin-bottom: 12px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

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

    .kt-hero-btn {
        height: 34px;
        padding: 0 16px;
        font-size: 12px;
    }

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

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

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

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

    .home-hero-desc {
        font-size: 12.5px;
        margin-bottom: 14px;
    }

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

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

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

    .home-hero-marquee-item {
        font-size: 11.5px;
        padding: 0 14px;
    }

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