/* 11NUNG Pro - Movie911HD Style Homepage & Layout */

/* Genre Bar */
.genre-bar-wrap {
    background: #0d1322;
    border-top: 1px solid #1e293b;
    border-bottom: 1px solid #1e293b;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.genre-bar-wrap::-webkit-scrollbar {
    height: 4px;
}

.genre-bar-wrap::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 2px;
}

.genre-bar-container {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 8px 15px;
    display: flex;
    gap: 8px;
    box-sizing: border-box;
}

.genre-pill {
    background: #1e293b;
    color: #94a3b8;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #334155;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.genre-pill:hover {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}

.genre-pill.pill-hot {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: #ef4444;
}

/* 2-Column Home Layout */
.home-layout-container {
    display: flex;
    gap: 25px;
    margin-top: 25px;
    width: 100%;
}

.home-main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.home-sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
}

/* Section Titles */
.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-header-bar .section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header-bar .view-all-link {
    color: #38bdf8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.section-header-bar .view-all-link:hover {
    color: #fff;
}

/* ==========================================================================
   MOVIE GRID (Fluid Multi-Column for All Devices)
   ========================================================================== */
.nung-movies-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 40px;
    width: 100%;
}

.movie-card-item {
    position: relative;
    background: #111827;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
}

.movie-card-item:hover {
    transform: translateY(-5px);
    border-color: #0284c7;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.2);
}

.movie-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #1e293b;
    overflow: hidden;
}

.movie-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card-item:hover .movie-card-poster img {
    transform: scale(1.06);
}

.badge-quality {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #e11d48;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.badge-rating {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.badge-year {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(15, 23, 42, 0.85);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.movie-card-info {
    background: #0f172a !important;
    padding: 10px 12px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.movie-card-title,
.movie-card-title a,
.movie-card-info h3,
.movie-card-info h3 a {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card-item:hover .movie-card-title a {
    color: #38bdf8 !important;
}

.movie-card-orig,
.movie-card-info p,
p.movie-card-orig {
    color: #cbd5e1 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.95;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 25px;
}

.widget-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Top IMDb Widget List */
.top-imdb-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-imdb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.top-imdb-item:hover {
    background: #1e293b;
}

.imdb-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #1e293b;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.top-imdb-item:nth-child(1) .imdb-rank { background: #fbbf24; color: #000; }
.top-imdb-item:nth-child(2) .imdb-rank { background: #94a3b8; color: #000; }
.top-imdb-item:nth-child(3) .imdb-rank { background: #b45309; color: #fff; }

.imdb-thumb {
    width: 42px;
    height: 58px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.imdb-info {
    flex: 1;
    min-width: 0;
}

.imdb-title {
    margin: 0 0 2px 0;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-imdb-item:hover .imdb-title {
    color: #38bdf8 !important;
}

.imdb-score {
    font-size: 11px;
    color: #fbbf24;
    font-weight: 700;
}

/* Year Filter Pills */
.year-pills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.year-pill {
    background: #1e293b;
    color: #cbd5e1;
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #334155;
    transition: all 0.2s;
}

.year-pill:hover {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}

/* Sidebar Genres Grid */
.sidebar-genres-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sidebar-genre-item {
    background: #1e293b;
    color: #cbd5e1;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar-genre-item:hover {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}

.sidebar-genre-item .en-tag {
    font-size: 10px;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.35);
    padding: 1px 5px;
    border-radius: 4px;
}

.sidebar-genre-item:hover .en-tag {
    color: #e0f2fe;
    background: rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   RESPONSIVE LAYOUT (Tablets, iPad, Mobile Landscape & Portrait)
   ========================================================================== */

/* Large Tablets & iPad Pro Landscape (1025px - 1300px) */
@media (max-width: 1300px) {
    .nung-movies-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
    }
}

/* Tablets (Portrait & Landscape), iPad (768px - 1024px) */
@media (max-width: 1024px) {
    .home-layout-container {
        flex-direction: column;
        gap: 25px;
    }
    .home-sidebar {
        width: 100%;
        min-width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .home-sidebar .sidebar-widget {
        margin-bottom: 0;
    }
    .nung-movies-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

/* Mobile Landscape & Small Tablets (560px - 767px - e.g. iPhone Landscape) */
@media (max-width: 767px) {
    .home-sidebar {
        grid-template-columns: 1fr;
    }
    .nung-movies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .section-header-bar .section-title {
        font-size: 16px;
    }
    .genre-bar-container {
        padding: 6px 10px;
    }
}

/* Mobile Portrait (< 560px) */
@media (max-width: 559px) {
    .nung-movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .movie-card-info {
        padding: 8px 10px !important;
    }
    .movie-card-title,
    .movie-card-title a {
        font-size: 12px !important;
    }
    .movie-card-orig {
        font-size: 10.5px !important;
    }
}
/* ==========================================================================
   MOBILE SIDEBAR FULL RESPONSIVENESS & ZERO-OVERFLOW ENGINE
   ========================================================================== */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

.home-layout-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.home-main-content {
    min-width: 0 !important;
    max-width: 100% !important;
}

.home-sidebar {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.sidebar-widget {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.top-imdb-item {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.imdb-info {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
}

.imdb-title {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.sidebar-genres-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.sidebar-genre-item {
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.sidebar-genre-item > span:first-child {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    flex: 1 !important;
    font-size: 12px !important;
}

.sidebar-genre-item .en-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    margin-left: 4px !important;
}

.year-pills-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 1024px) {
    .home-layout-container {
        flex-direction: column !important;
        gap: 20px !important;
    }
    .home-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .home-sidebar .sidebar-widget {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 559px) {
    .sidebar-widget {
        padding: 14px 12px !important;
        border-radius: 10px !important;
    }
    .widget-title {
        font-size: 14.5px !important;
        margin-bottom: 12px !important;
    }
    .sidebar-genres-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
    .sidebar-genre-item {
        padding: 6px 8px !important;
    }
    .sidebar-genre-item > span:first-child {
        font-size: 11px !important;
    }
    .year-pills-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }
    .year-pill {
        padding: 5px 2px !important;
        font-size: 11px !important;
    }
}
/* ==========================================================================
   BLOG & ARTICLE REVIEWS RESPONSIVE LAYOUT
   ========================================================================== */
.home-articles-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.article-card-item {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s !important;
}

.article-card-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.2) !important;
    border-color: #38bdf8 !important;
}

@media (max-width: 900px) {
    .home-articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 559px) {
    .home-articles-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}
@media (max-width: 1024px) {
    .movie-related-articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 559px) {
    .movie-related-articles-grid {
        grid-template-columns: 1fr !important;
    }
}
/* ==========================================================================
   HOMEPAGE ARTICLES 2-COLUMN MOBILE & FLUID GRID
   ========================================================================== */
.home-articles-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.article-card-item {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s !important;
}

.article-card-item:hover {
    transform: translateY(-3px) !important;
    border-color: #38bdf8 !important;
}

.article-card-thumb-wrap {
    display: block !important;
    position: relative !important;
    aspect-ratio: 16/9 !important;
    overflow: hidden !important;
    background: #1e293b !important;
}

.article-card-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.article-date-badge {
    position: absolute !important;
    bottom: 6px !important;
    right: 6px !important;
    background: rgba(15, 23, 42, 0.85) !important;
    color: #38bdf8 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: 1px solid #334155 !important;
}

.article-card-info {
    padding: 12px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.article-card-title {
    margin: 0 0 6px 0 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.article-card-title a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.article-card-title a:hover {
    color: #38bdf8 !important;
}

.article-card-excerpt {
    color: #94a3b8 !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    margin: 0 0 10px 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.article-card-link {
    color: #38bdf8 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    margin-top: auto !important;
}

@media (max-width: 1024px) {
    .home-articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

@media (max-width: 767px) {
    .home-articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    .article-card-info {
        padding: 8px 10px !important;
    }
    .article-card-title {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }
    /* Hide long excerpt on mobile for clean minimalist aesthetic */
    .article-card-excerpt {
        display: none !important;
    }
    .article-card-link {
        font-size: 11px !important;
    }
}