/**
 * BuddyBoss Helpful Replies Styles
 * Frontend CSS for helpful voting and solution marking
 */

/* ==========================================================================
   Helpful Actions - Main Container
   ========================================================================== */

.bb-helpful-actions {
    margin: 15px 0 !important;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
    clear: both;
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure buttons are not hidden in dropdowns */
.bb-helpful-actions,
.bb-helpful-actions .helpful-buttons,
.bb-helpful-actions .helpful-btn,
.bb-helpful-actions .not-helpful-btn {
    position: static !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.helpful-buttons {
    display: flex !important;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.helpful-btn,
.not-helpful-btn {
    display: inline-flex;
    align-items: center;
     gap: 4px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #495057;
    white-space: nowrap;
    min-width: 80px;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.helpful-btn:hover,
.not-helpful-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.helpful-btn.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    color: white;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.not-helpful-btn.active {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-color: #dc3545;
    color: white;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.helpful-btn:disabled,
.not-helpful-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.helpful-icon,
.not-helpful-icon,
.bb-helpful-icon {
    font-size: 16px;
}

.helpful-count,
.not-helpful-count {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    margin-left: 2px;
}

.helpful-btn.active .helpful-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.not-helpful-btn.active .not-helpful-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Show count even when 0 for better UX */
.helpful-btn .helpful-count,
.not-helpful-btn .not-helpful-count {
    display: inline-block;
}

/* ==========================================================================
   Solution Actions
   ========================================================================== */

.bb-solution-actions {
    margin: 10px 0;
    padding: 8px 0;
    border-top: 1px solid #e0e0e0;
    display: block !important;
    visibility: visible !important;
    position: relative !important;
}

.solution-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
    text-decoration: none;
}

.solution-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    color: white;
}

.solution-btn.active {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
    color: white;
}

.solution-btn.active:hover {
    background: linear-gradient(135deg, #c82333, #dc2626);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.solution-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.solution-icon {
    font-size: 16px !important;
    font-weight: bold;
    line-height: 1;
    display: inline-block;
}

.solution-text {
    font-size: 13px;
}

.solution-info {
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    padding: 4px 0;
}

/* Emoji size fixes - Target emojis specifically */
.helpful-btn .helpful-icon,
.not-helpful-btn .not-helpful-icon,
.bb-helpful-icon,
.solution-icon {
    font-size: 24px !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    width: auto !important;
    height: auto !important;
}

/* Target emoji spans specifically */
.helpful-btn span:first-child,
.not-helpful-btn span:first-child {
    font-size: 24px !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Target button text separately to keep it smaller */
.helpful-btn .helpful-text,
.not-helpful-btn .not-helpful-text,
.solution-btn .solution-text {
    font-size: 14px !important;
}

/* Target count text */
.helpful-btn .helpful-count,
.not-helpful-btn .not-helpful-count {
    font-size: 12px !important;
}

/* Additional emoji targeting */
button[data-action="helpful"] span:first-child,
button[data-action="not_helpful"] span:first-child,
.bb-helpful-buttons button span:first-child {
    font-size: 24px !important;
    line-height: 1 !important;
}

/* Keep button base font size reasonable */
.bb-helpful-buttons button {
    font-size: 14px !important;
}

/* Target only emoji spans, not text spans */
.bb-helpful-buttons button span:first-child {
    font-size: 24px !important;
    line-height: 1 !important;
}

.bb-helpful-buttons button span:not(:first-child) {
    font-size: 14px !important;
}

/* ==========================================================================
   Solution Badge
   ========================================================================== */

.bb-solution-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #4CAF50;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.solution-badge-icon {
    font-size: 14px;
}

/* ==========================================================================
   Solution Meta (in reply author details)
   ========================================================================== */

.bb-solution-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.solution-meta-icon {
    font-size: 12px;
    line-height: 1;
}

.solution-meta-text {
    font-size: 11px;
}

/* ==========================================================================
   Topic Solution Status
   ========================================================================== */

.bb-topic-solution-status {
    background: #e8f5e8;
    border: 1px solid #4CAF50;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.solution-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2e7d32;
    font-weight: 500;
}

.solution-status-badge .solution-icon {
    background: #4CAF50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.solution-permalink {
    color: #007cba;
    text-decoration: none;
    font-size: 13px;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.solution-permalink:hover {
    color: #005a87;
    text-decoration: underline;
}

.solution-permalink:focus {
    outline: 1px dotted #007cba;
    outline-offset: 2px;
}

/* ==========================================================================
   Helpful Meta Display
   ========================================================================== */

.bb-helpful-meta {
    margin: 8px 0;
}

.helpful-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f8ff;
    border: 1px solid #2196F3;
    color: #1976D2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.helpful-badge .helpful-icon {
    font-size: 14px;
}

/* Enhanced helpful badge in actions */
.bb-helpful-actions .helpful-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
    margin-top: 10px;
}

.bb-helpful-actions .helpful-badge .helpful-badge-icon {
    font-size: 16px;
    margin-right: 2px;
}

.bb-helpful-actions .helpful-badge .helpful-badge-text {
    font-size: 13px;
}

/* Prominent helpful badge display in reply content */
.bb-helpful-badge-display {
    margin: 10px 0 !important;
    padding: 8px 0;
}

.bb-helpful-badge-display .helpful-badge {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 3px 6px rgba(76, 175, 80, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.bb-helpful-badge-display .helpful-badge .helpful-badge-icon {
    font-size: 18px;
}

.bb-helpful-badge-display .helpful-badge .helpful-badge-text {
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   Reply Sorting
   ========================================================================== */

.bb-reply-sorting {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bb-reply-sorting label {
    font-weight: 500;
    margin: 0;
    color: #333;
}

.bb-reply-sorting select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

/* ==========================================================================
   User Badges
   ========================================================================== */

.bb-user-badges {
    margin: 15px 0;
}

.bb-user-badges h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-item.badge-community_expert {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.badge-item.badge-solution_provider {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.badge-item.badge-solution_expert {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.badge-item.badge-solution_master {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.badge-icon {
    font-size: 14px;
}

/* Reply Author Badges */
.bb-reply-author-badges {
    margin: 5px 0;
}

.badge-mini {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    margin-right: 5px;
}

.badge-mini .badge-icon {
    font-size: 10px;
}

/* ==========================================================================
   Badges Profile Page
   ========================================================================== */

.bb-badges-profile {
    padding: 20px 0;
}

.badges-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.earned-badges h3 {
    margin-bottom: 20px;
    color: #333;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.badge-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.badge-icon-large {
    font-size: 48px;
    margin-bottom: 15px;
}

.badge-card h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.badge-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.badge-earned-date {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.no-badges {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.bb-helpful-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 500;
}

.bb-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bb-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ==========================================================================
   Solved Topic Styling
   ========================================================================== */

.bb-topic-solved .bbp-topic-title::after {
    content: "✓";
    background: #4CAF50;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 8px;
    font-weight: bold;
}

/* ==========================================================================
   Inline Badges - Displayed beside usernames
   ========================================================================== */

.bb-inline-badges {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

.bb-inline-badge {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    margin-left: 3px;
    vertical-align: middle;
    cursor: help;
    transition: transform 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bb-inline-badge:hover {
    transform: scale(1.1);
}

/* Community Expert Badge */
.bb-inline-badge.bb-badge-community_expert {
    color: #ffd700;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3));
}

/* Solution Provider Badge */
.bb-inline-badge.bb-badge-solution_provider {
    color: #4CAF50;
    text-shadow: 0 0 3px rgba(76, 175, 80, 0.4);
}

/* Solution Expert Badge */
.bb-inline-badge.bb-badge-solution_expert {
    color: #FF9800;
    text-shadow: 0 0 3px rgba(255, 152, 0, 0.4);
}

/* Solution Master Badge */
.bb-inline-badge.bb-badge-solution_master {
    color: #9C27B0;
    text-shadow: 0 0 3px rgba(156, 39, 176, 0.4);
}

/* ==========================================================================
   Community Expert Username Styling
   ========================================================================== */

/* Style usernames of community experts with special color */
.bb-has-community-expert-badge .bbp-author-name,
.bb-has-community-expert-badge .bbp-reply-author-link,
.bb-has-community-expert-badge .bbp-topic-author-link,
.bb-has-community-expert-badge .bp-member-name a,
.bb-has-community-expert-badge .activity-header a,
.bb-has-community-expert-badge .member-name a {
    color: #ffd700 !important;
    font-weight: 600 !important;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.3);
}

/* Hover effect for community expert usernames */
.bb-has-community-expert-badge .bbp-author-name:hover,
.bb-has-community-expert-badge .bbp-reply-author-link:hover,
.bb-has-community-expert-badge .bbp-topic-author-link:hover,
.bb-has-community-expert-badge .bp-member-name a:hover,
.bb-has-community-expert-badge .activity-header a:hover,
.bb-has-community-expert-badge .member-name a:hover {
    color: #ffed4e !important;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

/* Forum specific styling for community experts */
.bbp-reply-author.bb-has-community-expert-badge .bbp-author-name,
.bbp-topic-author.bb-has-community-expert-badge .bbp-author-name {
    color: #ffd700 !important;
    font-weight: 600 !important;
}

/* Activity stream styling for community experts */
.activity-item.bb-has-community-expert-badge .activity-header a {
    color: #ffd700 !important;
    font-weight: 600 !important;
}

/* Member directory styling for community experts */
.members-list .member-item.bb-has-community-expert-badge .member-name a {
    color: #ffd700 !important;
    font-weight: 600 !important;
}

/* Responsive design for inline badges */
@media (max-width: 768px) {
    .bb-inline-badge {
        font-size: 12px;
        margin-left: 2px;
    }
}

/* Integration with BuddyBoss/bbPress themes */
.bbp-reply-author .bb-inline-badges,
.bbp-topic-author .bb-inline-badges,
.bp-member-name .bb-inline-badges,
.activity-header .bb-inline-badges {
    margin-left: 5px;
}

/* Ensure badges don't break layout */
.bb-inline-badges {
    white-space: nowrap;
}

/* Style for member directory */
.members-list .bb-inline-badges {
    margin-left: 3px;
}

/* Style for activity stream */
.activity-list .bb-inline-badges {
    margin-left: 3px;
}

/* Style for forum author links */
.bbp-author-name .bb-inline-badges,
.bbp-reply-author-link .bb-inline-badges,
.bbp-topic-author-link .bb-inline-badges {
    margin-left: 4px;
}

/* ==========================================================================
   Badge Positioning - FIXED FOR CORRECT PLACEMENT
   ========================================================================== */

/* Inline badges next to usernames */
.bb-inline-badges {
    display: inline !important;
    margin-left: 5px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    vertical-align: middle !important;
}

.bb-inline-badge {
    display: inline-block !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 2px 4px !important;
    margin: 0 2px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Community Expert Badge Styling */
.bb-inline-badge.bb-badge-community_expert {
    color: #ffd700 !important;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.6) !important;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3)) !important;
    font-weight: bold !important;
}

/* Solution Provider Badge */
.bb-inline-badge.bb-badge-solution_provider {
    color: #28a745 !important;
    text-shadow: 0 0 4px rgba(40, 167, 69, 0.6) !important;
    filter: drop-shadow(0 0 2px rgba(40, 167, 69, 0.3)) !important;
}

/* Solution Expert Badge */
.bb-inline-badge.bb-badge-solution_expert {
    color: #17a2b8 !important;
    text-shadow: 0 0 4px rgba(23, 162, 184, 0.6) !important;
    filter: drop-shadow(0 0 2px rgba(23, 162, 184, 0.3)) !important;
}

/* Solution Master Badge */
.bb-inline-badge.bb-badge-solution_master {
    color: #6f42c1 !important;
    text-shadow: 0 0 4px rgba(111, 66, 193, 0.6) !important;
    filter: drop-shadow(0 0 2px rgba(111, 66, 193, 0.3)) !important;
}

/* Position badges next to username in activity stream */
.activity-header a .bb-inline-badges,
.activity-header .bb-inline-badges {
    margin-left: 3px !important;
    margin-right: 0 !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
}

/* Ensure badges don't appear in button areas */
.activity-meta .bb-inline-badges,
.activity-actions .bb-inline-badges {
    display: none !important;
}

/* Style the actual badge icons */
.activity-list .bb-inline-badge,
.activity-item .bb-inline-badge,
.activity-header .bb-inline-badge {
    display: inline-block !important;
    font-size: 14px !important;
    line-height: 1 !important;
    margin-left: 2px !important;
    vertical-align: middle !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Activity stream badges */
.activity-header .bb-inline-badges {
    margin-left: 3px !important;
}

.activity-header .bb-inline-badge {
    font-size: 12px !important;
    margin: 0 1px !important;
}

/* Mobile specific fixes for activity stream badges */
@media (max-width: 768px) {
    .activity-header .bb-inline-badges {
        margin-left: 2px;
        font-size: 12px;
    }
    
    .activity-header .bb-inline-badge {
        font-size: 12px;
    }
}

/* Ensure badges appear in correct location in activity stream */
.activity-header {
    position: relative;
}

.activity-header a {
    position: relative;
}

/* Fix for BuddyBoss theme specific classes */
.bb-activity-header .bb-inline-badges,
.bb-activity-item .bb-inline-badges {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin-left: 3px;
}

/* Forum author links with badges */
.bbp-author-name .bb-inline-badges,
.bbp-reply-author-link .bb-inline-badges,
.bbp-topic-author-link .bb-inline-badges {
    margin-left: 4px !important;
}

/* Profile page badges */
.bb-user-badges-profile {
    margin: 20px 0;
}

.bb-user-badges-profile .badges-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.bb-user-badges-profile .badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.bb-user-badges-profile .badge-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.bb-user-badges-profile .badge-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.bb-user-badges-profile .badge-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.bb-user-badges-profile .badge-info p {
    margin: 0 0 5px 0;
    color: #6c757d;
    font-size: 14px;
}

.bb-user-badges-profile .badge-info small {
    color: #868e96;
    font-size: 12px;
}

/* ==========================================================================
   BuddyBoss Activity Stream Badge Fixes - COMPLETE OVERRIDE
   ========================================================================== */

/* CRITICAL: Remove ALL red backgrounds from badges everywhere */
.bb-inline-badges,
.bb-inline-badges *,
.bb-inline-badge,
.bb-inline-badge *,
.activity-header .bb-inline-badges,
.activity-header .bb-inline-badge,
.bbp-author-name .bb-inline-badges,
.bbp-author-name .bb-inline-badge,
.bbp-reply-author-link .bb-inline-badges,
.bbp-reply-author-link .bb-inline-badge,
.bbp-topic-author-link .bb-inline-badges,
.bbp-topic-author-link .bb-inline-badge,
.member-name .bb-inline-badges,
.member-name .bb-inline-badge,
.bp-member-name .bb-inline-badges,
.bp-member-name .bb-inline-badge {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
}

/* CRITICAL: Ensure badges display inline next to usernames */
.bb-inline-badges {
    display: inline !important;
    margin-left: 4px !important;
    vertical-align: middle !important;
}

.bb-inline-badge {
    display: inline-block !important;
    font-size: 12px !important;
    line-height: 1 !important;
    margin-left: 2px !important;
    vertical-align: middle !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

/* Badge type specific colors (NOT red backgrounds) */
.bb-inline-badge.bb-badge-community_expert {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #333 !important;
    border: 1px solid #ffd700 !important;
}

.bb-inline-badge.bb-badge-solution_provider {
    background: linear-gradient(135deg, #4CAF50, #45a049) !important;
    color: white !important;
    border: 1px solid #4CAF50 !important;
}

.bb-inline-badge.bb-badge-solution_expert {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
    color: white !important;
    border: 1px solid #2196F3 !important;
}

.bb-inline-badge.bb-badge-solution_master {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2) !important;
    color: white !important;
    border: 1px solid #9C27B0 !important;
}

/* Activity stream specific positioning */
.activity-header .bb-inline-badges {
    margin-left: 3px !important;
}

.activity-header .bb-inline-badge {
    display: inline-block !important;
    font-size: 11px !important;
    line-height: 1 !important;
    margin-left: 2px !important;
    vertical-align: middle !important;
    padding: 1px 4px !important;
}

/* Forum author links specific positioning */
.bbp-author-name .bb-inline-badges,
.bbp-reply-author-link .bb-inline-badges,
.bbp-topic-author-link .bb-inline-badges {
    margin-left: 4px !important;
}

/* Member directory positioning */
.member-name .bb-inline-badges,
.bp-member-name .bb-inline-badges {
    margin-left: 3px !important;
}

/* ==========================================================================
   End BuddyBoss Activity Stream Badge Fixes
   ========================================================================== */

/* ==========================================================================
   Forum Badge Display
   ========================================================================== */

/* Forum reply author badges */
.bb-reply-author-badges,
.bb-topic-author-badges {
    margin-top: 5px !important;
    display: block !important;
}

.bb-reply-author-badges .badge-mini,
.bb-topic-author-badges .badge-mini {
    display: inline-block !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 2px 4px !important;
    margin-right: 5px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

/* Inline badges in author links */
.bbp-reply-author .bb-inline-badges,
.bbp-topic-author .bb-inline-badges {
    display: inline !important;
    margin-left: 5px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.bbp-reply-author .bb-inline-badge,
.bbp-topic-author .bb-inline-badge {
    display: inline-block !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 2px !important;
    margin-left: 2px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* ==========================================================================
   Mobile Button Layout - ALL BUTTONS EXACTLY THE SAME SIZE
   ========================================================================== */

/* ==========================================================================
   Mobile Responsive Design - FIXED
   ========================================================================== */

/* Tablet and small desktop */
@media (max-width: 768px) {
    /* Container for all action buttons */
    .bb-solution-actions,
    .bb-helpful-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
        align-items: stretch !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin: 10px 0 !important;
        padding: 0 !important;
    }
    
    .helpful-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
        width: 100% !important;
        align-items: stretch !important;
    }
    
    /* ALL THREE BUTTONS - EXACTLY THE SAME SIZE */
    .helpful-btn,
    .not-helpful-btn,
    .solution-btn {
        flex: 1 1 calc(33.333% - 3px) !important;
        min-width: 0 !important;
        max-width: calc(33.333% - 3px) !important;
        width: calc(33.333% - 3px) !important;
        padding: 8px 4px !important;
        font-size: 11px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        height: 36px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        box-sizing: border-box !important;
        border: 1px solid #ddd !important;
    }

    /* Icons - SAME SIZE FOR ALL BUTTONS */
    .helpful-btn .helpful-icon,
    .not-helpful-btn .not-helpful-icon,
    .solution-btn .solution-icon {
        font-size: 16px !important;
        margin: 0 !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
    }

    /* Text - SAME SIZE FOR ALL BUTTONS */
    .helpful-btn .helpful-text,
    .not-helpful-btn .not-helpful-text,
    .solution-btn .solution-text {
        font-size: 10px !important;
        display: inline !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Count styling - SAME SIZE FOR ALL BUTTONS */
    .helpful-btn .helpful-count,
    .not-helpful-btn .not-helpful-count,
    .solution-btn .solution-count {
        display: inline-flex !important;
        margin: 0 !important;
        padding: 1px 4px !important;
        font-size: 9px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        border-radius: 8px !important;
        height: auto !important;
        background: rgba(255, 255, 255, 0.2) !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2 !important;
        min-width: 18px !important;
        text-align: center !important;
        flex-shrink: 0 !important;
    }
}

/* Mobile phones - FIXED SINGLE ROW LAYOUT */
@media (max-width: 480px) {
    .bb-helpful-actions {
        margin: 10px 0 !important;
        padding: 8px 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* CRITICAL: Force all buttons into a single row container */
    .helpful-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        align-items: stretch !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* CRITICAL: Equal width buttons that fit in one row - ALL SAME SIZE */
    .helpful-btn,
    .not-helpful-btn,
    .solution-btn {
        flex: 1 1 33% !important;
        min-width: 0 !important;
        max-width: 33% !important;
        padding: 6px 4px !important;
        font-size: 11px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        height: 32px !important;
        line-height: 1.2 !important;
        border-radius: 4px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        box-sizing: border-box !important;
    }

    /* Icons smaller on mobile - ALL SAME SIZE */
    .helpful-btn .helpful-icon,
    .not-helpful-btn .not-helpful-icon,
    .solution-btn .solution-icon {
        font-size: 14px !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    /* Text and counts inline in row direction - ALL SAME SIZE */
    .helpful-btn .helpful-text,
    .not-helpful-btn .not-helpful-text,
    .solution-btn .solution-text {
        font-size: 9px !important;
        display: inline !important;
        margin: 0 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }
    
    /* Counts inline with text in row direction - ALL BUTTONS CONSISTENT */
    .helpful-count,
    .not-helpful-count,
    .solution-count {
        font-size: 8px !important;
        padding: 1px 3px !important;
        min-width: 12px !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        background: rgba(255,255,255,0.2) !important;
        border-radius: 8px !important;
        height: 14px !important;
    }
    
    /* CRITICAL: Ensure solution actions don't break layout */
    .bb-solution-actions {
        margin: 0 !important;
        padding: 0 !important;
        display: inline !important;
        width: auto !important;
    }
    
    /* CRITICAL: Solution button stays in the same row */
    .bb-solution-actions .solution-btn {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
    }
    
    /* CRITICAL: Prevent any element from forcing new lines */
    .bb-helpful-actions * {
        box-sizing: border-box !important;
    }
    
    /* Hide text on very small screens but keep icons and counts in row - ALL BUTTONS SAME SIZE */
    @media (max-width: 360px) {
        .bb-solution-actions {
            flex-direction: row !important;
            gap: 2px !important;
        }
        
        .helpful-btn .helpful-text,
        .not-helpful-btn .not-helpful-text,
        .solution-btn .solution-text {
            display: none !important;
        }
        
        .helpful-btn,
        .not-helpful-btn,
        .solution-btn {
            flex: 1 1 calc(33.333% - 2px) !important;
            max-width: calc(33.333% - 2px) !important;
            width: calc(33.333% - 2px) !important;
            height: 32px !important;
            padding: 6px 2px !important;
            flex-direction: row !important;
            gap: 2px !important;
            font-size: 10px !important;
        }
        
        .helpful-btn .helpful-icon,
        .not-helpful-btn .not-helpful-icon,
        .solution-btn .solution-icon {
            font-size: 14px !important;
        }
        
        /* Keep counts visible even when text is hidden - ALL BUTTONS CONSISTENT */
        .helpful-count,
        .not-helpful-count,
        .solution-count {
            font-size: 8px !important;
            padding: 1px 3px !important;
            min-width: 16px !important;
            height: 16px !important;
            display: inline-flex !important;
        }
    }
}
    
    .bb-helpful-badge-display .helpful-badge {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .bb-helpful-badge-display .helpful-badge .helpful-badge-icon {
        font-size: 14px;
    }
    
    .badges-list {
        flex-direction: column;
    }
    
    .badges-stats {
        grid-template-columns: 1fr;
    }
    
    .badges-grid {
        grid-template-columns: 1fr;
    }
    
    .bb-reply-sorting {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .bb-reply-sorting select {
        width: 100%;
    }
}

/* ==========================================================================
   Author Details Area Badges - INLINE WITH AUTHOR NAME AND DATE
   ========================================================================== */

/* Inline badges next to usernames - positioned within author name area */
.bb-inline-badges {
    display: inline-flex !important;
    margin-left: 6px !important;
    margin-right: 0 !important;
    vertical-align: middle !important;
    align-items: center !important;
    gap: 3px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.bb-inline-badge {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 2px 5px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    margin: 0 !important;
    vertical-align: middle !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

/* Badge styling for different types */
.bb-inline-badge.bb-badge-community_expert {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #333 !important;
    border: 1px solid #e6c200 !important;
}

.bb-inline-badge.bb-badge-solution_provider {
    background: linear-gradient(135deg, #2196F3, #42A5F5) !important;
    color: white !important;
    border: 1px solid #1976D2 !important;
}

.bb-inline-badge.bb-badge-solution_expert {
    background: linear-gradient(135deg, #4CAF50, #66BB6A) !important;
    color: white !important;
    border: 1px solid #388E3C !important;
}

.bb-inline-badge.bb-badge-solution_master {
    background: linear-gradient(135deg, #9C27B0, #BA68C8) !important;
    color: white !important;
    border: 1px solid #7B1FA2 !important;
}

.bb-inline-badge .badge-icon {
    font-size: 11px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.bb-inline-badge .badge-text {
    font-size: 9px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Position badges within author name links */
.bbp-author-name .bb-inline-badges,
.bbp-reply-author-link .bb-inline-badges,
.bbp-topic-author-link .bb-inline-badges {
    margin-left: 4px !important;
    display: inline-flex !important;
}

/* Ensure badges appear inline in the item-meta area */
.item-meta .bb-inline-badges,
.bbp-reply-author .bb-inline-badges,
.bbp-topic-author .bb-inline-badges {
    display: inline-flex !important;
    margin-left: 4px !important;
    vertical-align: middle !important;
}

/* Mobile adjustments for inline badges */
@media (max-width: 768px) {
    .bb-inline-badges {
        margin-left: 3px !important;
        gap: 2px !important;
    }
    
    .bb-inline-badge {
        font-size: 9px !important;
        padding: 1px 3px !important;
        gap: 1px !important;
    }
    
    .bb-inline-badge .badge-icon {
        font-size: 10px !important;
    }
    
    .bb-inline-badge .badge-text {
        font-size: 8px !important;
    }
}

/* Remove the old author badges positioning */
.bb-author-badges {
    display: none !important;
}

/* Temporary badges container - will be moved by JavaScript */
.bb-author-badges-temp {
    display: none !important;
}

/* Hide temporary badge containers */
.bb-author-badges-temp {
    display: none !important;
}

/* Remove conflicting mobile rules - they're handled above */

/* ==========================================================================
   Override Theme Styles - Prevent Hiding in Dropdowns
   ========================================================================== */

/* Force visibility and prevent dropdown hiding */
.bb-helpful-actions {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    clip: auto !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
}

/* Ensure buttons are always visible */
.bb-helpful-actions .helpful-buttons,
.bb-helpful-actions .helpful-btn,
.bb-helpful-actions .not-helpful-btn,
.bb-helpful-badge-display {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    clip: auto !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
}

/* Override any dropdown menu styles */
.reply-content .bb-helpful-actions,
.bbp-reply-content .bb-helpful-actions,
.bb-reply-content .bb-helpful-actions {
    display: block !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Prevent buttons from being hidden in admin menus */
.reply-admin-links .bb-helpful-actions,
.bbp-reply-admin-links .bb-helpful-actions,
.bb-reply-admin-links .bb-helpful-actions {
    display: none !important;
}

@media (prefers-color-scheme: dark) {
    .bb-helpful-actions {
        border-top-color: #444;
    }
    
    .helpful-btn,
    .not-helpful-btn,
    .solution-btn {
        background: #333;
        border-color: #555;
        color: #ccc;
    }
    
    .helpful-btn:hover,
    .not-helpful-btn:hover,
    .solution-btn:hover {
        background: #444;
        border-color: #666;
        color: #fff;
    }
    
    .helpful-count {
        background: #555;
        color: #ccc;
    }
    
    .bb-reply-sorting {
        background: #333;
        border-color: #555;
    }
    
    .bb-reply-sorting label {
        color: #ccc;
    }
    
    .bb-reply-sorting select {
        background: #444;
        border-color: #555;
        color: #ccc;
    }
    
    .stat-item,
    .badge-card {
        background: #333;
        border-color: #555;
        color: #ccc;
    }
    
    .badge-card h4 {
        color: #fff;
    }
}