/* === Recipe Browser === */

.rb-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 2rem;
}

/* --- Sidebar --- */
.rb-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.rb-sidebar::-webkit-scrollbar { width: 5px; }
.rb-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.rb-filter-group { margin-bottom: 12px; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }
.rb-filter-group:last-child { border-bottom: none; margin-bottom: 0; }

.rb-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 700;
    color: #333;
    padding: 4px 0;
    user-select: none;
}
.rb-filter-heading::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: .65rem;
    color: #999;
    transition: transform .2s;
}
.rb-filter-group.collapsed .rb-filter-heading::after {
    transform: rotate(-90deg);
}
.rb-filter-group.collapsed .rb-filter-options {
    display: none;
}

.rb-filter-options {
    margin-top: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.rb-filter-options::-webkit-scrollbar { width: 4px; }
.rb-filter-options::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.rb-filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    cursor: pointer;
    font-size: .82rem;
    color: #555;
    transition: color .15s;
}
.rb-filter-option:hover { color: #333; }
.rb-filter-option input[type="checkbox"] {
    accent-color: #00ab6b;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
.rb-filter-count {
    margin-left: auto;
    font-size: .72rem;
    color: #aaa;
    font-weight: 500;
}

/* --- Main Content --- */
.rb-main { flex: 1; min-width: 0; }

/* --- Toolbar --- */
.rb-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.rb-search-box {
    flex: 1;
    min-width: 180px;
    position: relative;
}
.rb-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .88rem;
    outline: none;
    transition: border-color .2s;
}
.rb-search-box input:focus { border-color: #00ab6b; }
.rb-search-box .rb-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: .85rem;
    pointer-events: none;
}

.rb-sort-select, .rb-per-page-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .82rem;
    background: #fff;
    cursor: pointer;
    outline: none;
}
.rb-sort-select:focus, .rb-per-page-select:focus { border-color: #00ab6b; }

.rb-view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.rb-view-btn {
    padding: 7px 12px;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: .9rem;
    transition: all .15s;
    display: flex;
    align-items: center;
}
.rb-view-btn + .rb-view-btn { border-left: 1px solid #ddd; }
.rb-view-btn.active { background: #00ab6b; color: #fff; }
.rb-view-btn:hover:not(.active) { background: #f5f5f5; }

/* --- Results info --- */
.rb-results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.rb-results-count {
    font-size: .85rem;
    color: #666;
}

/* --- Active filter pills --- */
.rb-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.rb-active-filters:empty { display: none; margin-bottom: 0; }
.rb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f5ef;
    color: #00ab6b;
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 15px;
    cursor: default;
}
.rb-pill .rb-pill-x {
    cursor: pointer;
    font-weight: 700;
    font-size: .8rem;
    line-height: 1;
    opacity: .7;
    transition: opacity .15s;
}
.rb-pill .rb-pill-x:hover { opacity: 1; }
.rb-pill-clear {
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
}
.rb-pill-clear:hover { background: #e0e0e0; }

/* --- Card Grid View --- */
.rb-grid {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}
.rb-grid .rb-card-col {
    width: 33.333%;
    padding: 0 15px;
    margin-bottom: 30px;
}

.rb-card {
    height: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s;
    background: #fff;
}
.rb-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,.08); }

.rb-card .rb-card-thumb {
    position: relative;
    overflow: hidden;
}
.rb-card .rb-card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.rb-card:hover .rb-card-thumb img { transform: scale(1.03); }

.rb-card .rb-card-body {
    padding: 12px 16px;
    flex: 1;
}
.rb-card .rb-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}
.rb-card .rb-card-title a { color: #333; text-decoration: none; }
.rb-card .rb-card-title a:hover { color: #00ab6b; }

.rb-card .rb-card-desc {
    font-size: .82rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.rb-card .rb-card-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    color: #888;
}
.rb-card .rb-card-footer img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.rb-card .rb-card-footer .rb-card-author { font-weight: 600; color: #555; }
.rb-card .rb-card-footer .rb-card-date { margin-left: auto; }

/* --- List View --- */
.rb-list { display: flex; flex-direction: column; gap: 0; }

.rb-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.rb-list-item:hover { background: #fafafa; text-decoration: none; color: inherit; }
.rb-list-item:first-child { padding-top: 0; }

.rb-list-thumb {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.rb-list-info { flex: 1; min-width: 0; }
.rb-list-title {
    font-size: .9rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rb-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .75rem;
    color: #888;
}
.rb-list-meta span { display: inline-flex; align-items: center; gap: 3px; }

/* --- Pagination --- */
.rb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 24px;
}
.rb-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
}
.rb-pagination button:hover:not(.active):not(:disabled) {
    background: #00ab6b;
    border-color: #00ab6b;
    color: #fff;
}
.rb-pagination button.active {
    background: #00ab6b;
    border-color: #00ab6b;
    color: #fff;
    cursor: default;
}
.rb-pagination button:disabled {
    opacity: .4;
    cursor: default;
}
.rb-pagination .rb-page-ellipsis {
    padding: 0 6px;
    color: #999;
    border: none;
    background: none;
    cursor: default;
    font-size: .85rem;
}

.rb-per-page-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: .82rem;
    color: #666;
}

/* --- Loading & Empty --- */
.rb-loading {
    text-align: center;
    padding: 3rem 0;
    color: #999;
    font-size: .9rem;
}
.rb-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: .2em;
    color: #00ab6b;
}
.rb-empty {
    text-align: center;
    padding: 3rem 0;
    color: #999;
}
.rb-empty i { font-size: 2rem; margin-bottom: .5rem; display: block; }

/* --- Mobile Filter Button --- */
.rb-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    margin-bottom: 12px;
    width: 100%;
    justify-content: center;
}
.rb-mobile-filter-btn .rb-filter-badge {
    background: #00ab6b;
    color: #fff;
    font-size: .7rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}
.rb-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1040;
}
.rb-sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #333;
    cursor: pointer;
    z-index: 5;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .rb-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1050;
        border-radius: 0;
        border: none;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
        transition: left .3s ease;
        padding-top: 50px;
    }
    .rb-sidebar.open { left: 0; }
    .rb-sidebar-overlay.open { display: block; }
    .rb-sidebar-close { display: block; }
    .rb-mobile-filter-btn { display: flex; }
    .rb-wrap { flex-direction: column; gap: 0; }
    .rb-grid .rb-card-col { width: 50%; }
}

@media (max-width: 575px) {
    .rb-grid .rb-card-col { width: 100%; }
    .rb-toolbar { gap: 8px; }
    .rb-search-box { min-width: 100%; }
    .rb-list-thumb { width: 70px; height: 52px; }
    .rb-list-meta { gap: 6px; }
}
