/* ======================== BASE & RESET ======================== */
:root {
    --primary-color: #f00; /* Merah menyala, khas streaming */
    --secondary-color: #333;
    --background-dark: #141414;
    --card-background: #222;
    --text-light: #f4f4f4;
    --text-muted: #aaa;
    --font-family: 'Poppins', sans-serif;
    --nav-height: 55px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-dark);
    color: var(--text-light);
    min-height: 100vh;
    padding-bottom: var(--nav-height); /* Ruang untuk bottom nav */
}

a {
    color: var(--text-light);
    text-decoration: none;
}

/* ======================== HEADER & NAVIGASI ATAS ======================== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--background-dark);
    padding: 10px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    height: 30px; /* Ukuran logo */
}

.search-icon {
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

.search-icon:hover {
    color: var(--primary-color);
}

/* ======================== BOTTOM NAV ======================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: #000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 20;
    border-top: 1px solid #333;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

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

.nav-item:hover {
    color: var(--primary-color);
}

/* ======================== HOME VIEW (MAIN CONTENT) ======================== */
.main-view {
    padding: 0 0 15px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.hidden-view {
    display: none !important;
}

/* Hero Section */
.hero-section {
    height: 350px;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
    position: relative;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
}

.hero-overlay h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.hero-overlay p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Button */
.primary-btn {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.primary-btn:hover {
    background-color: #e50914;
}

.large-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
}

/* Video Rows */
.video-row {
    padding: 0 15px 15px 15px;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.video-list-container {
    display: flex;
    overflow-x: scroll;
    gap: 10px;
    padding-bottom: 10px; /* Ruang untuk scrollbar */
    -webkit-overflow-scrolling: touch; /* Untuk iOS smooth scrolling */
}

/* Hide scrollbar for aesthetics, but keep scrolling */
.video-list-container::-webkit-scrollbar {
    display: none;
}

.video-list-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Video Card */
.video-card {
    min-width: 140px;
    width: 140px;
    cursor: pointer;
    background-color: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    width: 100%;
    height: 80px;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.play-icon {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.video-card:hover .play-icon {
    opacity: 1;
}

.video-info {
    padding: 8px;
}

.video-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.video-genre {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 300;
}


/* ======================== MODAL STYLES ======================== */
.modal {
    display: none; /* Default hidden */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--background-dark);
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

.close-btn {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 101;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* Detail View */
#movieDetailsView {
    display: flex;
    gap: 20px;
}

.modal-poster {
    width: 35%;
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.modal-info {
    width: 65%;
}

.modal-info h2 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.modal-genre-tag {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-description {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Player View */
.player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
}

#videoPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ======================== EXPLORE PAGE ======================== */
.explore-header {
    padding: 15px;
    margin-bottom: 15px;
}

.explore-header h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.search-bar {
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px;
    border-radius: 20px;
    border: 1px solid #444;
    background-color: #333;
    color: var(--text-light);
    font-size: 1rem;
}

.search-bar .fas.fa-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.explore-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Responsif */
    gap: 15px;
    padding: 0 15px;
}

.explore-grid-container .video-card {
    width: auto;
    min-width: 0;
}

.no-results {
    padding: 20px 15px;
    color: var(--text-muted);
    font-style: italic;
    grid-column: 1 / -1; /* Ambil seluruh kolom */
}

/* ======================== DUMMY/SUPPORT PAGE ======================== */
.dummy-page-content {
    padding: 30px 15px;
    text-align: center;
    min-height: 70vh;
}

.dummy-page-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.dummy-page-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.social-links {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.social-btn:hover {
    opacity: 0.8;
}

.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.tiktok {
    background-color: #000;
    border: 2px solid var(--text-light);
}

.policy-links {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.policy-links a {
    color: var(--text-muted);
    transition: color 0.3s;
}

.policy-links a:hover {
    color: var(--primary-color);
}

/* ======================== MEDIA QUERIES (Responsif) ======================== */

/* Desktop/Tablet */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }

    .main-header {
        position: static;
        padding: 15px 30px;
    }
    
    .header-content {
        justify-content: flex-start;
        gap: 30px;
    }
    
    .logo {
        height: 40px;
    }

    .search-area {
        display: none; /* Sembunyikan icon search di header, fokus di halaman Explore */
    }

    /* Tambahkan navigasi samping atau atas jika mau */

    .hero-section {
        height: 450px;
        margin-bottom: 40px;
    }
    
    .video-row {
        padding: 0 30px 25px 30px;
    }

    .video-card {
        width: 180px;
        min-width: 180px;
    }

    .video-thumbnail {
        height: 100px;
    }
    
    .explore-header {
        padding: 30px;
    }

    .explore-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        padding: 0 30px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }

    #movieDetailsView {
        flex-direction: column;
    }

    .modal-poster {
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .modal-info {
        width: 100%;
    }
    
    .explore-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .video-card {
        min-width: 100px;
        width: 100px;
    }
}

