/**
 * استایل‌های افزونه نمایش وکلای هوشمند
 * نسخه: 1.0.0
 * طراحی مینیمال و فلت
 */

/* ========================================
   متغیرهای CSS - استفاده از رنگ‌های قالب
   ======================================== */
:root {
    --vh-primary: var(--wp--preset--color--primary, #252860);
    --vh-secondary: var(--wp--preset--color--secondary, #d99b1f);
    --vh-accent: var(--wp--preset--color--accent, #d99b1f);
    --vh-text: var(--wp--preset--color--foreground, #1a202c);
    --vh-text-light: var(--wp--preset--color--tertiary, #718096);
    --vh-bg: var(--wp--preset--color--background, #ffffff);
    --vh-border: #e5e7eb;
    --vh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --vh-shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --vh-shadow-lg: 0 4px 6px 0 rgba(0, 0, 0, 0.07);
    --vh-shadow-xl: 0 6px 10px 0 rgba(0, 0, 0, 0.08);
    --vh-radius: 8px;
    --vh-transition: all 0.2s ease;
}

/* ========================================
   کانتینر اصلی
   ======================================== */
.vh-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
}

/* ========================================
   گرید کارت‌ها
   ======================================== */
.vh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* ========================================
   کارت هر وکیل
   ======================================== */
.vh-card {
    background: var(--vh-bg);
    border-radius: var(--vh-radius);
    border: 1px solid var(--vh-border);
    overflow: hidden;
    transition: var(--vh-transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.vh-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--vh-secondary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.vh-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vh-shadow-xl);
    border-color: var(--vh-primary);
}

.vh-card:hover::before {
    transform: scaleX(1);
}

/* ========================================
   هدر کارت (آواتار)
   ======================================== */
.vh-card-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    padding: 40px 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.vh-avatar {
    position: relative;
    width: 120px;
    height: 120px;
}

.vh-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--vh-bg);
    box-shadow: var(--vh-shadow-lg);
    object-fit: cover;
    transition: var(--vh-transition);
}

.vh-card:hover .vh-avatar img {
    transform: scale(1.05);
    border-color: var(--vh-primary);
}

.vh-rating-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--vh-secondary);
    color: #fff;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: var(--vh-shadow-md);
    border: 2px solid var(--vh-bg);
}

.vh-rating-value {
    line-height: 1;
}

.vh-star-icon {
    width: 14px;
    height: 14px;
    color: #fff;
}

/* ========================================
   بدنه کارت
   ======================================== */
.vh-card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vh-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--vh-text);
    margin: 0;
    line-height: 1.3;
    text-align: center;
}

.vh-title {
    font-size: 14px;
    color: var(--vh-text-light);
    margin: 0;
    text-align: center;
    font-weight: 500;
}

/* ========================================
   متا اطلاعات
   ======================================== */
.vh-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--vh-border);
    border-bottom: 1px solid var(--vh-border);
}

.vh-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--vh-text-light);
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
}

.vh-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    color: var(--vh-primary);
}

/* ========================================
   بخش‌های تخصص و خدمات
   ======================================== */
.vh-specializations,
.vh-activities {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vh-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--vh-text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vh-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vh-badge {
    display: inline-block;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    line-height: 1;
    transition: var(--vh-transition);
}

.vh-badge-primary {
    background: rgba(37, 40, 96, 0.08);
    color: var(--vh-primary);
    border: 1px solid rgba(37, 40, 96, 0.15);
}

.vh-badge-primary:hover {
    background: rgba(37, 40, 96, 0.12);
}

.vh-badge-secondary {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.vh-badge-secondary:hover {
    background: rgba(16, 185, 129, 0.2);
}

.vh-badge-more {
    background: #f1f5f9;
    color: var(--vh-text-light);
    border: 1px solid var(--vh-border);
}

/* ========================================
   فوتر کارت
   ======================================== */
.vh-card-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--vh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.vh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--vh-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--vh-transition);
    border: none;
    cursor: pointer;
    flex-grow: 1;
    justify-content: center;
}

.vh-btn:hover {
    background: #1e2050;
    box-shadow: var(--vh-shadow-md);
    color: #ffffff;
}

.vh-btn-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.vh-reviews {
    font-size: 13px;
    color: var(--vh-text-light);
    white-space: nowrap;
    font-weight: 500;
}

/* ========================================
   صفحه‌بندی
   ======================================== */
.vh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.vh-page-btn,
.vh-page-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--vh-bg);
    color: var(--vh-text);
    border: 1px solid var(--vh-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--vh-transition);
    min-width: 44px;
    justify-content: center;
}

.vh-page-btn:hover,
.vh-page-number:hover {
    background: var(--vh-primary);
    color: #ffffff;
    border-color: var(--vh-primary);
    transform: translateY(-2px);
    box-shadow: var(--vh-shadow-md);
}

.vh-page-number.active {
    background: var(--vh-primary);
    color: #ffffff;
    border-color: var(--vh-primary);
}

.vh-page-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.vh-page-dots {
    color: var(--vh-text-light);
    padding: 0 5px;
}

.vh-page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* ========================================
   حالت‌های لودینگ و خطا
   ======================================== */
.vh-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--vh-text-light);
}

.vh-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    margin-left: 15px;
    border: 4px solid var(--vh-border);
    border-top-color: var(--vh-primary);
    border-radius: 50%;
    animation: vh-spin 0.8s linear infinite;
}

@keyframes vh-spin {
    to { transform: rotate(360deg); }
}

.vh-error,
.vh-no-data {
    text-align: center;
    padding: 40px 20px;
    background: #fff5f5;
    color: #c53030;
    border-radius: var(--vh-radius);
    border: 1px solid #feb2b2;
    font-size: 15px;
}

.vh-no-data {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

/* ========================================
   ریسپانسیو
   ======================================== */
@media (max-width: 768px) {
    .vh-container {
        padding: 15px;
    }
    
    .vh-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vh-card-body {
        padding: 20px;
    }
    
    .vh-avatar {
        width: 100px;
        height: 100px;
    }
    
    .vh-name {
        font-size: 18px;
    }
    
    .vh-pagination {
        gap: 6px;
    }
    
    .vh-page-btn,
    .vh-page-number {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 38px;
    }
    
    .vh-card-footer {
        flex-direction: column;
    }
    
    .vh-btn {
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .vh-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   انیمیشن‌های ظاهر شدن
   ======================================== */
@keyframes vh-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vh-card {
    animation: vh-fadeIn 0.5s ease-out;
}

.vh-card:nth-child(1) { animation-delay: 0.05s; }
.vh-card:nth-child(2) { animation-delay: 0.1s; }
.vh-card:nth-child(3) { animation-delay: 0.15s; }
.vh-card:nth-child(4) { animation-delay: 0.2s; }
.vh-card:nth-child(5) { animation-delay: 0.25s; }
.vh-card:nth-child(6) { animation-delay: 0.3s; }

/* ========================================
   بهبود دسترسی‌پذیری
   ======================================== */
.vh-btn:focus,
.vh-page-btn:focus,
.vh-page-number:focus {
    outline: 2px solid var(--vh-primary);
    outline-offset: 2px;
}

/* ========================================
   حالت چاپ
   ======================================== */
@media print {
    .vh-pagination,
    .vh-btn {
        display: none;
    }
    
    .vh-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
