@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/Outfit-300.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Outfit-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/Outfit-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/Outfit-800.ttf') format('truetype');
}

:root {
    --bg-color: #000000;
    --surface-color: #14151a;
    --primary-color: #f1757b;
    /* MissAV Pink */
    --primary-hover: #ff69b4;
    --text-main: #ffffff;
    --text-dim: #9ca3af;
    --accent-color: #ffeb3b;
    --glass-border: rgba(255, 255, 255, 0.08);
}

body.light-theme {
    --bg-color: #f5f5f7;
    --surface-color: #ffffff;
    --text-main: #1d1d1f;
    --text-dim: #86868b;
    --glass-border: rgba(0, 0, 0, 0.1);
}

body.light-theme .logo span {
    color: var(--text-main);
}

body.light-theme header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), transparent);
}

body.light-theme .nav-links a {
    color: var(--text-dim);
}

body.light-theme .nav-links a:hover,
body.light-theme .nav-links a.active {
    color: var(--text-main);
}

body.light-theme .search-btn {
    color: var(--text-main);
}

body.light-theme .float-btn {
    background: white;
    color: #1d1d1f;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-theme .footer {
    background: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--bg-color);
    border-right: 1px solid var(--glass-border);
    position: sticky;
    top: 65px;
    /* header height */
    height: calc(100vh - 65px);
    overflow-y: auto;
    padding: 20px;
    z-index: 90;
    transition: 0.3s;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.sidebar::-webkit-scrollbar {
    display: none;
}

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

.sidebar-menu {
    list-style: none;
    margin-bottom: 30px;
}

.sidebar-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
    font-weight: 700;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
}

.sidebar-menu li a:hover {
    background: rgba(241, 117, 123, 0.1);
    color: var(--primary-color);
}

.sidebar-menu li a.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-menu li a i {
    width: 18px;
    height: 18px;
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

/* Header */
header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: white;
}

.nav-links {
    display: flex;
    gap: 35px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-btn,
.user-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    transition: 0.3s;
}

.search-btn:hover,
.user-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Hero Slider 16:10 */
.hero-slider.swiper,
.detail-hero {
    width: 100%;
    aspect-ratio: 16 / 6;
    max-height: 85vh;
}

.hero {
    /* height: 100% !important; */
    display: flex !important;
    align-items: flex-end !important;
    padding-bottom: 60px !important;
    text-align: left;
    position: relative;
}

.hero-slider.swiper .swiper-slide.hero {
    height: 100% !important;
    display: flex !important;
    align-items: flex-end !important;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 60%),
        linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
}

.hero .container {
    width: 100%;
}

.category-tag {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 15px;
    display: inline-block;
}

.hero-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: -2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-hero .hero-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
    display: block;
    line-height: 1.2;
}

.hero-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
    font-weight: 600;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
}

.meta-item i {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}

.rating {
    background: var(--accent-color);
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
}

.hero-desc {
    max-width: 600px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

/* Day Selector */
.day-selector {
    display: flex;
    gap: 10px;
    background: var(--surface-color);
    padding: 12px;
    border-radius: 12px;
    margin: 40px 0;
}

.day-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
}

.day-item span {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
}

.day-item.active {
    background: var(--primary-color);
}

.day-item.active span {
    color: white;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 800;
}

.view-all {
    color: var(--primary-color) !important;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
}

.view-all:hover {
    color: white !important;
}

/* Movie Card System */
.movie-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 15px !important;
    margin-bottom: 40px;
    width: 100%;
}

.movie-card {
    position: relative;
    cursor: pointer;
    width: 100%;
    /* Ensure card doesn't exceed grid cell */
    min-width: 0;
    /* Prevents overflow */
}

.card-img {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #111;
}

.card-img img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.movie-card:hover .card-img img {
    transform: scale(1.1);
}

.movie-card:hover {
    z-index: 10;
}

.card-img {
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.movie-card:hover .card-img {
    box-shadow: 0 10px 30px rgba(241, 117, 123, 0.3);
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    z-index: 5;
}

.card-year {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 5;
}

.card-subcategory {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(229, 9, 20, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    z-index: 5;
    text-transform: uppercase;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 6;
}

.movie-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.play-icon i {
    width: 20px;
    height: 20px;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 12px;
    opacity: 0;
    transition: 0.3s;
    z-index: 4;
}

.movie-card:hover .card-overlay {
    opacity: 1;
}

.movie-tags {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.card-info h3 {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .nav-content {
        flex-wrap: wrap;
        padding: 15px 5%;
    }

    .nav-links {
        display: flex !important;
        order: 3;
        width: 100%;
        margin-top: 15px;
        gap: 20px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE 10+ */
    }

    .nav-links::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .nav-links li {
        flex-shrink: 0;
    }

    header {
        padding: 10px 0 !important;
    }

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

    .hero-slider.swiper,
    .detail-hero {
        aspect-ratio: 16 / 10;
    }

    .hero {
        padding-top: 140px !important;
        /* Space for absolute header + categories */
        padding-bottom: 40px !important;
        align-items: flex-end !important;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .detail-hero {
        min-height: auto !important;
        padding-top: 150px !important;
    }

    .detail-hero .hero-title {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: break-word;
        display: block;
        line-height: 1.2;
    }

    .hero-desc {
        font-size: 0.95rem;
        margin-bottom: 25px;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .hero-meta {
        gap: 10px;
        margin-bottom: 15px;
        font-size: 0.85rem;
    }

    .btn {
        padding: 8px 20px;
        font-size: 0.8rem;
    }

    .mobile-nav {
        display: flex;
    }
}

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    border-top: 1px solid var(--glass-border);
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 1000;
}

.mobile-nav a {
    color: var(--text-dim);
    text-decoration: none;
}

.mobile-nav a.active {
    color: var(--primary-color);
}

/* Floating Actions */
.floating-actions {
    position: fixed;
    right: 2rem;
    bottom: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 900;
}

.float-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.float-btn:hover {
    background: var(--primary-color);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 13, 20, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-input-container {
    width: 80%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid white;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    outline: none;
    text-align: center;
}

.search-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Footer */
.footer {
    background: #08080a;
    border-top: 1px solid var(--glass-border);
    padding: 40px 0;
    margin-top: 100px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo .logo {
    margin-bottom: 20px;
}

.footer-disclaimer {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.8;
    max-width: 500px;
    margin-top: 20px;
}

.footer-links {
    display: flex;
    gap: 80px;
}

.footer-column h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 25px;
    font-weight: 600;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-column a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        gap: 40px;
    }
}

/* Search Overlay Optimization */
.hot-searches {
    margin-top: 50px;
    text-align: left;
    width: 100%;
}

.hot-searches h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hot-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hot-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--primary-color);
}

.tag-index {
    display: inline-flex;
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 4px;
    font-size: 11px;
    align-items: center;
    justify-content: center;
    color: #999;
}

.hot-tag:nth-child(1) .tag-index {
    background: #ff3d00;
    color: white;
}

.hot-tag:nth-child(2) .tag-index {
    background: #ff6e00;
    color: white;
}

.hot-tag:nth-child(3) .tag-index {
    background: #ff9e00;
    color: white;
}

/* Pagination */
.pagination-nav {
    width: 100%;
}

/* Desktop pagination: full page numbers */
.pagination-desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

/* Mobile pagination: prev/next only */
.pagination-mobile {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
}

.page-btn:hover:not(.page-active):not(.page-btn-disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.page-active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.page-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-dots {
    border: none;
    background: none;
    cursor: default;
}

.page-info {
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Mobile: show simplified, hide desktop */
@media (max-width: 768px) {
    .pagination-desktop {
        display: none;
    }

    .pagination-mobile {
        display: flex;
    }

    .pagination-mobile .page-btn {
        flex: 1;
        height: 44px;
        border-radius: 50px;
        font-size: 0.95rem;
    }
}

/* PWA Promotion */
.pwa-prompt {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transform: translateY(150%);
    transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-prompt.active {
    transform: translateY(0);
}

.pwa-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
}

.pwa-text {
    flex: 1;
}

.pwa-text h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.pwa-text p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.pwa-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}

.pwa-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

/* iOS Specific instructions */
.ios-pwa-instruction {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-top: 5px;
    display: none;
}