/* ================================================
   ZONAPLUS - MINIMALIST MOBILE-FIRST DESIGN
   3 Columns Layout with Banner Ad Spots
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e50914;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #2a2a2a;
    --accent-color: #46d369;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER - MINIMALIST
   ============================================ */
.header {
    background: var(--bg-card);
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.header-search {
    flex: 1;
    max-width: 200px;
    margin: 0 10px;
}

.header-search input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.header-menu {
    display: none;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* ============================================
   BANNER AD SPOT - FULL WIDTH
   ============================================ */
.ad-banner {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
    min-height: 50px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-banner iframe {
    width: 100%;
    min-height: 60px;
    border: none;
}

.ad-placeholder {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 20px;
    text-align: center;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.main-container {
    padding: 12px;
    max-width: 100%;
}

/* Section Title */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title .see-all {
    font-size: 12px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 400;
}

/* ============================================
   MOVIE GRID - 3 COLUMNS FOR MOBILE
   ============================================ */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.movie-card {
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
    position: relative;
}

.movie-card:active {
    transform: scale(0.95);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 6px;
}

.movie-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.movie-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-secondary);
}

.movie-year {
    font-size: 10px;
}

.movie-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.movie-rating i {
    color: #ffc107;
    font-size: 10px;
}

/* ============================================
   HERO SECTION (Optional)
   ============================================ */
.hero-section {
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.hero-card {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 100%);
    padding: 12px;
}

.hero-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.hero-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   CATEGORY PILLS
   ============================================ */
.category-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.category-pill {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.category-pill:active {
    background: var(--bg-hover);
}

/* ============================================
   FOOTER - MINIMALIST
   ============================================ */
.footer {
    background: var(--bg-card);
    padding: 20px 12px;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 11px;
}

/* ============================================
   SEARCH & FILTER PAGES
   ============================================ */
.page-header {
    margin-bottom: 16px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 20px 0;
    padding: 0 12px;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
}

.pagination .active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 13px;
}

.spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   MOBILE NAVIGATION OVERLAY
   ============================================ */
#mobile-nav-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 9999;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.5);
}

#mobile-nav-container.active {
    right: 0;
}

#mobile-nav-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 32px;
    padding: 0;
}

#mobile-nav-container nav {
    padding: 60px 0 20px 0;
}

#mobile-nav-container nav > a {
    display: block;
    padding: 15px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

#mobile-nav-container nav > a:active {
    background: var(--bg-hover);
}

.mobile-dropdown {
    border-bottom: 1px solid var(--border-color);
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.mobile-dropdown-toggle:active {
    background: var(--bg-hover);
}

.mobile-dropdown-toggle span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-dropdown-toggle i {
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.mobile-dropdown-toggle.active i {
    transform: rotate(45deg);
}

.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-dark);
}

.mobile-dropdown-content.active {
    max-height: 500px;
    overflow-y: auto;
}

.mobile-dropdown-content a {
    display: block;
    padding: 12px 20px 12px 35px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    transition: all 0.2s;
}

.mobile-dropdown-content a:active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Overlay backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: none;
}

.mobile-nav-backdrop.active {
    display: block;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#search-overlay.active {
    display: flex;
}

#search-overlay-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 40px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    line-height: 40px;
}

.search-overlay-bar {
    width: 100%;
    max-width: 600px;
}

.search-overlay-bar input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

.search-overlay-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
   RESPONSIVE - TABLET & DESKTOP
   ============================================ */
@media (min-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }

    .main-container {
        padding: 20px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .section-title {
        font-size: 20px;
    }

    .movie-title {
        font-size: 13px;
    }

    .hero-card {
        height: 400px;
    }

    .header-search {
        max-width: 320px;
    }

    .header-menu {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .header-menu .nav-link {
        display: flex;
        align-items: center;
        gap: 6px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        padding: 7px 14px;
        border-radius: 4px;
        transition: background 0.15s, color 0.15s;
        white-space: nowrap;
    }

    .header-menu .nav-link:hover,
    .header-menu .nav-link.active {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 500;
        padding: 7px 14px;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
        white-space: nowrap;
        font-family: inherit;
    }

    .nav-dropdown-btn:hover,
    .nav-dropdown.open .nav-dropdown-btn {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .nav-dropdown-btn i {
        font-size: 10px;
        transition: transform 0.2s;
    }

    .nav-dropdown.open .nav-dropdown-btn i {
        transform: rotate(180deg);
    }

    .nav-dropdown-menu {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        min-width: 180px;
        max-height: 360px;
        overflow-y: auto;
        z-index: 2000;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) transparent;
    }

    .nav-dropdown-menu::-webkit-scrollbar {
        width: 4px;
    }

    .nav-dropdown-menu::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        display: block;
        padding: 9px 16px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 13px;
        border-bottom: 1px solid rgba(42,42,42,0.5);
        transition: background 0.15s, color 0.15s;
    }

    .nav-dropdown-menu a:last-child {
        border-bottom: none;
    }

    .nav-dropdown-menu a:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .mobile-menu-btn {
        display: none;
    }

    .ad-banner {
        min-height: 50px;
        max-height: 50px;
    }
}

/* ============================================
   AD POSITIONS - STRATEGIC PLACEMENTS
   ============================================ */
.ad-top {
    margin: 4px 0;
}

.ad-between-sections {
    margin: 6px 0;
}

.ad-bottom {
    margin: 6px 0 4px 0;
}

.ad-floating {
    position: sticky;
    bottom: 0;
    z-index: 999;
    margin: 0;
    border-radius: 0;
}

/* Hide ads in certain contexts */
.no-ads .ad-banner {
    display: none;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
    display: none;
}
