/**
 * Taxonomy List & Terms Display Widgets Styles
 * استایل های ویجت های لیست تکسونومی و نمایش ترم‌ها
 * 
 * @package ProStoneManager
 * @since 2.5.0
 */

/* ========== TAXONOMY LIST WIDGET ========== */

.psm-taxonomy-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.psm-taxonomy-item {
    position: relative;
    display: block;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.psm-taxonomy-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.psm-taxonomy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.psm-taxonomy-text {
    flex: 1;
}

.psm-taxonomy-arrow {
    margin-inline-start: auto;
    transition: transform 0.3s ease;
}

.psm-taxonomy-item.active .psm-taxonomy-arrow {
    transform: rotate(90deg);
}

/* ========== TERMS DISPLAY WIDGET ========== */

.psm-terms-display {
    width: 100%;
    min-height: 100px;
}

/* Grid Layout */
.psm-terms-display__grid {
    display: grid;
    gap: 15px;
}

/* List Layout */
.psm-terms-display__list {
    display: flex;
    flex-direction: column;
}

.psm-terms-display__list .psm-term-item {
    margin-bottom: 0;
}

/* Term Items */
.psm-term-item {
    position: relative;
    transition: all 0.3s ease;
}

.psm-term-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.psm-term-thumbnail {

    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.psm-term-thumbnail img {
 
    object-fit: cover;
}

.psm-term-name {
    flex: 1;
}

.psm-term-count {
    margin-inline-start: 5px;
    font-size: 0.9em;
    opacity: 0.7;
}

/* States */
.psm-terms-display__loading,
.psm-terms-display__empty,
.psm-terms-display__error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.psm-terms-display__error {
    color: #c00;
}

/* Spinner */
.psm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: psm-spin 0.8s linear infinite;
}

@keyframes psm-spin {
    to {
        transform: rotate(360deg);
    }
}

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

@media (max-width: 768px) {
    .psm-terms-display__grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .psm-terms-display__grid {
        grid-template-columns: 1fr !important;
    }
    
    .psm-taxonomy-link,
    .psm-term-link {
        padding: 12px 15px;
    }
}

/* ========== ELEMENTOR EDITOR ========== */

.elementor-editor-active .psm-terms-display__loading {
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
}
