/**
 * BP Group Hierarchy — Main Styles
 * @since 2.0.0
 */

/* ============================================================
 * Shortcode Grid / List Layouts
 * ============================================================ */

.bpgh-sc-grid {
    display: grid;
    grid-template-columns: repeat(var(--bpgh-cols, 3), 1fr);
    gap: 16px;
}

.bpgh-sc-list .bpgh-sc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.bpgh-sc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.bpgh-sc-item:hover {
    background: #f9f9f9;
}

.bpgh-sc-child {
    padding-left: 32px;
    position: relative;
}

.bpgh-sc-child::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.bpgh-sc-avatar img {
    border-radius: 50%;
}

.bpgh-sc-name {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

.bpgh-sc-name:hover {
    color: #0073aa;
}

.bpgh-sc-members {
    font-size: 12px;
    color: #888;
}

.bpgh-sc-children {
    grid-column: 1 / -1;
}

/* ============================================================
 * Shortcode Pagination
 * ============================================================ */

.bpgh-sc-pagination {
    margin-top: 20px;
    text-align: center;
}

.bpgh-sc-pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
}

.bpgh-sc-pagination a.bpgh-active,
.bpgh-sc-pagination a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* ============================================================
 * Enhanced Directory
 * ============================================================ */

.bpgh-enhanced-directory {
    margin: 20px 0;
}

.bpgh-directory-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 6px;
}

.bpgh-directory-filters select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.bpgh-type-tabs {
    display: flex;
    gap: 4px;
}

.bpgh-type-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    color: #555;
    background: #fff;
    transition: all 0.15s;
}

.bpgh-type-tab.bpgh-active,
.bpgh-type-tab:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.bpgh-directory-search {
    margin-bottom: 16px;
}

.bpgh-tag-search {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* ============================================================
 * AJAX Group Cards
 * ============================================================ */

.bpgh-filtered-groups {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bpgh-group-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.bpgh-group-card:hover {
    background: #fafafa;
}

.bpgh-card__avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

.bpgh-card__name {
    margin: 0 0 4px;
    font-size: 15px;
}

.bpgh-card__name a {
    color: #1a1a1a;
    text-decoration: none;
}

.bpgh-card__name a:hover {
    color: #0073aa;
}

.bpgh-card__category {
    display: inline-block;
    background: #e8f4fd;
    color: #0073aa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-bottom: 4px;
}

.bpgh-card__desc {
    margin: 4px 0;
    color: #666;
    font-size: 13px;
}

.bpgh-card__tags {
    margin: 4px 0;
}

.bpgh-card__meta {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.bpgh-card__parent {
    font-style: italic;
}

/* ============================================================
 * AJAX Pagination
 * ============================================================ */

.bpgh-pagination {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.bpgh-pagination a {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #555;
    font-size: 12px;
}

.bpgh-pagination a.bpgh-active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* No results */
.bpgh-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.bpgh-loading {
    text-align: center;
    padding: 30px;
    color: #888;
}

/* ============================================================
 * Widget Styles
 * ============================================================ */

/* Parent Groups Widget */
.bpgh-parent-groups-widget {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bpgh-pw-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bpgh-pw-item:last-child {
    border-bottom: none;
}

.bpgh-pw-avatar img {
    border-radius: 50%;
}

.bpgh-pw-info a {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

.bpgh-pw-info a:hover {
    color: #0073aa;
}

.bpgh-pw-meta {
    display: block;
    font-size: 11px;
    color: #999;
}

/* Child Groups Widget */
.bpgh-child-groups-widget {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bpgh-cw-item {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bpgh-cw-item:last-child {
    border-bottom: none;
}

.bpgh-cw-item img {
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
}

.bpgh-cw-item a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

.bpgh-cw-item a:hover {
    color: #0073aa;
}

.bpgh-cw-count {
    color: #999;
    font-size: 11px;
}

.bpgh-cw-sub {
    list-style: none;
    padding-left: 24px;
    margin: 4px 0 0;
    border-left: 2px solid #eee;
}

/* Category Filter Widget */
.bpgh-cat-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bpgh-cat-filter-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bpgh-cat-filter-list li:last-child {
    border-bottom: none;
}

.bpgh-cat-filter-list a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

.bpgh-cat-filter-list a:hover,
.bpgh-cat-filter-list .bpgh-active a {
    color: #0073aa;
    font-weight: 600;
}

.bpgh-count {
    color: #999;
    font-size: 11px;
}

/* Tag Cloud Widget */
.bpgh-tag-cloud-widget {
    line-height: 2;
}

.bpgh-cloud-tag {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
    color: #555;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

.bpgh-cloud-tag:hover {
    background: #0073aa;
    color: #fff;
}

/* Tag Search Widget */
.bpgh-tag-search-widget {
    position: relative;
}

.bpgh-tag-search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.bpgh-tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.bpgh-tag-suggestions a {
    display: block;
    padding: 6px 10px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

.bpgh-tag-suggestions a:hover {
    background: #f0f0f0;
}

.bpgh-tag-search-btn {
    margin-top: 6px;
    padding: 6px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.bpgh-tag-search-btn:hover {
    background: #005a87;
}

/* ============================================================
 * Premium Backgrounds
 * ============================================================ */

.bpgh-premium-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.bpgh-premium-bg--image,
.bpgh-premium-bg--animated {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bpgh-premium-bg--video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
 * Breadcrumbs
 * ============================================================ */

.bpgh-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.bpgh-breadcrumbs li::after {
    content: ' \203A ';
    margin-left: 4px;
    color: #999;
}

.bpgh-breadcrumbs li:last-child::after {
    content: '';
}

.bpgh-breadcrumbs a {
    color: #0073aa;
    text-decoration: none;
}

.bpgh-breadcrumbs a:hover {
    text-decoration: underline;
}

.bpgh-breadcrumbs .bpgh-current {
    color: #666;
    font-weight: 600;
}

/* Parent label in header */
.bpgh-parent-label {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
}

.bpgh-parent-label a {
    color: #0073aa;
}

/* Children list on group page */
.bpgh-children-list {
    margin: 16px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.bpgh-children-list h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.bpgh-children-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bpgh-children-list li {
    padding: 4px 0;
}

.bpgh-children-list a {
    color: #0073aa;
    text-decoration: none;
}

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 768px) {
    .bpgh-sc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bpgh-directory-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .bpgh-type-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .bpgh-sc-grid {
        grid-template-columns: 1fr;
    }

    .bpgh-group-card {
        flex-direction: column;
        gap: 8px;
    }
}
