/* ============================================================
   Hamdaramad Analyzer — Catalog & Blacklist & Skills Styles
   نسخه ۸.۱.۰ — Opportunities + Income Models + Blacklist + Skills
   ============================================================ */

/* ============================================================
   تب‌ها
   ============================================================ */
.hd-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0e8dc;
    flex-wrap: wrap;
}

.hd-tab {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: transparent;
    color: #7A6A55;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s ease;
    text-align: center;
}

.hd-tab:hover {
    background: #FDF6EC;
    color: #3D2E1F;
}

.hd-tab.active {
    background: linear-gradient(135deg, #FBC251, #E5A82E);
    color: #fff;
    box-shadow: 0 4px 12px rgba(251, 194, 81, 0.4);
}

/* ============================================================
   دکمه‌های بالای صفحه
   ============================================================ */
.hd-catalog-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================================
   فرم کاتالوگ
   ============================================================ */
.hd-catalog-form-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    border: 2px solid #FBC251;
}

.hd-catalog-form-wrap h2 {
    font-size: 19px;
    font-weight: 800;
    color: #3D2E1F;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px dashed #FDE4A8;
}

.hd-catalog-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hd-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.hd-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hd-form-field label {
    font-size: 13px;
    font-weight: 700;
    color: #3D2E1F;
}

.hd-form-field label input[type="checkbox"] {
    margin-left: 8px;
    vertical-align: middle;
    width: 18px;
    height: 18px;
    accent-color: #FBC251;
    cursor: pointer;
}

.hd-form-field input[type="text"],
.hd-form-field input[type="number"],
.hd-form-field select,
.hd-form-field textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif !important;
    font-size: 14px;
    color: #3D2E1F;
    background: #FDF6EC;
    border: 2px solid transparent;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
    box-sizing: border-box;
}

.hd-form-field input[type="text"]:focus,
.hd-form-field input[type="number"]:focus,
.hd-form-field select:focus,
.hd-form-field textarea:focus {
    border-color: #FBC251;
    background: #fff;
}

.hd-form-field textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.8;
}

.hd-form-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%237A6A55' d='M6 9L1 4h10z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}

.hd-form-field small {
    display: block;
    font-size: 12px;
    color: #7A6A55;
    line-height: 1.6;
    font-weight: 500;
}

.hd-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 2px dashed #FDE4A8;
    flex-wrap: wrap;
}

/* ============================================================
   خلاصه کاتالوگ در داشبورد
   ============================================================ */
.hd-dashboard-catalog-summary {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0e8dc;
}

.hd-catalog-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.hd-catalog-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 18px;
    background: #FDF6EC;
    border-radius: 14px;
    border: 2px solid #FDE4A8;
    text-decoration: none;
    transition: all 0.25s ease;
}

.hd-catalog-summary-card:hover {
    transform: translateY(-3px);
    background: #fff;
    border-color: #FBC251;
    box-shadow: 0 8px 20px rgba(251, 194, 81, 0.2);
}

.hd-catalog-summary-icon {
    font-size: 32px;
    line-height: 1;
}

.hd-catalog-summary-value {
    font-size: 28px;
    font-weight: 900;
    color: #E5A82E;
    line-height: 1;
}

.hd-catalog-summary-label {
    font-size: 13px;
    color: #7A6A55;
    font-weight: 700;
    text-align: center;
}

/* ============================================================
   آمار لیست سیاه
   ============================================================ */
.hd-blacklist-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding: 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0e8dc;
}

.hd-blacklist-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: #FDF6EC;
    border-radius: 10px;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.25s ease;
}

.hd-blacklist-stat:hover {
    background: #FEF3E2;
    border-color: #FDE4A8;
}

.hd-blacklist-stat.active {
    background: linear-gradient(135deg, #FBC251, #E5A82E);
    border-color: #E5A82E;
    box-shadow: 0 4px 12px rgba(251, 194, 81, 0.4);
}

.hd-blacklist-stat-label {
    font-size: 13px;
    color: #3D2E1F;
    font-weight: 700;
}

.hd-blacklist-stat.active .hd-blacklist-stat-label {
    color: #fff;
}

.hd-blacklist-stat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #fff;
    color: #E5A82E;
    font-size: 12.5px;
    font-weight: 800;
    border-radius: 50px;
    border: 1px solid #FDE4A8;
}

.hd-blacklist-stat.active .hd-blacklist-stat-count {
    background: #fff;
    color: #E5A82E;
    border-color: #fff;
}

/* ============================================================
   وزن‌های امتیازدهی
   ============================================================ */
.hd-weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.hd-weight-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: #FDF6EC;
    border-radius: 12px;
    border: 1px solid #FDE4A8;
}

.hd-weight-item label {
    font-size: 12.5px;
    font-weight: 700;
    color: #7A6A55;
}

.hd-weight-input {
    width: 100%;
    padding: 10px 12px;
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif !important;
    font-size: 16px;
    font-weight: 800;
    color: #E5A82E;
    background: #fff;
    border: 2px solid #FDE4A8;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.25s ease;
    text-align: center;
    box-sizing: border-box;
}

.hd-weight-input:focus {
    border-color: #FBC251;
}

.hd-weights-total {
    text-align: center;
    font-size: 15px;
    color: #3D2E1F;
    padding: 14px;
    background: #FDF6EC;
    border-radius: 12px;
    border: 2px dashed #FDE4A8;
    margin-bottom: 18px;
    font-weight: 700;
}

.hd-weights-total strong {
    color: #E5A82E;
    font-size: 20px;
    margin: 0 4px;
}

/* ============================================================
   جدول — ستون‌های ویژه کاتالوگ
   ============================================================ */
.hd-table-full {
    table-layout: auto;
}

.hd-table code {
    display: inline-block;
    padding: 3px 10px;
    background: #F5F0FF;
    color: #6D28D9;
    font-family: 'Segoe UI', Tahoma, monospace !important;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid #DDD6FE;
    direction: ltr;
}

.hd-table small {
    display: block;
    font-size: 12px;
    color: #7A6A55;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

/* آواتار کاربر + تگ */
.hd-user-cell > div:last-child {
    flex: 1;
    min-width: 0;
}

.hd-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.hd-user-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #F5F0FF;
    color: #6D28D9;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    border: 1px solid #DDD6FE;
}

/* ============================================================
   HD Skills Manager — نسخه ۸.۱
   ============================================================ */

.hd-skills-wrap {
    max-width: 1400px;
}

.hd-skills-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.hd-skills-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f0e8dc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.hd-skills-stat-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FDF6EC;
    border-radius: 12px;
    flex-shrink: 0;
}

.hd-skills-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #E5A82E;
    line-height: 1;
    margin-bottom: 4px;
}

.hd-skills-stat-label {
    font-size: 12.5px;
    color: #7A6A55;
    font-weight: 600;
}

/* فیلتر دسته‌ها در پنل ادمین */
.hd-skills-categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f0e8dc;
}

.hd-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #FDF6EC;
    color: #7A6A55;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.hd-cat-chip:hover {
    background: #FDE4A8;
    color: #3D2E1F;
}

.hd-cat-chip.active {
    background: linear-gradient(135deg, #FBC251, #E5A82E);
    color: #fff;
    border-color: #E5A82E;
    box-shadow: 0 4px 12px rgba(251, 194, 81, 0.4);
}

.hd-cat-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #fff;
    color: #E5A82E;
    font-size: 11px;
    font-weight: 800;
    border-radius: 50px;
}

.hd-cat-chip.active .hd-cat-chip-count {
    background: #fff;
    color: #E5A82E;
}

/* ============================================================
   Frontend — آکاردئون مهارت‌ها (برای CF7)
   ============================================================ */

.hd-skills-selector {
    margin: 16px 0 24px;
    padding: 0;
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
}

.hd-skills-empty {
    padding: 20px;
    background: #FEF3C7;
    border-right: 4px solid #F59E0B;
    border-radius: 12px;
    color: #7A4F00;
    font-weight: 700;
    text-align: center;
}

/* جستجو */
.hd-skills-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.hd-skills-search-input {
    width: 100%;
    padding: 14px 44px 14px 20px;
    font-family: inherit;
    font-size: 14.5px;
    color: #3D2E1F;
    background: #FDF6EC;
    border: 2px solid transparent;
    border-radius: 14px;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.hd-skills-search-input:focus {
    border-color: #FBC251;
    background: #fff;
}

.hd-skills-search-clear {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #FDE4A8;
    color: #7A4F00;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hd-skills-search-clear:hover {
    background: #FBC251;
    color: #fff;
}

/* شمارشگر */
.hd-skills-counter-wrap {
    margin-bottom: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #FFF9E6, #FDF6EC);
    border-radius: 14px;
    border: 1px solid #FDE4A8;
}

.hd-skills-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #3D2E1F;
    margin-bottom: 10px;
    font-weight: 600;
}

.hd-skills-counter-icon {
    font-size: 18px;
}

.hd-skills-count {
    color: #E5A82E;
    font-size: 18px;
    font-weight: 900;
    margin: 0 4px;
}

.hd-skills-progress {
    width: 100%;
    height: 6px;
    background: #FDE4A8;
    border-radius: 50px;
    overflow: hidden;
}

.hd-skills-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FBC251, #FB923C);
    border-radius: 50px;
    transition: width 0.4s ease;
}

/* دسته‌ها */
.hd-skills-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.hd-category {
    background: #fff;
    border-radius: 14px;
    border: 2px solid #FDE4A8;
    overflow: hidden;
    transition: all 0.25s ease;
}

.hd-category.has-selection {
    border-color: #FBC251;
    box-shadow: 0 4px 16px rgba(251, 194, 81, 0.15);
}

.hd-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    background: #FDF6EC;
    user-select: none;
    transition: background 0.2s ease;
}

.hd-category-header:hover {
    background: #FEF3E2;
}

.hd-category.open .hd-category-header {
    background: linear-gradient(135deg, #FBC251, #E5A82E);
    color: #fff;
}

.hd-category-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.hd-category-name {
    flex: 1;
    font-size: 14.5px;
    font-weight: 800;
    color: #3D2E1F;
    line-height: 1.5;
}

.hd-category.open .hd-category-name {
    color: #fff;
}

.hd-category-count {
    font-size: 12.5px;
    font-weight: 700;
    color: #7A6A55;
    background: #fff;
    padding: 3px 10px;
    border-radius: 50px;
    min-width: 50px;
    text-align: center;
}

.hd-category.open .hd-category-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.hd-category.has-selection .hd-category-selected {
    color: #10B981;
    font-weight: 900;
}

.hd-category.open.has-selection .hd-category-selected {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.hd-category-arrow {
    font-size: 12px;
    color: #7A6A55;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.hd-category.open .hd-category-arrow {
    color: #fff;
    transform: rotate(180deg);
}

/* بدنه دسته */
.hd-category-body {
    padding: 14px 18px;
    background: #fff;
    animation: hdCatBodyFade 0.3s ease;
}

@keyframes hdCatBodyFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hd-skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

/* آیتم مهارت */
.hd-skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #FDF6EC;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.hd-skill-item:hover {
    background: #FEF3E2;
    border-color: #FDE4A8;
}

.hd-skill-item.selected {
    background: linear-gradient(135deg, #FBC251, #E5A82E);
    border-color: #E5A82E;
    color: #fff;
    box-shadow: 0 3px 10px rgba(251, 194, 81, 0.35);
}

.hd-skill-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.hd-skill-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #fff;
    border: 2px solid #FDE4A8;
    color: transparent;
    font-size: 13px;
    font-weight: 900;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.hd-skill-item.selected .hd-skill-check {
    background: #fff;
    border-color: #fff;
    color: #E5A82E;
}

.hd-skill-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #3D2E1F;
    line-height: 1.5;
    flex: 1;
}

.hd-skill-item.selected .hd-skill-name {
    color: #fff;
    font-weight: 700;
}

/* خلاصه انتخاب */
.hd-skills-summary {
    padding: 16px 18px;
    background: #F0FDF4;
    border-radius: 14px;
    border-right: 4px solid #10B981;
    margin-top: 16px;
}

.hd-skills-summary-title {
    font-size: 14px;
    font-weight: 800;
    color: #065F46;
    margin: 0 0 12px;
}

.hd-skills-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hd-skills-summary-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #fff;
    color: #065F46;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 50px;
    border: 1px solid #A7F3D0;
}

.hd-skills-summary-list li::before {
    content: '✓';
    color: #10B981;
    font-weight: 900;
}

/* پیام هشدار */
.hd-skills-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    margin-top: 12px;
    border-right: 4px solid;
}

.hd-skills-message.hd-msg-warning {
    background: #FFF9E6;
    border-right-color: #FBC251;
    color: #7A4F00;
}

.hd-skills-message.hd-msg-error {
    background: #FEF2F2;
    border-right-color: #EF4444;
    color: #991B1B;
}

.hd-skills-message.hd-msg-success {
    background: #F0FDF4;
    border-right-color: #10B981;
    color: #065F46;
}

/* ============================================================
   ریسپانسیو
   ============================================================ */
@media (max-width: 782px) {
    .hd-catalog-form-wrap {
        padding: 20px 18px;
    }

    .hd-form-grid {
        grid-template-columns: 1fr;
    }

    .hd-form-actions {
        flex-direction: column;
    }

    .hd-form-actions .hd-btn {
        width: 100%;
    }

    .hd-tabs {
        flex-direction: column;
    }

    .hd-tab {
        width: 100%;
    }

    .hd-catalog-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hd-catalog-actions .hd-btn,
    .hd-catalog-actions form {
        width: 100%;
    }

    .hd-catalog-actions form button {
        width: 100%;
    }

    .hd-catalog-summary-grid {
        grid-template-columns: 1fr;
    }

    .hd-blacklist-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
    }

    .hd-blacklist-stat {
        padding: 10px 12px;
    }

    .hd-blacklist-stat-label {
        font-size: 12px;
    }

    .hd-weights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hd-weights-total {
        font-size: 14px;
    }

    .hd-weights-total strong {
        font-size: 18px;
    }

    /* مهارت‌ها */
    .hd-skills-list {
        grid-template-columns: 1fr;
    }

    .hd-category-header {
        padding: 12px 14px;
        gap: 8px;
    }

    .hd-category-name {
        font-size: 13px;
    }

    .hd-category-count {
        font-size: 11px;
        min-width: 44px;
    }

    .hd-skill-name {
        font-size: 13px;
    }

    .hd-skills-stat {
        padding: 14px 16px;
    }

    .hd-skills-stat-value {
        font-size: 18px;
    }

    .hd-skills-categories-filter {
        padding: 12px;
    }

    .hd-cat-chip {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .hd-blacklist-stats {
        grid-template-columns: 1fr;
    }

    .hd-weights-grid {
        grid-template-columns: 1fr;
    }

    .hd-skills-stats-grid {
        grid-template-columns: 1fr;
    }
}