/**
 * Hello Middleton — Community Board
 * Modern overhaul of BuddyPress Nouveau activity stream.
 * Targets: /community-board/
 *
 * Design goals:
 *  - Clean, editorial feel — NOT a Facebook clone
 *  - Cards with breathing room, clear hierarchy
 *  - Pill nav, minimal chrome
 *  - Teal accent system matching community hub
 *
 * @since HM 3.6.0
 */

/* ==========================================================================
   PAGE WRAPPER — remove BuddyX chrome
   ========================================================================== */

.page-id-194 .buddypress-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hide the redundant "All Members" nav label — confusing on community board */
/* The activity-type-navs only has one item ("All Members") — hide the whole nav */
.page-id-194 .activity-type-navs,
.page-id-194 .bp-dir-hori-nav > nav:not(.activity-type-navs) {
    display: none !important;
}

/* Hide RSS feed link — nobody uses it */
.page-id-194 #activity-rss-feed,
.page-id-194 #activity-stream-rss {
    display: none;
}

/* Hide "Show:" filter dropdown — cleaner UX without it */
.page-id-194 #dir-filters,
.page-id-194 #subnav-filters .component-filters {
    display: none;
}

/* Hide the "Search Activity..." screen reader label */
.page-id-194 .dir-search label {
    display: none;
}

/* Tighten up the subnav area */
.page-id-194 #subnav-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.page-id-194 .subnav-search {
    flex: 1;
}

/* Blog post type — hide the "Blogs" card-head label, it's noise */
#buddypress #activity-stream li .activity-card-head {
    display: none;
}

/* Page title — make it cleaner */
.page-id-194 .entry-title,
.page-id-194 h1.entry-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1a1a2e;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   ACTIVITY TYPE NAV — pill tabs, not Facebook tabs
   ========================================================================== */

#buddypress .activity-type-navs {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 50px;
    padding: 4px;
    display: inline-flex;
    gap: 2px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
}

#buddypress .activity-type-navs::-webkit-scrollbar { display: none; }

#buddypress .activity-type-navs li {
    list-style: none;
    flex-shrink: 0;
}

#buddypress .activity-type-navs li a {
    display: block;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

#buddypress .activity-type-navs li a:hover {
    background: rgba(13,148,136,0.08);
    color: #0f766e;
}

#buddypress .activity-type-navs li.selected a,
#buddypress .activity-type-navs li.current a {
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}

/* ==========================================================================
   ACTIVITY SEARCH — clean input
   ========================================================================== */

#buddypress .dir-search {
    margin-bottom: 1rem;
}

#buddypress .dir-search input[type="search"],
#buddypress .dir-search input[type="text"] {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    font-size: 0.9rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#buddypress .dir-search input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

#buddypress .dir-search input[type="submit"] {
    margin-top: 0.5rem;
    padding: 0.55rem 1.25rem;
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13,148,136,0.25);
}

/* ==========================================================================
   "WHAT'S NEW" COMPOSER
   ========================================================================== */

#buddypress #whats-new-form,
#buddypress #whats-new-navs {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 18px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

#buddypress #whats-new-navs {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    border-radius: 18px 18px 0 0;
    background: #fafafa;
}

#buddypress #whats-new-navs li {
    list-style: none;
    flex: 1;
}

#buddypress #whats-new-navs li a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

#buddypress #whats-new-navs li a:hover {
    color: #0d9488;
}

#buddypress #whats-new-navs li.current a,
#buddypress #whats-new-navs li.selected a {
    color: #0d9488;
    border-bottom-color: #0d9488;
}

#buddypress #whats-new-content {
    padding: 1rem 1.25rem 1.25rem;
    border-radius: 0 0 18px 18px;
}

#buddypress #whats-new,
#buddypress textarea#whats-new {
    width: 100%;
    min-height: 80px;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
    background: transparent;
    font-family: inherit;
    padding: 0;
}

#buddypress #whats-new::placeholder {
    color: #9ca3af;
}

#buddypress #whats-new-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.07);
    margin-top: 0.75rem;
}

#buddypress #whats-new-toolbar a,
#buddypress #whats-new-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

#buddypress #whats-new-toolbar a:hover,
#buddypress #whats-new-toolbar button:hover {
    border-color: #0d9488;
    color: #0d9488;
}

#buddypress #aw-whats-new-submit {
    margin-left: auto;
}

#buddypress #aw-whats-new-submit input[type="submit"],
#buddypress #aw-whats-new-submit button {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13,148,136,0.3);
    transition: opacity 0.2s, transform 0.2s;
}

#buddypress #aw-whats-new-submit input[type="submit"]:hover,
#buddypress #aw-whats-new-submit button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ==========================================================================
   ACTIVITY STREAM — the feed
   ========================================================================== */

#buddypress #activity-stream {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual activity item */
#buddypress #activity-stream li.activity-item {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 18px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

#buddypress #activity-stream li.activity-item:hover {
    box-shadow: 0 6px 24px rgba(13,148,136,0.1);
    border-color: rgba(45,212,191,0.25);
    transform: translateY(-1px);
}

/* Activity inner content */
#buddypress #activity-stream li .activity-inner {
    padding: 1.1rem 1.25rem 0.85rem;
}

/* Activity header — "Name posted an update" */
#buddypress #activity-stream li .activity-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

#buddypress #activity-stream li .activity-header p {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

#buddypress #activity-stream li .activity-header a {
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
}

#buddypress #activity-stream li .activity-header a:hover {
    color: #0d9488;
}

/* Avatar */
#buddypress #activity-stream li .activity-avatar {
    flex-shrink: 0;
}

#buddypress #activity-stream li .activity-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(13,148,136,0.15);
    display: block;
}

/* Activity content */
#buddypress #activity-stream li .activity-content {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #374151;
}

#buddypress #activity-stream li .activity-content p {
    margin: 0 0 0.5rem;
}

#buddypress #activity-stream li .activity-content p:last-child {
    margin-bottom: 0;
}

/* Post images within activity */
#buddypress #activity-stream li .rtmedia-list,
#buddypress #activity-stream li .activity-content img:not(.avatar) {
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.75rem;
    max-width: 100%;
}

/* Timestamp */
#buddypress #activity-stream li .activity-header .time-since,
#buddypress #activity-stream li .activity-header time {
    font-size: 0.73rem;
    color: #9ca3af;
    font-weight: 400;
    margin-left: auto;
    white-space: nowrap;
}

/* ==========================================================================
   ACTIVITY META — like, comment, delete row
   ========================================================================== */

#buddypress #activity-stream li .activity-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1.25rem 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

#buddypress #activity-stream li .activity-meta a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    background: rgba(0,0,0,0.03);
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#buddypress #activity-stream li .activity-meta a:hover {
    background: rgba(13,148,136,0.08);
    color: #0d9488;
    border-color: rgba(13,148,136,0.2);
}

/* Favorite / like button */
#buddypress #activity-stream li .activity-meta .bp-activity-read-more,
#buddypress #activity-stream li .activity-meta .acomment-reply,
#buddypress #activity-stream li .activity-meta .activity-favorite {
    color: #6b7280;
}

#buddypress #activity-stream li .activity-meta .activity-favorite.bp-activity-favorite a {
    color: #ef4444;
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.2);
}

/* Delete/spam — subtle */
#buddypress #activity-stream li .activity-meta .delete-activity a,
#buddypress #activity-stream li .activity-meta .spam-activity a {
    color: #d1d5db;
    font-size: 0.72rem;
    background: transparent;
}

#buddypress #activity-stream li .activity-meta .delete-activity a:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.06);
}

/* ==========================================================================
   ACTIVITY COMMENTS
   ========================================================================== */

#buddypress #activity-stream li .activity-comments {
    background: #f9fafb;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.85rem 1.25rem;
}

#buddypress #activity-stream li .activity-comments ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

#buddypress #activity-stream li .activity-comments ul li {
    display: flex;
    gap: 0.65rem;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

#buddypress #activity-stream li .activity-comments ul li:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

#buddypress #activity-stream li .activity-comments .acomment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.07);
}

#buddypress #activity-stream li .activity-comments .acomment-content {
    flex: 1;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #374151;
}

#buddypress #activity-stream li .activity-comments .acomment-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-bottom: 0.2rem;
}

#buddypress #activity-stream li .activity-comments .acomment-meta a {
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
}

/* Comment form */
#buddypress #activity-stream li .activity-comments .ac-form {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.65rem;
    align-items: flex-start;
}

#buddypress #activity-stream li .activity-comments .ac-form textarea {
    flex: 1;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    outline: none;
    transition: border-color 0.2s;
}

#buddypress #activity-stream li .activity-comments .ac-form textarea:focus {
    border-color: #0d9488;
}

#buddypress #activity-stream li .activity-comments .ac-form input[type="submit"] {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* ==========================================================================
   LOAD MORE BUTTON
   ========================================================================== */

#buddypress #activity-stream li.load-more,
#buddypress #activity-stream li.load-newest {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    text-align: center;
    padding: 0.5rem 0;
}

#buddypress #activity-stream li.load-more:hover,
#buddypress #activity-stream li.load-newest:hover {
    transform: none;
    box-shadow: none;
}

#buddypress #activity-stream li.load-more a,
#buddypress #activity-stream li.load-newest a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 2rem;
    background: linear-gradient(135deg, #0f766e, #0d9488, #2dd4bf);
    color: #fff;
    border-radius: 50px;
    font-size: 0.87rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 3px 14px rgba(13,148,136,0.3);
    transition: opacity 0.2s, transform 0.2s;
}

#buddypress #activity-stream li.load-more a:hover,
#buddypress #activity-stream li.load-newest a:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ==========================================================================
   NEW BLOG POST ACTIVITY TYPE — slightly differentiated
   ========================================================================== */

#buddypress #activity-stream li.type-new_blog_post {
    border-left: 3px solid #0d9488;
}

#buddypress #activity-stream li.type-new_blog_post .activity-inner {
    padding-left: 1.1rem;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

#buddypress #activity-stream li.no-activity-found {
    background: transparent;
    border: 2px dashed rgba(0,0,0,0.1);
    border-radius: 18px;
    box-shadow: none;
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-size: 0.95rem;
}

#buddypress #activity-stream li.no-activity-found:hover {
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   BUDDYX SIDEBAR WIDGETS ON COMMUNITY PAGE — clean up
   ========================================================================== */

.page-id-194 #secondary .widget {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 18px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.page-id-194 #secondary .widget-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(13,148,136,0.15);
}

/* ==========================================================================
   ACTIVITY HEADER ROW — flex layout to align avatar + header properly
   ========================================================================== */

#buddypress #activity-stream li .activity-header-inner,
#buddypress #activity-stream li > .activity-content > .activity-header {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

/* BuddyPress Nouveau specific — wrap header+avatar together */
#buddypress .activity-item .activity-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* ==========================================================================
   MISC CLEANUP — remove BuddyPress chrome we don't want
   ========================================================================== */

/* Remove the "Activity" section title BuddyX adds */
.page-id-194 #activity h2.title,
.page-id-194 .activity-nav-title {
    display: none;
}

/* Blog post items — hide empty avatar link (no avatar = ghost box) */
#buddypress #activity-stream li.new_blog_post .activity-avatar a:not(:has(img)) {
    display: none;
}

/* Blog post title link — make it stand out */
#buddypress #activity-stream li .buddyx-post-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.35;
    display: block;
    margin-bottom: 0.4rem;
}

#buddypress #activity-stream li .buddyx-post-title-link {
    text-decoration: none;
    color: inherit;
}

#buddypress #activity-stream li .buddyx-post-title-link:hover .buddyx-post-title {
    color: #0d9488;
}

/* Blog post thumbnail image */
#buddypress #activity-stream li .buddyx-post-img-link img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.65rem;
    display: block;
}

/* Clean up the filter dropdown */
#buddypress .activity-type-navs select,
#buddypress select#activity-filter-select {
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Hide the show/hide comments toggle (redundant) */
#buddypress #activity-stream li .activity-meta .view {
    display: none;
}

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

@media (max-width: 640px) {
    .page-id-194 .buddypress-wrap {
        padding: 0 0.5rem;
    }

    #buddypress #activity-stream li .activity-inner {
        padding: 0.85rem 1rem 0.65rem;
    }

    #buddypress #activity-stream li .activity-meta {
        padding: 0.5rem 1rem 0.6rem;
    }

    #buddypress #activity-stream li .activity-avatar img {
        width: 36px;
        height: 36px;
    }

    #buddypress .activity-type-navs {
        width: 100%;
    }
}
