/**
 * استایل ویجت‌های تاکسونومی (ابزارک وردپرس + ویجت المنتور)
 *
 * @since 1.2.0
 */

/* ── جعبه اصلی ویجت ── */
.tbp-widget-terms {
    box-sizing: border-box;
}

.tbp-widget-terms *,
.tbp-widget-terms *::before,
.tbp-widget-terms *::after {
    box-sizing: border-box;
}

.tbp-widget-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

/* ── چیدمان شبکه ── */
.tbp-widget-terms.tbp-layout-grid .tbp-terms-grid {
    display: grid;
    grid-template-columns: repeat(var(--tbp-columns, 3), 1fr);
    gap: 20px;
}

.tbp-widget-terms .tbp-term-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tbp-widget-terms .tbp-term-image-link {
    display: block;
    text-decoration: none;
}

.tbp-widget-terms .tbp-term-image {
    margin: 0;
    line-height: 0;
}

.tbp-widget-terms .tbp-term-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.tbp-widget-terms .tbp-term-content {
    padding: 16px;
}

.tbp-widget-terms .tbp-term-name {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.tbp-widget-terms .tbp-term-name a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.25s ease;
}

.tbp-widget-terms .tbp-term-name a:hover {
    color: #2563eb;
}

.tbp-widget-terms .tbp-term-desc {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

.tbp-widget-terms .tbp-term-count {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
}

/* افکت‌های هاور کارت */
.tbp-widget-terms.tbp-hover-lift .tbp-term-card:hover {
    transform: translateY(-6px);
}

.tbp-widget-terms.tbp-hover-shadow .tbp-term-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* ── چیدمان فهرست ── */
.tbp-widget-terms.tbp-layout-list .tbp-term-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tbp-widget-terms.tbp-layout-list .tbp-term-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.tbp-widget-terms.tbp-layout-list .tbp-term-list-link {
    flex: 1;
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s ease;
}

.tbp-widget-terms.tbp-layout-list .tbp-term-list-link:hover {
    color: #2563eb;
}

.tbp-widget-terms .tbp-count {
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
}

.tbp-widget-terms .tbp-term-list-image {
    margin: 0;
    line-height: 0;
    flex: 0 0 auto;
}

.tbp-widget-terms .tbp-term-list-image img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

/* ── چیدمان ابر برچسب ── */
.tbp-widget-terms.tbp-layout-tagcloud .tbp-term-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tbp-widget-terms .tbp-cloud-item {
    display: inline-block;
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    color: #475569;
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.25s ease, color 0.25s ease;
}

.tbp-widget-terms .tbp-cloud-item:hover {
    background: #2563eb;
    color: #fff;
}

/* ── چیدمان منوی کشویی ── */
.tbp-widget-terms.tbp-layout-dropdown .tbp-term-dropdown {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
}

/* ── ویجت جستجوی عبارات ── */
.tbp-search-widget {
    position: relative;
}

.tbp-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-size: 14px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tbp-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tbp-search-results {
    display: none;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    max-height: 300px;
    overflow-y: auto;
}

.tbp-search-result-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.tbp-search-result-item:last-child {
    border-bottom: none;
}

.tbp-search-result-item:hover {
    background: #eff6ff;
}

.tbp-search-result-item a {
    color: #1e293b;
    text-decoration: none;
}

.tbp-search-result-item a:hover {
    color: #2563eb;
}

/* ── ویجت فیلتر عبارات ── */
.tbp-filter-widget {
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.tbp-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 16px;
}

.tbp-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 14px;
    transition: color 0.2s ease;
}

.tbp-filter-option:hover {
    color: #2563eb;
}

.tbp-filter-option input {
    margin: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

.tbp-filter-button {
    display: inline-block;
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
}

.tbp-filter-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.tbp-filter-results {
    margin-top: 16px;
}

/* جای‌نمای المنتور در حالت ویرایش */
.tbp-editor-placeholder {
    padding: 24px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

/* ── رسپانسیو ── */
@media (max-width: 1024px) {
    .tbp-widget-terms.tbp-layout-grid .tbp-terms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .tbp-widget-terms.tbp-layout-grid .tbp-terms-grid {
        grid-template-columns: 1fr;
    }
}
