/* ============================================================
 * BP Download Manager — Frontend Styles
 * List layout + Multi-file download buttons + Single + Archive
 * ============================================================ */

:root {
    --bp-primary: #0fa578;
    --bp-primary-dark: #0d8a64;
    --bp-primary-light: #e8f8f2;
    --bp-gray-50: #f9fafb;
    --bp-gray-100: #f3f4f6;
    --bp-gray-200: #e5e7eb;
    --bp-gray-300: #d1d5db;
    --bp-gray-500: #6b7280;
    --bp-gray-700: #374151;
    --bp-gray-900: #111827;
    --bp-radius: 8px;
    --bp-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

/* ============================================================
 * COMMON
 * ============================================================ */

.bp-downloads-wrapper,
.bp-archive-download,
.bp-single-download {
    font-family: "Poppins", Noto Sans Thai, Sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* ============================================================
 * FILTER BAR
 * ============================================================ */

.bp-downloads-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 3px;
    padding-bottom: 18px;
    border-bottom: 0px solid var(--bp-gray-200);
}

.bp-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bp-gray-700);
    background: var(--bp-gray-100);
    border: 1px solid var(--bp-gray-200);
    border-radius: 50px;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.bp-filter-btn:hover {
    background: var(--bp-primary-light);
    color: var(--bp-primary);
    border-color: var(--bp-primary);
    text-decoration: none;
}

.bp-filter-btn.active {
    background: var(--bp-primary);
    color: #fff;
    border-color: var(--bp-primary);
}

.bp-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, .08);
    border-radius: 50px;
    line-height: 1;
}

.bp-filter-btn.active .bp-filter-count {
    background: rgba(255, 255, 255, .25);
}

/* ============================================================
 * LIST ROWS
 * ============================================================ */

.bp-downloads-list {
    border: 1px solid var(--bp-gray-200);
    border-radius: var(--bp-radius);
    overflow: hidden;
    background: #fff;
}

.bp-dl-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--bp-gray-200);
    transition: background .15s ease;
}

.bp-dl-row:last-child {
    border-bottom: none;
}

.bp-dl-row--even {
    background: var(--bp-gray-50);
}

.bp-dl-row:hover {
    background: var(--bp-primary-light);
}

/* Info (title + tags) */
.bp-dl-row__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bp-dl-row__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--bp-gray-900);
    text-decoration: none;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bp-dl-row__title:hover {
    color: var(--bp-primary);
    text-decoration: none;
}

/* Category Tags */
.bp-dl-row__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bp-dl-tag {
    display: inline-block;
    padding: 1px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #e74c3c;
    border-radius: 3px;
    text-decoration: none;
    letter-spacing: .02em;
    line-height: 1.6;
}

.bp-dl-tag:hover {
    opacity: .85;
    color: #fff;
    text-decoration: none;
}

.bp-dl-tag--blue {
    background: #3498db;
}

/* Download count */
.bp-dl-row__count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bp-gray-500);
    min-width: 50px;
    justify-content: flex-end;
}

.bp-dl-row__count svg {
    width: 14px;
    height: 14px;
    opacity: .6;
}

/* ============================================================
 * SEARCH BOX
 * ============================================================ */

.bp-downloads-search {
    margin-bottom: 20px;
}

.bp-search-form {
    display: flex;
    gap: 8px;
}

.bp-search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.bp-search-icon {
    position: absolute;
    left: 14px;
    color: var(--bp-gray-500);
    pointer-events: none;
}

.bp-search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    font-size: 14px;
    border: 1px solid var(--bp-gray-200);
    border-radius: 8px;
    background: #fff;
    color: var(--bp-gray-900);
    outline: none;
    transition: border-color .2s ease;
}

.bp-search-input:focus {
    border-color: var(--bp-primary);
    box-shadow: 0 0 0 3px rgba(15, 165, 120, .12);
}

.bp-search-input::placeholder {
    color: var(--bp-gray-300);
}

.bp-search-clear {
    position: absolute;
    right: 10px;
    font-size: 20px;
    color: var(--bp-gray-500);
    text-decoration: none;
    line-height: 1;
    padding: 4px;
}

.bp-search-clear:hover {
    color: var(--bp-gray-900);
    text-decoration: none;
}

.bp-search-btn {
    flex-shrink: 0;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--bp-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s ease;
}

.bp-search-btn:hover {
    background: var(--bp-primary-dark);
}

.bp-search-result-text {
    font-size: 14px;
    color: var(--bp-gray-500);
    margin: 0 0 12px;
}

/* ============================================================
 * MULTI-FILE DOWNLOAD BUTTONS (per-row)
 * ============================================================ */

.bp-dl-row__files {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 280px;
}

.bp-dl-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #fff !important;
    background: var(--bp-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .2s ease, transform .15s ease;
    line-height: 1.4;
    overflow: hidden;
}

.bp-dl-file-btn:hover {
    background: var(--bp-primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.bp-dl-file-btn__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    width: 20px;
    height: 20px;
}

.bp-dl-file-btn__icon svg {
    width: 20px;
    height: 20px;
    filter: brightness(1) saturate(1);
}

.bp-dl-file-btn__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    font-size: 12px;
}

.bp-dl-file-btn__dl {
    flex-shrink: 0;
    opacity: .7;
}

/* Large download button for single page */
.bp-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    background: var(--bp-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .2s ease, transform .15s ease;
    line-height: 1.4;
}

.bp-dl-btn:hover {
    background: var(--bp-primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.bp-dl-btn svg {
    flex-shrink: 0;
}

.bp-dl-btn--lg {
    padding: 12px 32px;
    font-size: 15px;
    border-radius: 8px;
}

/* Single page file list buttons */
.bp-single__files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bp-single-file-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid var(--bp-gray-200);
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--bp-gray-900) !important;
    transition: all .2s ease;
}

.bp-single-file-btn:hover {
    border-color: var(--bp-primary);
    background: var(--bp-primary-light);
    color: var(--bp-gray-900) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.bp-single-file-btn__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 36px;
    height: 36px;
}

.bp-single-file-btn__icon svg {
    width: 36px;
    height: 36px;
}

.bp-single-file-btn__info {
    flex: 1;
    min-width: 0;
}

.bp-single-file-btn__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--bp-gray-900);
    line-height: 1.3;
    word-break: break-all;
}

.bp-single-file-btn__size {
    display: block;
    font-size: 12px;
    color: var(--bp-gray-500);
    margin-top: 2px;
}

.bp-single-file-btn__dl {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--bp-primary);
    border-radius: 6px;
    transition: background .2s ease;
    white-space: nowrap;
}

.bp-single-file-btn:hover .bp-single-file-btn__dl {
    background: var(--bp-primary-dark);
}

/* Empty */
.bp-downloads-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--bp-gray-500);
    font-size: 15px;
}

/* ============================================================
 * BREADCRUMB
 * ============================================================ */

.bp-breadcrumb {
    font-family: "Poppins", Noto Sans Thai, Sans-serif;
    font-size: 13px;
    color: var(--bp-gray-500);
    margin-bottom: 20px;
    padding: 10px 0;
}

.bp-breadcrumb a {
    color: var(--bp-primary);
    text-decoration: none;
}

.bp-breadcrumb a:hover {
    text-decoration: underline;
}

.bp-breadcrumb__sep {
    margin: 0 6px;
    color: var(--bp-gray-300);
}

.bp-breadcrumb__current {
    color: var(--bp-gray-700);
    font-weight: 500;
}

/* ============================================================
 * ARCHIVE PAGE
 * ============================================================ */

.bp-archive__header {
    margin-bottom: 24px;
}

.bp-archive__title {
    font-family: "Poppins", Noto Sans Thai, Sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--bp-gray-900);
    margin: 0 0 6px;
}

.bp-archive__desc {
    font-size: 14px;
    color: var(--bp-gray-500);
    margin: 0;
}

.bp-archive__pagination {
    margin-top: 28px;
    text-align: center;
}

.bp-archive__pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.bp-archive__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    color: var(--bp-gray-700);
    background: var(--bp-gray-100);
    border: 1px solid var(--bp-gray-200);
    border-radius: 6px;
    text-decoration: none;
    transition: all .2s ease;
}

.bp-archive__pagination .page-numbers:hover {
    background: var(--bp-primary-light);
    color: var(--bp-primary);
    border-color: var(--bp-primary);
}

.bp-archive__pagination .page-numbers.current {
    background: var(--bp-primary);
    color: #fff;
    border-color: var(--bp-primary);
}

/* ============================================================
 * SINGLE PAGE
 * ============================================================ */

.bp-single__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

.bp-single__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-single__icon svg {
    width: 52px;
    height: 52px;
}

.bp-single__title-wrap {
    flex: 1;
}

.bp-single__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--bp-gray-900);
    margin: 0 0 8px;
    line-height: 1.35;
}

.bp-single__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* File Info Box */
.bp-single__file-box {
    background: #fff;
    border: 1px solid var(--bp-gray-200);
    border-radius: var(--bp-radius);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--bp-shadow);
}

.bp-single__file-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--bp-gray-900);
    margin: 0 0 16px;
}

/* Content */
.bp-single__content {
    margin-bottom: 32px;
}

.bp-single__content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--bp-gray-900);
    margin: 0 0 12px;
}

.bp-single__content p {
    font-size: 15px;
    color: var(--bp-gray-700);
    line-height: 1.7;
}

/* Related */
.bp-single__related {
    margin-top: 32px;
}

.bp-single__related h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--bp-gray-900);
    margin: 0 0 16px;
}

/* ============================================================
 * RESPONSIVE
 * ============================================================ */

@media (max-width: 768px) {
    .bp-dl-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .bp-dl-row__info {
        flex: 1 1 100%;
        min-width: 0;
    }

    .bp-dl-row__files {
        max-width: 100%;
        width: 100%;
    }

    .bp-dl-file-btn {
        width: 100%;
    }

    .bp-single__header {
        flex-direction: column;
        gap: 12px;
    }

    .bp-single-file-btn {
        flex-wrap: wrap;
    }

    .bp-single-file-btn__dl {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bp-downloads-filter {
        gap: 6px;
    }

    .bp-filter-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .bp-single__title {
        font-size: 18px;
    }

    .bp-archive__title {
        font-size: 22px;
    }
}


