/* iQIYI Style Reconstruction - Core Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Righteous&display=swap');

:root {
    --iqiyi-green: #20bc22;
    --iqiyi-green-hover: #1ca51e;
    --iqiyi-bg: #111111;
    --iqiyi-card-bg: #1a1a1a;
    --iqiyi-text: #ffffff;
    --iqiyi-text-muted: #999999;
    --iqiyi-nav-height: 64px;
    --iqiyi-radius: 12px;
    --iqiyi-glow: 0 0 15px rgba(32, 188, 34, 0.3);
}

body {
    background-color: var(--iqiyi-bg);
    color: var(--iqiyi-text);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding-top: var(--iqiyi-nav-height);
    overflow-x: hidden;
}

/* Header & Navigation */
header.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--iqiyi-nav-height);
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

header.sidebar .container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.modern-logo {
    display: flex;
    align-items: center;
    margin-right: 30px;
    text-decoration: none !important;
}

.modern-logo .logo-icon {
    width: 32px;
    height: 32px;
    color: var(--iqiyi-green);
    filter: drop-shadow(0 0 5px rgba(32, 188, 34, 0.5));
}

.modern-logo .logo-text {
    font-family: 'Righteous', cursive;
    font-size: 24px;
    color: var(--iqiyi-text);
    margin-left: 10px;
    letter-spacing: 1px;
}

/* Search Bar iQIYI Style */
.form-search {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.form-search .input-group {
    background: #2a2a2a;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    padding: 2px 5px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.form-search .input-group:focus-within {
    border-color: var(--iqiyi-green);
    background: #333;
}

.form-search input.keyword {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 15px;
    width: 100%;
    outline: none !important;
    box-shadow: none !important;
}

.form-search .btn-search {
    background: transparent;
    border: none;
    color: var(--iqiyi-text-muted);
    padding: 0 15px;
}

.form-search .btn-search:hover {
    color: var(--iqiyi-green);
}

/* Nav Links */
.nav-main {
    margin: 0;
}

.nav-main .header-links ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-main .header-links ul li a {
    color: var(--iqiyi-text);
    text-decoration: none;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    opacity: 0.8;
}

.nav-main .header-links ul li a:hover,
.nav-main .header-links ul li a.active {
    color: var(--iqiyi-green);
    opacity: 1;
}

/* User Profile */
.user {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.user a {
    color: var(--iqiyi-text);
    text-decoration: none;
    font-size: 14px;
}

/* Hero Carousel Placeholder Area */
.home-hero {
    height: 400px;
    width: 100%;
    position: relative;
    background: #000;
    margin-bottom: 40px;
    border-radius: var(--iqiyi-radius);
    overflow: hidden;
}

/* Video Cards */
.video-item {
    background: transparent;
    border-radius: var(--iqiyi-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    margin-bottom: 5px;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--iqiyi-glow);
}

.featured-content-image {
    position: relative;
    padding-bottom: 150% !important;
    height: 0 !important;
    width: 100%;
    border-radius: var(--iqiyi-radius);
    overflow: hidden;
}

.featured-content-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease;
    display: block;
}

.video-item:hover .featured-content-image img {
    transform: scale(1.05);
}

.link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
}

.video-item:hover .link-overlay {
    opacity: 1;
}

.entry-title {
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.entry-title a {
    color: var(--iqiyi-text);
    text-decoration: none !important;
}

.entry-title a:hover {
    color: var(--iqiyi-green);
}

/* Category Sections */
.category-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-left: 4px solid var(--iqiyi-green);
    padding-left: 15px;
}

.category-count h3.title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    .form-search,
    .nav-main {
        display: none;
    }

    header.sidebar {
        padding: 0 10px;
    }
}

/* -- Added dynamically to fix IQIYI Header -- */
.iqiyi-header {
    background-color: #111;
    border-bottom: 1px solid #222;
    padding: 0;
    height: 64px;
    display: flex;
    align-items: center;
}

.iqiyi-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.iqiyi-header .nav-main {
    flex-grow: 1;
}

.iqiyi-header .header-links ul {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 20px;
}

.iqiyi-header .header-links li {
    margin: 0;
}

.iqiyi-header .header-links a {
    color: #ccc;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
    display: block;
}

.iqiyi-header .header-links a:hover,
.iqiyi-header .header-links a.active {
    color: var(--iqiyi-green);
    font-weight: 600;
}

.iqiyi-header .logo.modern-logo {
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.iqiyi-header .logo.modern-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--iqiyi-green);
}

.iqiyi-header .logo-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
}

.iqiyi-header .logo-text {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.iqiyi-header .form-search {
    margin-right: 20px;
    display: flex;
}

.iqiyi-header .form-search .input-group {
    display: flex;
    background-color: #222;
    border-radius: 20px;
    overflow: hidden;
    height: 36px;
    align-items: center;
}

.iqiyi-header .form-search .form-control {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0 15px;
    width: 200px;
    box-shadow: none;
    outline: none;
    height: 100%;
}

.iqiyi-header .btn-search {
    background: transparent;
    border: none;
    color: #ccc;
    padding: 0 15px;
    display: flex;
    align-items: center;
    height: 100%;
}

.iqiyi-header .user {
    display: flex;
    align-items: center;
    white-space: nowrap;
    gap: 8px;
}

.iqiyi-header .user a {
    color: #ccc;
    text-decoration: none;
}

.iqiyi-header .user a:hover {
    color: var(--iqiyi-green);
}

.iqiyi-header .header-mobile {
    display: none;
}

@media (max-width: 991px) {
    .iqiyi-header .container {
        display: none;
    }

    .iqiyi-header .header-mobile {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        height: 100%;
    }

    .iqiyi-header .mobile-logo {
        display: flex;
        align-items: center;
        color: var(--iqiyi-green);
    }
}


/* -- Added dynamically to fix play page Layout -- */
.player-row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
    gap: 20px;
}

.player-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    background: #000;
    position: relative;
    display: block;
}

.player-wrapper iframe,
.player-wrapper video,
.player-wrapper .MacPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.player-row .col-md-9 {
    flex: 1 1 0%;
    min-width: 0;
    padding: 0;
}

.player-row .col-md-3 {
    flex: 0 0 280px;
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    border-radius: 12px;
    align-self: flex-start;
    overflow: hidden;
}

.sidebar-playlist {
    padding: 0;
}

.sidebar-info {
    padding: 20px;
}

.sidebar-info h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
}

.episode-list-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 6px;
    align-content: start;
}

.ep-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    color: #ccc;
    border-radius: 4px;
    padding: 0 4px;
    height: 30px;
    line-height: 30px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ep-sidebar-item:hover {
    background: #333;
    color: #fff;
}

.ep-sidebar-item.active {
    background: var(--iqiyi-green);
    color: #000;
    font-weight: bold;
}

.related-section {
    margin-top: 40px;
}

.related-section .iqiyi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
}

.related-section .col-md-2 {
    width: 100%;
    padding: 0;
    margin: 0;
    flex: none;
    max-width: none;
}

@media (max-width: 991px) {
    .player-row {
        flex-direction: column;
    }

    .player-row .col-md-9,
    .player-row .col-md-3 {
        flex: 1 1 100%;
        width: 100%;
        max-height: none;
    }
}


/* -- Added dynamically to fix Detail and Index Layout -- */
.detail-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.3);
    z-index: -1;
}

.detail-info-box {
    margin-top: 40px;
    padding: 30px;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    color: #fff;
}

.detail-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.detail-text {
    padding-left: 20px;
}

.vod-title {
    font-size: 32px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
}

.vod-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #aaa;
}

.vod-meta .score {
    color: var(--iqiyi-green);
    font-weight: bold;
    font-size: 16px;
}

.vod-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: #fff;
    text-decoration: none;
    margin-right: 10px;
    font-size: 13px;
}

.vod-tags a:hover {
    background: var(--iqiyi-green);
    color: #000;
}

.vod-info {
    margin-bottom: 10px;
    color: #ccc;
}

.vod-info a {
    color: #fff;
    text-decoration: none;
    margin-right: 8px;
}

.vod-info a:hover {
    color: var(--iqiyi-green);
}

.vod-desc {
    margin-top: 20px;
    color: #aaa;
    line-height: 1.6;
}

.vod-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.btn-play-big {
    display: inline-block;
    padding: 12px 40px;
    background: var(--iqiyi-green);
    color: #000;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-play-big:hover {
    transform: scale(1.05);
    color: #000;
    text-decoration: none;
}

.btn-fav {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    border-radius: 25px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-fav:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
}

.detail-playlist-box {
    margin-top: 40px;
    background: #1a1a1a;
    padding: 25px;
    border-radius: 12px;
}

.nav-tabs {
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.nav-tabs>li>a {
    color: #aaa;
    background: transparent;
    border: none;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 0;
}

.nav-tabs>li.active>a,
.nav-tabs>li>a:hover {
    background: transparent;
    color: var(--iqiyi-green);
    border: none;
    border-bottom: 2px solid var(--iqiyi-green);
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.episode-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: #2a2a2a;
    color: #ccc;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.episode-list a:hover {
    background: var(--iqiyi-green);
    color: #000;
    font-weight: bold;
}

/* Grid layout for Index and Recommendations */
.iqiyi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.iqiyi-grid>div {
    width: auto;
    padding: 0;
}

.video-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: transparent;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.featured-content-image {
    width: 100%;
    position: relative;
    padding-bottom: 150% !important;
    height: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

.featured-content-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.5s ease;
}

.video-item:hover .featured-content-image img {
    transform: scale(1.05);
}

.link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.video-item:hover .link-overlay {
    opacity: 1;
}

.entry-title {
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.entry-title a:hover {
    color: var(--iqiyi-green);
}

/* Fix missing .row on play page */
.category-count {
    margin-bottom: 20px;
    border-left: 4px solid var(--iqiyi-green);
    padding-left: 10px;
}

.category-count .title {
    font-size: 22px;
    margin: 0;
    font-weight: 700;
    color: #fff;
}

/* Fix Bootstrap grid overrides */
.container.main-content {
    padding-top: 30px;
}

@media (max-width: 768px) {
    .detail-info-box .col-md-3 {
        margin-bottom: 20px;
    }

    .detail-poster {
        max-width: 200px;
        margin: 0 auto;
    }

    .iqiyi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ===== Play Page Detail Card - Professional Design ===== */
.play-detail-card {
    margin-top: 25px;
    background: rgba(22, 22, 24, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.play-detail-inner {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.play-detail-poster {
    flex: 0 0 220px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.play-detail-poster img {
    width: 100%;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.play-detail-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.play-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.play-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #a1a1aa;
    align-items: center;
}

.play-detail-meta span {
    display: flex;
    align-items: center;
}

.play-detail-meta span:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #555;
    border-radius: 50%;
    margin-left: 16px;
}

.play-detail-score {
    color: var(--iqiyi-green) !important;
    font-weight: 700;
    font-size: 18px !important;
}

.play-detail-score::after {
    display: none !important;
}

.play-detail-tags {
    margin-bottom: 24px;
}

.play-detail-tags a {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(32, 188, 34, 0.15);
    border: 1px solid rgba(32, 188, 34, 0.3);
    border-radius: 6px;
    color: var(--iqiyi-green);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-right: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.play-detail-tags a:hover {
    background: var(--iqiyi-green);
    color: #000;
}

.play-detail-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px 16px;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.play-detail-label {
    color: #71717a;
    font-weight: 500;
}

.play-detail-value {
    color: #e4e4e7;
}

.play-detail-value a {
    color: #e4e4e7;
    text-decoration: none;
    transition: color 0.2s;
    margin-right: 8px;
}

.play-detail-value a:hover {
    color: var(--iqiyi-green);
}

.play-detail-desc {
    font-size: 15px;
    color: #a1a1aa;
    line-height: 1.8;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Episode Pagination at Top */
.ep-pagination {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ep-pagination .ep-page-btn {
    padding: 5px 12px;
    background: #2a2a2a;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.ep-pagination .ep-page-btn:hover {
    background: #444;
    border-color: #555;
}

.ep-pagination .ep-page-btn.active {
    background: var(--iqiyi-green);
    color: #000;
    font-weight: bold;
    border-color: var(--iqiyi-green);
}

@media (max-width: 768px) {
    .play-detail-inner {
        flex-direction: column;
        align-items: center;
    }

    .play-detail-poster {
        flex: none;
        width: 140px;
    }
}