/* ==========================================================================
   CROSOFTFILM WEBCLIENT - RESPONSIVE BROWSE CATALOG (Mobile, Tablet, Desktop)
   Page Scope: .ns-page-browse
   ========================================================================== */

.ns-page-browse {
    padding-top: calc(var(--header-height, 72px) + 20px);
    padding-bottom: 80px;
}

/* 1. Header Page Title & Counter */
.ns-page-browse .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.ns-page-browse .page-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

@media (min-width: 768px) {
    .ns-page-browse .page-title {
        font-size: 24px;
    }
}

.ns-page-browse .page-count {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 3px 10px;
    white-space: nowrap;
}

.ns-page-browse .page-count strong {
    color: #ffffff;
    font-weight: 700;
}

/* 2. Mobile Search Bar (< 768px) */
.ns-page-browse .search-mobile {
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .ns-page-browse .search-mobile {
        display: none !important;
    }
}

.ns-page-browse .search-input-wrap {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 38px;
    padding: 0 10px 0 12px;
    transition: all 0.2s ease;
}

.ns-page-browse .search-input-wrap:focus-within {
    border-color: #ef4444;
    background: rgba(255, 255, 255, 0.08);
}

.ns-page-browse .search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13.5px;
}

.ns-page-browse .search-input::placeholder {
    color: #9ca3af;
    font-size: 13px;
}

.ns-page-browse .search-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ns-page-browse .search-btn:hover {
    color: #ef4444;
}

.ns-page-browse .search-clear {
    color: #9ca3af;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.ns-page-browse .search-clear:hover {
    color: #ffffff;
}

/* 3. Filter Bar & Reset Link */
.ns-page-browse .filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin-bottom: 24px;
}

@media (max-width: 767.98px) {
    .ns-page-browse .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
        margin-bottom: 18px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ns-page-browse .filter-bar::-webkit-scrollbar {
        display: none;
    }
}

@media (min-width: 768px) {
    .ns-page-browse .filter-bar {
        flex-wrap: wrap;
    }
}

.ns-page-browse .reset-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none !important;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.ns-page-browse .reset-link:hover {
    color: #ef4444;
    background: rgba(229, 9, 20, 0.08);
}

/* 4. Movie Grid */
.ns-page-browse .movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

@media (max-width: 575.98px) {
    .ns-page-browse .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.ns-page-browse .movie-grid .ns-movie-card {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
}

/* 5. Pagination */
.ns-page-browse .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.ns-page-browse .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #d1d5db;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.ns-page-browse .page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.ns-page-browse .page-btn.active {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    font-weight: 700;
}

/* 6. Empty State */
.ns-page-browse .empty-state {
    text-align: center;
    padding: 60px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}