/*
Theme Name: 13. Amber Glow (Scoped for Next.js)
Description: All styles scoped under .theme-amber-glow class to prevent CSS leakage
*/

/* CSS Variables remain global */
: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;
}

body {
    margin: 0;
    padding: 0;
}

/* Base theme container styles */
.theme-amber-glow {
    font-family: Arial, sans-serif;
    background: #1b1b1b;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.theme-amber-glow *,
.theme-amber-glow *::before,
.theme-amber-glow *::after {
    box-sizing: border-box;
}

.theme-amber-glow a {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Override user agent stylesheet cho h3 */
.theme-amber-glow h3 {
    margin: 0;           /* Browser thường set margin-top và margin-bottom */
    padding: 0;
    font-size: inherit;  /* Hoặc set size cụ thể */
    font-weight: inherit; /* Hoặc set weight cụ thể */
    line-height: inherit;
}

/* ============================================ */
/* LAYOUT & WRAPPER                             */
/* ============================================ */

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

.theme-amber-glow .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                                       */
/* ============================================ */

.theme-amber-glow .header {
    padding-top: 20px;
}

.theme-amber-glow .logo {
    margin: 0 15px 15px;
}

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

.theme-amber-glow .logo-main {
    color: #f00;
}

.theme-amber-glow .logo-ext {
    color: #fff;
}

/* ============================================ */
/* NAVIGATION                                   */
/* ============================================ */

.theme-amber-glow .navigation {
    background: #111;
    text-transform: uppercase;
    border-top: none;
    padding: 10px;
    margin-bottom: 1px;
    box-shadow: 0 0 10px rgba(120, 120, 120, 0.5);
}

.theme-amber-glow .nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

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

.theme-amber-glow .nav-item a,
.theme-amber-glow .nav-item button {
    display: block;
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    padding: 12px 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
}

.theme-amber-glow .nav-item a:hover,
.theme-amber-glow .nav-item button:hover,
.theme-amber-glow .nav-item.active a {
    color: #f90;
}

/* ============================================ */
/* SEARCH BAR                                   */
/* ============================================ */

.theme-amber-glow .search-bar {
    margin: 15px 0;
    display: flex;
    width: 100%;
    padding: 0 15px;
    position: relative;
}

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

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

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

.theme-amber-glow .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;
}

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

/* ============================================ */
/* MAIN CONTENT                                 */
/* ============================================ */

.theme-amber-glow .main-content {
    padding: 10px;
}

/* ============================================ */
/* MOVIE SECTION & GRID                         */
/* ============================================ */

.theme-amber-glow .movie-section {
    margin-bottom: 40px;
}

.theme-amber-glow .section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #fff;
}

.theme-amber-glow .movie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

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

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

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

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

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

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

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

/* ============================================ */
/* PAGINATION                                   */
/* ============================================ */

.theme-amber-glow .pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

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

/* ============================================ */
/* LOAD MORE                                    */
/* ============================================ */

.theme-amber-glow .load-more {
    text-align: center;
    margin-top: 30px;
}

.theme-amber-glow .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;
}

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

.theme-amber-glow .load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================ */
/* VIDEO SECTION (single-video page)            */
/* ============================================ */

.theme-amber-glow .video-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #222;
    border-radius: 8px;
}

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

.theme-amber-glow .video-player {
    position: relative;
    max-width: 830px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
}

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

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

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

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

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

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

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

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

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

.theme-amber-glow .video-description {
    margin-bottom: 20px;
    color: #ccc;
    line-height: 1.6;
}

.theme-amber-glow .description-text {
    color: #ccc;
}

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

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

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

.theme-amber-glow .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;
    text-decoration: none;
}

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

/* ============================================ */
/* FOOTER                                       */
/* ============================================ */

.theme-amber-glow .footer {
    padding-bottom: 10px;
}

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

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

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

/* ============================================ */
/* CATEGORIES POPUP                             */
/* ============================================ */

.theme-amber-glow .categories-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

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

.theme-amber-glow .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);
}

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

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

.theme-amber-glow .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;
}

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

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

.theme-amber-glow .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;
}

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

/* ============================================ */
/* AUTOCOMPLETE                                 */
/* ============================================ */

.theme-amber-glow .autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background: #222;
    border: 1px solid #444;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.theme-amber-glow .autocomplete-dropdown.active {
    display: block;
}

.theme-amber-glow .autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    text-decoration: none;
    transition: background 0.2s;
}

.theme-amber-glow .autocomplete-item:hover,
.theme-amber-glow .autocomplete-item.selected {
    background: #333;
    color: #f90;
}

/* ============================================ */
/* BREADCRUMB                                   */
/* ============================================ */

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

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

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

/* ============================================ */
/* TIME FILTERS                                 */
/* ============================================ */

.theme-amber-glow .time-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.theme-amber-glow .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;
}

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

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

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 768px) {
    .theme-amber-glow .wrapper {
        margin: 0 10px;
    }

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

    .theme-amber-glow .nav-list {
        justify-content: center;
    }

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

    .theme-amber-glow .main-content {
        padding: 0;
    }

    .theme-amber-glow .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

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

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

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

    .theme-amber-glow .pagination {
        gap: 5px;
    }

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

    .theme-amber-glow .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

/* ============================================ */
/* 404 NOT FOUND PAGE                           */
/* ============================================ */

.theme-amber-glow .not-found-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-amber-glow .not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.theme-amber-glow .not-found-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    color: var(--g13-accent, #ff9900);
    opacity: 0.8;
    animation: not-found-shake 2s ease-in-out infinite;
}

.theme-amber-glow .not-found-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes not-found-shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

.theme-amber-glow .not-found-code {
    font-size: clamp(60px, 15vw, 120px);
    font-weight: 900;
    color: var(--g13-accent, #ff9900);
    text-shadow:
        0 0 20px rgba(255, 153, 0, 0.3),
        0 0 40px rgba(255, 153, 0, 0.2);
    line-height: 1;
    margin-bottom: 16px;
}

.theme-amber-glow .not-found-title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    color: var(--g13-text, #fff);
    margin: 0 0 12px;
}

.theme-amber-glow .not-found-desc {
    font-size: 15px;
    color: var(--g13-text-muted, rgba(255, 255, 255, 0.6));
    max-width: 380px;
    margin: 0 0 28px;
    line-height: 1.6;
}

.theme-amber-glow .not-found-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.theme-amber-glow .not-found-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.theme-amber-glow .not-found-btn.primary {
    background: var(--g13-accent, #ff9900);
    color: #000;
}

.theme-amber-glow .not-found-btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.theme-amber-glow .not-found-btn.secondary {
    background: var(--g13-bg-hover, rgba(255, 255, 255, 0.1));
    color: var(--g13-text, #fff);
}

.theme-amber-glow .not-found-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}