/*
Theme Name: 13. Amber Glow
Requires PHP: 7.4
Author URI: https://nightowlthemes.net
License: GPL v2 or later
Tested up to: 6.6
Requires at least: 6.1
Version: 1.1.5
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: video, amber, warm, cozy, dark
Author: NightOwl Themes
Description: Warm amber tones radiate across a sophisticated dark canvas. Creates a cozy yet professional streaming environment.
*/

/* CSS Variables */
:root {
    --g13-bg: #1b1b1b;
    --g13-bg-secondary: #111;
    --g13-bg-tertiary: #222;
    --g13-bg-hover: #333;
    --g13-accent: #f90;
    --g13-accent-hover: #e80;
    --g13-text: #fff;
    --g13-text-secondary: #ccc;
    --g13-text-muted: #999;
    --g13-border: #333;
    --g13-border-light: #555;
    --g13-shadow: rgba(120, 120, 120, 0.5);
    --g13-thumb-ratio: 16/9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

a {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: Arial, sans-serif;
    background: #1b1b1b;
    color: #fff;
    line-height: 1.6;
}

.wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background: #1b1b1b;
    min-height: 100vh;
}

/* Visually hidden - for SEO h1 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header Styles */
.header {
    padding-top: 20px;
}

.logo {
    margin: 0 15px 15px;
}

.logo a {
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    display: inline-block;
}

.logo-main {
    color: #f00;
}

.logo-ext {
    color: #fff;
}

/* Navigation Styles */
.navigation {
    background: #111;
    text-transform: uppercase;
    border-top: none;
    padding: 10px;
    margin-bottom: 1px;
    -webkit-box-shadow: 0 0 10px rgba(120, 120, 120, 0.5);
    box-shadow: 0 0 10px rgba(120, 120, 120, .5);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-item {
    flex: 0 0 auto;
    text-align: left;
}

.nav-item:last-child {
    border-right: none;
}

.nav-item a {
    display: block;
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    padding: 12px 15px;
}

.nav-item a:hover,
.nav-item.active a {
    color: #f90;
}

/* Search Bar */
.search-bar {
    margin: 15px 0;
    display: flex;
    width: 100%;
    padding: 0 15px;
    position: relative;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #555;
    background: #333;
    color: #fff;
    font-size: 14px;
    border-radius: 4px 0 0 4px;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    padding: 0 20px;
    background: #f90;
    color: #000;
    border: none;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #e80;
}

/* Main Content */
.main-content {
    padding: 10px;
}

/* Advertisement */
.advertisement {
    text-align: center;
}

.ad-image {
    max-width: 400px;
    width: 100%;
    aspect-ratio: 2/1;
    object-fit: cover;
    border-radius: 8px;
    border: 2px dashed #444;
}

/* Video Section */
.video-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #222;
    border-radius: 8px;
}

.video-title {
    font-size: 28px;
    color: #fff;
    margin: 0 0 10px 10px;
    text-align: left;
}

.video-player {
    position: relative;
    max-width: 830px;
    aspect-ratio: var(--fv-thumb-aspect-ratio, 16/9);
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-player .player-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.video-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.server-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.server-btn {
    padding: 8px 16px;
    background: #333;
    color: #ccc;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.server-btn:hover,
.server-btn.active {
    background: #f90;
    color: #000;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.like-btn {
    padding: 8px 12px;
    background: #333;
    color: #ccc;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.like-btn:hover,
.like-btn.liked {
    background: #f90;
    color: #000;
}

.views {
    color: #999;
    font-size: 14px;
}

.video-description {
    margin-bottom: 20px;
}

/* Fix nolink color - should match description text */
.description-text strong {
    color: inherit;
    font-weight: 600;
}

.description-text a {
    color: #ccc;
    transition: color 0.3s ease;
}

.description-text a:hover {
    color: #f90;
}

.more-text.hidden {
    display: none;
}

.show-more-btn {
    background: none;
    border: none;
    color: #f90;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

.show-more-btn:hover {
    color: #e80;
}

.video-genres {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.genre-btn {
    padding: 6px 12px;
    background: #444;
    color: #ccc;
    border: 1px solid #666;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.genre-btn:hover {
    background: #f90;
    color: #000;
    border-color: #f90;
}

/* Movie Section */
.movie-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.movie-item {
    overflow: hidden;
    transition: transform 0.3s ease;
}

.movie-item:hover {
    transform: translateY(-5px);
}

.movie-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-poster-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.movie-poster {
    width: 100%;
    aspect-ratio: var(--fv-thumb-aspect-ratio, 16/9);
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.movie-badge {
    font-size: 12px;
    position: absolute;
    top: 0;
    border-left: 3px solid #ea4335;
    background: rgba(17, 17, 17, .6);
    padding: 0 4px;
    margin: 6px 4px;
    color: #fff;
}

.movie-title {
    padding: 0 15px;
    font-size: 14px;
    text-align: left;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: calc(1.4em * 2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 15px;
    background: #333;
    color: #ccc;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
    background: #f90;
    color: #000;
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    padding: 12px 30px;
    background: #f90;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #e80;
    transform: translateY(-2px);
}


/* Footer Bottom */
.footer {
    padding-bottom: 10px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border: 1px solid #333;
    -webkit-box-shadow: 0 0 10px rgba(120, 120, 120, 0.5);
    box-shadow: 0 0 10px rgba(120, 120, 120, .5);
    background: #1b1b1b;
}

.footer-logo {
    font-size: 18px;
    font-weight: bold;
}

.copyright {
    color: #fff;
    font-size: 16px;
    margin: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wrapper {
        margin: 0 10px;
    }

    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .nav-list {
        justify-content: center;
    }

    .nav-item {
        border-right: none;
        margin-bottom: 1px;
    }

    .nav-item:last-child {
        margin-bottom: 0;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .main-content {
        padding: 0;
    }
}

@media (max-width: 425px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .section-title {
        font-size: 20px;
    }

    .pagination {
        gap: 5px;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }

    .main-content {
        padding: 0;
    }
}

/* Categories Popup Styles */
.categories-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.categories-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #222;
    border-radius: 5px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #f90;
    padding-bottom: 15px;
}

.popup-header h3 {
    color: #fff;
    font-size: 24px;
    margin: 0;
}

.close-popup {
    background: none;
    border: none;
    color: #ccc;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: #333;
    color: #f90;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.category-item {
    display: block;
    padding: 12px 15px;
    background: #333;
    color: #ccc;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #444;
}

.category-item:hover {
    background: #f90;
    color: #000;
    border-color: #f90;
    transform: translateY(-2px);
}

/* Responsive cho popup */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .popup-content {
        padding: 20px;
        width: 95%;
    }

    .popup-header h3 {
        font-size: 20px;
    }

    .category-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .popup-content {
        padding: 15px;
    }

    .popup-header h3 {
        font-size: 18px;
    }

    .category-item {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background: var(--g13-bg-tertiary);
    border: 1px solid var(--g13-border);
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--g13-text-secondary);
    text-decoration: none;
    transition: background 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--g13-bg-hover);
    color: var(--g13-accent);
}

.autocomplete-item svg {
    flex-shrink: 0;
    opacity: 0.5;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 0;
    font-size: 14px;
    color: var(--g13-text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--g13-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--g13-accent);
}

.breadcrumb svg {
    opacity: 0.5;
}

/* Time Filters */
.time-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 8px 16px;
    background: var(--g13-bg-hover);
    color: var(--g13-text-secondary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.time-btn:hover {
    background: var(--g13-border-light);
    color: var(--g13-text);
}

.time-btn.active {
    background: var(--g13-accent);
    color: #000;
}

/* 404 Error Page */
.error-wrapper {
    background: var(--g13-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tv-screen {
    width: 80vw;
    max-width: 900px;
    height: 80vh;
    max-height: 600px;
    background: #000;
    border: 15px solid #333;
    border-radius: 20px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1), 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.tv-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.05) 2px, rgba(255, 255, 255, 0.05) 4px);
    border-radius: 5px;
    pointer-events: none;
}

.tv-header {
    padding: 20px 30px;
    position: relative;
    z-index: 2;
}

.tv-logo a {
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    display: inline-block;
}

.tv-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 30px;
    position: relative;
    z-index: 2;
}

.glitch-text {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    position: relative;
    margin: 0;
}

.glitch-text::before,
.glitch-text::after {
    content: '404';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitch-1 1s infinite;
    color: #f00;
    z-index: -1;
}

.glitch-text::after {
    animation: glitch-2 1s infinite;
    color: #00f;
    z-index: -2;
}

@keyframes glitch-1 {

    0%,
    14%,
    15%,
    49%,
    50%,
    99%,
    100% {
        transform: translate(0);
    }

    15%,
    49% {
        transform: translate(-2px, -2px);
    }
}

@keyframes glitch-2 {

    0%,
    20%,
    21%,
    62%,
    63%,
    99%,
    100% {
        transform: translate(0);
    }

    21%,
    62% {
        transform: translate(2px, 2px);
    }
}

.signal-lost {
    font-size: 12px;
    color: var(--g13-accent);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

.error-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #fff;
    margin: 20px 0 10px;
    font-weight: bold;
}

.error-description {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--g13-text-secondary);
    margin: 0 0 30px;
    line-height: 1.6;
    max-width: 500px;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.error-btn {
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-transform: uppercase;
}

.error-btn-primary {
    background: var(--g13-accent);
    color: #000;
}

.error-btn-primary:hover {
    background: var(--g13-accent-hover);
    transform: translateY(-2px);
}

.error-btn-secondary {
    background: var(--g13-bg-hover);
    color: var(--g13-text-secondary);
    border: 1px solid var(--g13-border-light);
}

.error-btn-secondary:hover {
    background: #444;
    border-color: var(--g13-accent);
}

/* Video Page Specific */
.video-section {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--g13-bg-tertiary);
    border-radius: 8px;
}

/* Mobile Menu Toggle - Hidden (navigation wraps naturally) */
.mobile-menu-toggle {
    display: none !important;
}

/* Sidebar Styles */
.layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}

.sidebar {
    background: var(--g13-bg-tertiary);
    border-radius: 8px;
    padding: 20px;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 16px;
    color: var(--g13-text);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--g13-accent);
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    margin-bottom: 8px;
}

.sidebar-list a {
    color: var(--g13-text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 5px 0;
    transition: color 0.2s;
}

.sidebar-list a:hover {
    color: var(--g13-accent);
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--g13-bg-hover);
    color: var(--g13-text-secondary);
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--g13-accent);
    color: #000;
}

@media (max-width: 900px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }
}

/* ===== Back to Top Area ===== */
.back-to-top-area {
    display: flex;
    justify-content: center;
    padding: 15px;
}

.back-to-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    padding: 14px 24px;
    background: var(--g13-bg-tertiary);
    border: 1px solid var(--g13-border);
    border-radius: 6px;
    color: var(--g13-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-to-top-btn:hover {
    background: var(--g13-accent);
    border-color: var(--g13-accent);
    color: #000;
}

.back-to-top-btn:active {
    transform: scale(0.98);
}

.back-to-top-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.back-to-top-btn:hover svg {
    transform: translateY(-2px);
}

/* Banner Ads */
.fv-header-banner,
.fv-footer-banner,
.fv-square-banner {
    text-align: center;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
    z-index: 100;
}