/**
 * BBClubs Reply Sorting Controls Styles
 */

 .replies-sort-controls {
    margin: 15px 0;
    padding: 10px 0;
    margin-left: 35px;
    border-bottom: 1px solid #ddd;
    z-index: 1;
    position: relative;
}

.replies-sort-controls > div {
    display: flex;
    align-items: center;
    gap: 15px;
}

.replies-sort-controls span:first-child {
    font-weight: normal;
    color: #333;
    font-size: 13px;
}

.sort-dropdown {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    font-weight: normal;
    min-width: 120px;
}

.sort-dropdown:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2);
}

.sort-dropdown option {
    padding: 8px;
    background-color: #fff;
    color: #333;
}

.reply-search-input {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    cursor: text;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    font-weight: normal;
    min-width: 200px;
    font-family: inherit;
}

.reply-search-input:hover {
    background-color: #f9f9f9;
    border-color: #999;
}

.reply-search-input:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2);
}

.search_replies {
    font-weight: bold;
    color: #333;
    font-size: 13px;
    white-space: nowrap;
}

.search-input-container {
    position: relative;
    display: inline-block;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: none;
}

.search-input-container.has-content .search-clear-btn {
    display: block;
}

.search-clear-btn:hover {
    color: #666;
}

/* Hide nodes that are filtered out completely */
.node.search-hidden {
    display: none !important;
}

/* Also hide nested children when hidden */
.node.search-hidden .children {
    display: none !important;
}

/* Hide ALL children containers by default during search */
.children {
    display: none !important;
}

/* Show children containers that belong to visible nodes */
.node:not(.search-hidden) > .children {
    display: block !important;
}

/* Show children containers during normal viewing (no search) */
body:not([data-searching]) .children {
    display: block !important;
}

/* Hide SVG wires for hidden nodes */
.node.search-hidden + svg.bbclubs-wire,
svg.bbclubs-wire:has(.node.search-hidden) {
    display: none !important;
}

/* Search summary styling */
.node[data-search-summary]::after {
    content: attr(data-search-summary);
    display: block;
    font-size: 12px;
    color: #666;
    font-style: italic;
    padding: 8px 0 8px 16px;
    border-left: 2px solid #ccc;
    margin: 8px 0;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .replies-sort-controls > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sort-dropdown,
    .reply-search-input {
        width: 100%;
        max-width: 200px;
    }
    
    .search_replies {
        margin-left: 0 !important;
    }
}
