
/* BLUEBOX SCRIPTS LIBRARY */

.bb-library {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 15px;
    box-sizing: border-box;
}

.bb-library *,
.bb-library *::before,
.bb-library *::after {
    box-sizing: border-box;
}


/* HEADING */

.bb-library .bb-library-heading {
    background: #173858;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 35px;
}

.bb-library .bb-library-heading h1 {
    color: #fff;
    font-size: 32px;
    margin: 0 0 12px;
}

.bb-library .bb-library-heading h2 {
    color: #ffffff !important;
}

.bb-library .bb-library-heading p {
    color: #ffffff !important;
    margin: 0;
    line-height: 1.7;
}


/* SECTIONS */

.bb-library section {
    margin-bottom: 35px;
}

.bb-library section h2 {
    color: #173858;
    font-size: 23px;
    margin-bottom: 18px;
}


/* CATEGORIES */

.bb-library .bb-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.bb-library .bb-category-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 22px;
    background: #fff;
    border: 1px solid #dfe6ed;
    border-radius: 10px;
    text-decoration: none;
}

.bb-library .bb-category-card:hover {
    border-color: #2685c7;
    background: #f7fbff;
}

.bb-library .bb-category-card.active {
    border: 2px solid #2685c7;
    background: #f2f8fd;
}

.bb-library .bb-category-card h3 {
    color: #173858;
    font-size: 17px;
    margin: 12px 0;
}

.bb-library .bb-category-card p {
    color: #647386;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.bb-library .bb-count {
    align-self: flex-end;
    color: #1769aa;
    font-weight: 700;
}


/* SEARCH */

.bb-library .bb-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bb-library .bb-filter-form input,
.bb-library .bb-filter-form select {
    flex: 1;
    min-width: 140px;
    min-height: 45px;
    padding: 10px;
    border: 1px solid #d5dce5;
    border-radius: 6px;
}

.bb-library .bb-filter-form button {
    background: #1769aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    cursor: pointer;
}

.bb-library .bb-filter-form a {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: #edf1f5;
    border-radius: 6px;
    text-decoration: none;
}


/* RESULTS */

.bb-library .bb-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.bb-library .bb-results-heading span {
    color: #647386;
    font-size: 14px;
}


/* FILE CARDS - ORIGINAL DIMENSIONS */

.bb-library .bb-script-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.bb-library .bb-script-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    background: #fff;
    border: 1px solid #dfe6ed;
    border-radius: 10px;
}


/* =========================================
   TOP ROW - SINGLE LINE
========================================= */

.bb-library .bb-card-top-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
}


/* FILE TYPE - LEFT */

.bb-library .bb-card-top-row .bb-file-type {
    display: inline-block !important;
    flex: 0 0 auto !important;
    background: #e8f2fb !important;
    color: #1769aa !important;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    margin: 0 !important;
    white-space: nowrap;
}


/* CATEGORY AND GROUP - RIGHT */

.bb-library .bb-card-top-row .bb-script-meta {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    gap: 6px;
}


/* CATEGORY BADGES - ORIGINAL COLOURS */

.bb-library .bb-card-top-row .bb-script-meta span {
    display: inline-block !important;
    flex: 0 1 auto !important;
    background: #f0f3f6 !important;
    color: #333 !important;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 11px;
    line-height: normal;
    white-space: nowrap;
    margin: 0 !important;
}


/* SCRIPT TITLE */

.bb-library .bb-script-card h3 {
    color: #173858;
    font-size: 18px;
    margin: 14px 0 8px;
}


/* DESCRIPTION */

.bb-library .bb-script-card p {
    color: #647386;
    font-size: 14px;
    line-height: 1.7;
}


/* DOWNLOAD BUTTON - ORIGINAL STYLING */

.bb-library .bb-download {
    display: inline-block;
    margin-top: auto;
    padding: 12px 18px;
    background: #1769aa;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.bb-library .bb-download:hover {
    background: #104b7c;
    color: #fff;
}


/* WARNINGS */

.bb-library .bb-warning {
    width: 100%;
    padding: 12px;
    background: #fff5e8;
    border-left: 3px solid #d97706;
    margin-bottom: 15px;
    font-size: 12px;
}


/* EMPTY RESULTS */

.bb-library .bb-no-results {
    padding: 30px;
    background: #f5f7fa;
    border-radius: 8px;
}


/* TABLET */

@media (max-width: 850px) {
    .bb-library .bb-category-grid,
    .bb-library .bb-script-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* MOBILE */

@media (max-width: 550px) {
    .bb-library .bb-category-grid,
    .bb-library .bb-script-grid {
        grid-template-columns: 1fr;
    }

    .bb-library .bb-filter-form {
        flex-direction: column;
    }

    .bb-library .bb-filter-form input,
    .bb-library .bb-filter-form select,
    .bb-library .bb-filter-form button,
    .bb-library .bb-filter-form a {
        width: 100%;
    }

    .bb-library .bb-library-heading {
        padding: 25px;
    }

    .bb-library .bb-library-heading h1 {
        font-size: 26px;
    }
}


