/* 
 * Nid Video Theme
 */

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {
    margin: 0;
    padding: 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

fieldset, img {
    border: 0;
}

address, caption, cite, code, dfn, em, strong, th, var, optgroup, i {
    font-style: normal;
    font-weight: normal;
}

del, ins {
    text-decoration: none;
}

li {
    list-style: none;
}

caption, th {
    text-align: left;
}

.clr, .clear, div.clear {
    clear: both;
}

.cf::after {
    content: "";
    display: table;
    clear: both;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Typography & Links
   ========================================================================== */
body {
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: #e0e0e0;
    transition: color 0.2s ease;
}

a:hover {
    color: #fff;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
#page {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    border: 1px solid #2d2d2d;
    background: #1a1a1a;
}

.wrap {
    max-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

#main {
    display: block;
}

#main > .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#content {
    flex: 1;
    min-width: 0;
}

#sidebar {
    width: 280px;
    flex-shrink: 0;
    padding-top: 15px;
}

@media (max-width: 992px) {
    #main > .wrap {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */
#header {
    padding: 15px 0;
    border-bottom: 1px solid #2d2d2d;
}

#header .wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

#branding {
    flex-shrink: 0;
}

#site-title {
    margin: 0;
    font-size: 0;
}

#site-title a {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

#site-logo img {
    max-height: 50px;
    width: auto;
}

#site-description {
    display: none;
}

#header-actions {
    flex: 1;
}

#header-search {
    margin-left: auto;
}

/* Search Form */
.searchform-div {
    display: block;
}

.searchform {
    display: flex;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    overflow: hidden;
    background: #252525;
}

.search-text-div {
    flex: 1;
}

.search-text {
    width: 100%;
    min-width: 200px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

.search-text::placeholder {
    color: #888;
}

.search-submit-div {
    flex-shrink: 0;
}

.search-submit {
    padding: 10px 18px;
    border: none;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.search-submit:hover {
    background: #c62828;
}

@media (max-width: 768px) {
    #header .wrap {
        flex-direction: column;
        align-items: stretch;
    }
    
    #header-search {
        margin-left: 0;
        width: 100%;
    }
    
    .search-text {
        min-width: 0;
    }
}

/* ==========================================================================
   Main Navigation
   ========================================================================== */
#main-nav {
    background: #1a1a1a;
    border-bottom: 1px solid #2d2d2d;
    padding: 8px 0;
}

#main-nav .menu {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#main-nav .menu li a {
    display: block;
    padding: 8px 14px;
    background: #2d2d2d;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

#main-nav .menu li a:hover,
#main-nav .menu li.current-menu-item a,
#main-nav .menu li.active a,
#main-nav .menu li a.active {
    background: #e53935;
    color: #fff;
}

@media (max-width: 768px) {
    #main-nav .menu {
        justify-content: center;
    }
    
    #main-nav .menu li a {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Video Grid / Loop Content
   ========================================================================== */
.loop-content {
    padding: 15px 0;
}

.nag {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 1200px) {
    .nag {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .nag {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nag {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ==========================================================================
   Video Item Card
   ========================================================================== */
.item {
    background: #252525;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.post-margin {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Thumbnail Section */
.thumb-stats {
    position: relative;
}

.thumb {
    position: relative;
    display: block;
}

.thumb .clip {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item:hover .thumb img {
    transform: scale(1.05);
}

.thumb .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.item:hover .thumb .overlay {
    opacity: 1;
}

/* Stats Bar */
.stats {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #1f1f1f;
    font-size: 11px;
    color: #999;
}

.stats span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.stats svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.7;
}

.stats .count {
    font-style: normal;
    color: #ccc;
}

.stats .suffix {
    display: none;
}

/* Data Section */
.data {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.entry-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.entry-title a {
    color: #e0e0e0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-title a:hover {
    color: #e53935;
}

.entry-meta {
    margin: 0;
    font-size: 11px;
    color: #888;
    margin-top: auto;
}

.entry-meta .author,
.entry-meta .time,
.entry-date {
    display: inline;
}

.entry-summary {
    display: none;
}

/* ==========================================================================
   Video Detail Page
   ========================================================================== */
#details {
    background: #252525;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

#details .date {
    display: none;
}

.entry-head {
    margin-bottom: 15px;
}

.siteheading {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.siteheading a {
    color: #fff;
}

/* Video Player */
.entry-content {
    margin-bottom: 15px;
}

.movieLoader {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    /* Đảm bảo container không bị collapse */
    min-height: 200px;
}

/* Video Actions */
.video-actions-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #3d3d3d;
}

.movieLoader-server {
    display: flex;
    gap: 8px;
}

.video2-btn {
    padding: 8px 16px;
    border: none;
    background: #3d3d3d;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.video2-btn:hover,
.video2-btn.selected {
    background: #e53935;
    color: #fff;
}

.video-actions {
    display: flex;
    gap: 10px;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    max-height: 500px;
}

@media (min-width: 768px) {
    .video-player {
        height: 500px;
        aspect-ratio: unset;
    }
}

/* Iframe player */
.video-player > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* JWPlayer container */
.video-player > #player,
.video-player > .jwplayer,
.video-player > div[id^="jwplayer"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* JWPlayer wrapper fix */
.jwplayer.jw-stretch-uniform,
.jwplayer.jw-stretch-exactfit,
.jwplayer.jw-stretch-fill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Loading indicator */
.video-player .cssloading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.video-player .cssloading span {
    animation: loading 1.4s infinite;
}

.video-player .cssloading span:nth-child(2) {
    animation-delay: 0.2s;
}

.video-player .cssloading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {
    0%, 60%, 100% { opacity: 0; }
    30% { opacity: 1; }
}

.video-action__like,
.video-action__dislike,
.video-action__views {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #3d3d3d;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.video-action__like:hover,
.video-action__like.active {
    background: #4caf50;
    color: #fff;
}

.video-action__dislike:hover,
.video-action__dislike.active {
    background: #e53935;
    color: #fff;
}

.video-action__views {
    cursor: default;
    background: transparent;
    border: 1px solid #3d3d3d;
}

.video-action__like svg,
.video-action__dislike svg,
.video-action__views svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Entry Tags */
.entry-tags,
.entry-genres {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #3d3d3d;
    font-size: 13px;
    line-height: 2;
}

.entry-tags a,
.entry-genres a {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    background: #3d3d3d;
    border-radius: 3px;
    font-size: 12px;
    color: #ccc;
    transition: all 0.2s;
}

.entry-tags a:hover,
.entry-genres a:hover {
    background: #e53935;
    color: #fff;
}

/* ==========================================================================
   Related Posts Section
   ========================================================================== */
.related-posts {
    margin-top: 20px;
}

.section-box {
    /* background: #252525; */
    border-radius: 6px;
    padding: 15px;
}

.section-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e53935;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.section-content.grid-small .nag {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .section-content.grid-small .nag {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .section-content.grid-small .nag {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Comments Section
   ========================================================================== */
#comments {
    background: #252525;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e53935;
}

.comments-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.comments-count {
    background: #e53935;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.comment-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid #3d3d3d;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e53935;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-meta {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: #888;
}

.comment-content {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    padding-left: 50px;
}

/* Comment Form */
.comment-form {
    background: #1f1f1f;
    border-radius: 6px;
    padding: 15px;
}

.comment-form-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 15px;
}

.comment-form .form-group {
    margin-bottom: 12px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #3d3d3d;
    background: #252525;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    border-color: #e53935;
    outline: none;
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.comment-form .btn-submit {
    padding: 10px 24px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.comment-form .btn-submit:hover {
    background: #c62828;
}

.comment-form .btn-submit:disabled {
    background: #666;
    cursor: not-allowed;
}

.no-comments {
    text-align: center;
    color: #888;
    padding: 20px;
    font-size: 14px;
}

.comment-success {
    background: #4caf50;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.comment-error {
    background: #e53935;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */
.widget {
    background: #252525;
    border-radius: 6px;
    padding: 15px;
    margin-top: 12px;
}

.widget-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e53935;
}

.widget-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* Tag Cloud Widget */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tagcloud a {
    display: inline-block;
    padding: 5px 10px;
    background: #3d3d3d;
    border-radius: 3px;
    font-size: 12px !important;
    color: #ccc;
    transition: all 0.2s;
}

.tagcloud a:hover {
    background: #e53935;
    color: #fff;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.loop-nav {
    padding: 20px 0;
    text-align: center;
}

.wp-pagenavi {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.wp-pagenavi a,
.wp-pagenavi span {
    display: inline-block;
    padding: 8px 14px;
    background: #2d2d2d;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.wp-pagenavi a:hover {
    background: #e53935;
    color: #fff;
}

.wp-pagenavi .current {
    background: #e53935;
    color: #fff;
}

.wp-pagenavi .pages {
    background: transparent;
    color: #888;
}

.wp-pagenavi .extend {
    background: transparent;
    color: #888;
}

/* ==========================================================================
   Footer
   ========================================================================== */
#footer {
    background: #151515;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #2d2d2d;
}

#colophon {
    text-align: center;
    color: #888;
    font-size: 13px;
}

#colophon a {
    color: #e53935;
}

#colophon a:hover {
    color: #fff;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #888;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-15 {
    margin-top: 15px;
}

/* Description box for search/list pages */
.description {
    background: #252525;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    color: #ccc;
}

.color-search {
    color: #e53935;
    font-weight: 600;
}

/* SEO Content for genre/category pages */
.seo-content {
    background: #1a1a1a;
    padding: 20px 25px;
    border-radius: 8px;
    margin-top: 25px;
    color: #b0b0b0;
    line-height: 1.8;
    font-size: 14px;
    border-left: 3px solid #e53935;
}

.seo-content h2,
.seo-content h3 {
    color: #fff;
    margin: 15px 0 10px;
    font-size: 16px;
}

.seo-content h2:first-child,
.seo-content h3:first-child {
    margin-top: 0;
}

.seo-content p {
    margin-bottom: 12px;
}

.seo-content a {
    color: #e53935;
    text-decoration: none;
}

.seo-content a:hover {
    text-decoration: underline;
}

.seo-content ul,
.seo-content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.seo-content li {
    margin-bottom: 5px;
}

/* Breadcrumb/Page Title */
.breadcrumb {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e53935;
}

/* Heading CSS (for H1 on homepage) */
.heading-css {
    font-size: 16px;
    font-weight: 500;
    color: #e0e0e0;
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: #252525;
    border-radius: 4px;
    line-height: 1.5;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #e53935;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 480px) {
    .nag {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .entry-title {
        font-size: 12px;
    }
    
    .stats {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .data {
        padding: 8px;
    }
    
    #details {
        padding: 10px;
    }
    
    .siteheading {
        font-size: 16px;
    }
}

/* ==========================================================================
   Lazy Load Support
   ========================================================================== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[data-src].loaded,
img.lazyloaded {
    opacity: 1;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    #header,
    #main-nav,
    #sidebar,
    #footer,
    .stats,
    .video-actions-container {
        display: none !important;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .item {
        break-inside: avoid;
    }
}

/* Author Page */
.author-profile-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.author-avatar {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--link-color);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.author-details {
    flex: 1;
}
.author-name {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    color: #fff;
}
.author-bio {
    color: #ccc;
    margin: 0;
    line-height: 1.6;
}
.author-bio strong {
    color: var(--link-color);
}

@media (max-width: 576px) {
    .author-profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-avatar {
        width: 80px;
        height: 80px;
    }
    .author-name {
        font-size: 1.3em;
    }
}