/* RESET & BASIC SETUP */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Remove web tap highlight */
}

/* Hide scrollbars for true native feel */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    background: #000000;
    color: #ffffff;
    min-height: 100vh;
    overscroll-behavior-y: none;
    /* Prevent bounce scrolling on mobile */
    overscroll-behavior-x: none;
    padding-bottom: 70px;
    /* Space for the bottom nav */
}

/* HEADER */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* GRID LAYOUT */
.content-area {
    padding: 10px;
    /* Minimal padding for edge-to-edge feel on mobile */
    max-width: 1200px;
    margin: 0 auto;
}

.movie-grid {
    display: grid;
    /* 2 columns minimal responsive grid */
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    /* Tighter gap for native mobile app feel */
}

@media (min-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .movie-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* MOVIE CARD - NATIVE FEEL (No thick borders, minimal radius) */
.movie-card {
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    flex-direction: column;
}

.movie-card:active {
    transform: scale(0.96);
    opacity: 0.8;
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.view-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.loading-indicator {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* MODAL POPUP */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.modal-content {
    width: 100%;
    max-width: 450px;
    padding: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.modal-poster {
    width: 120px;
    border-radius: 10px;
    aspect-ratio: 9/16;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-info h2 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.modal-info p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    border: none;
    outline: none;
}

.btn-primary {
    background: #e50914;
    /* Netflix red inspired */
    color: #fff;
}

.btn-primary:active {
    background: #b20710;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-secondary.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.timer-text {
    text-align: center;
    font-size: 14px;
    color: #ffb703;
    font-weight: 500;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
}

.btn-close:active {
    color: #fff;
}

/* AD OVERLAY */
.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ad-timer-text {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

#ad-countdown {
    color: #ffb703;
    font-weight: bold;
    font-size: 22px;
}

.btn-close-ad {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-close-ad:hover {
    background: rgba(255, 255, 255, 0.1);
}

#ad-iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    display: block;
}

/* BOTTOM NAVIGATION (NATIVE APP STYLE) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 990;
    padding-bottom: env(safe-area-inset-bottom);
    /* iOS support */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    gap: 4px;
    transition: color 0.2s;
    flex: 1;
    height: 100%;
}

.nav-item.active {
    color: #fff;
}

.nav-icon {
    font-size: 20px;
}

@media (min-width: 768px) {
    .movie-grid {
        gap: 16px;
    }

    .content-area {
        padding: 30px;
    }

    .bottom-nav {
        display: none;
    }

    /* Hide bottom nav on desktop, they use the header */
    body {
        padding-bottom: 0;
    }
}