

/**
 * loan table style
 */
/**
 * loan table style
 */
        /* استایل عنوان اصلی جدول */
        .loan-table-main-title {
            text-align: center;
            color: #2d3748;
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 3px solid #4f46e5;
            position: relative;
        }

        .loan-table-main-title:after {
            content: '';
            position: absolute;
            bottom: -3px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 3px;
            background: linear-gradient(135deg, #4f46e5, #7c3aed);
            border-radius: 3px;
        }

        /* استایل جدول وام - نسخه اصلاح شده و سازگار */
        .loan-comparison-table-container {
            width: 100% !important;
            margin: 20px 0 !important;
            background: white !important;
            border-radius: 12px !important;
            overflow: visible !important; /* تغییر به visible برای جلوگیری از overflow */
            box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        }

        .loan-comparison-table {
            width: 100% !important;
            border-collapse: separate !important;
            border-spacing: 0 !important;
            table-layout: fixed !important;
        }

        .loan-comparison-table th {
            background: linear-gradient(135deg, #4f46e5, #7c3aed);
            color: white;
            padding: 10px 6px;
            text-align: center;
            font-weight: 600;
            font-size: 14px;
            white-space: normal;
            word-wrap: break-word;
            line-height: 1.2;
            border-bottom: 2px solid #4f46e5;
        }

        .loan-comparison-table td {
            padding: 8px 4px;
            text-align: center;
            border-left: 1px solid #f1f5f9;
            font-size: 12px;
            line-height: 1.2;
            vertical-align: middle;
            height: auto !important; /* اجازه expand به height */
            max-height: none !important;
        }

        /* خط افقی بین مشخصات هر طرح (داخل گروه) - کم‌رنگ و ظریف برای جداسازی نام طرح از اطلاعات */
        .loan-comparison-table .loan-group td {
            border-bottom: 1px solid #f3f4f6; /* خط ظریف زیر ردیف اصلی (نام طرح و اطلاعات) */
        }

        /* استایل‌های HTML5 details و summary - آپدیت شده برای دکمه جزئیات */
        details {
            flex-shrink: 0;
            margin: 0;
            width: 100%;
        }

        summary {
            background: transparent;
            color: #4f46e5;
            border: none;
            padding: 5px 10px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all 0.3s ease;
            text-decoration: none;
            list-style: none;
            justify-content: flex-end;
        }

        summary::-webkit-details-marker {
            display: none;
        }

        summary:hover {
            color: #3730a3;
            background: #f3f4f6;
        }

        summary::after {
            content: '>';
            transition: transform 0.3s ease;
        }

        details[open] summary::after {
            transform: rotate(90deg);
        }

        .detail-content {
            margin-top: 10px;
            line-height: 1.6;
            direction: rtl;
            font-size: 14px;
            padding: 15px;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            max-height: none !important; /* بدون محدودیت height */
            overflow: visible !important;
        }

        .vote-row-actions {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            gap: 15px;
            direction: rtl;
            width: 100%;
            padding: 10px 15px;
            background: #f9fafb;
            border-top: none !important; /* حذف border-top */
        }

        /* جداکننده اضافی بین طرح‌ها در صورت نیاز */
        .loan-comparison-table tr.loan-group-separator .vote-row-actions {
            border-bottom: 3px solid #e5e7eb !important;
        }

        .loan-comparison-table tr:hover td {
            background-color: #f8fafc;
        }

        /* تنظیم عرض ستون‌ها - تنظیم جدید برای 4 ستون */
        .loan-comparison-table th:nth-child(1),
        .loan-comparison-table td:nth-child(1) {
            width: 35%;
            border-left: 1px solid #f1f5f9;
        }

        .loan-comparison-table th:nth-child(2),
        .loan-comparison-table td:nth-child(2) {
            width: 25%;
            border-left: 1px solid #f1f5f9;
        }

        .loan-comparison-table th:nth-child(3),
        .loan-comparison-table td:nth-child(3) {
            width: 20%;
            border-left: 1px solid #f1f5f9;
        }

        .loan-comparison-table th:nth-child(4),
        .loan-comparison-table td:nth-child(4) {
            width: 20%;
            border-left: none;
        }

        /* استایل گروه پست - پس‌زمینه برای ردیف اصلی */
        .loan-group td {
            background: #f9fafb; /* پس‌زمینه متفاوت برای هر پست */
        }

        .loan-name-link {
            font-weight: 700;
            color: #4f46e5;
            text-decoration: none;
            padding: 5px 8px;
            border: 2px solid #4f46e5;
            border-radius: 6px;
            display: inline-block;
            transition: all 0.3s ease;
            background: white;
            font-size: 12px;
            line-height: 1.1;
            text-align: center;
            width: 90%;
            margin: 0 auto;
        }

        .loan-name-link:hover {
            background: #4f46e5;
            color: white;
            transform: translateY(-2px);
            text-decoration: none;
        }

        .loan-interest-rate {
            margin-top: 4px;
        }

        .loan-interest-rate .interest-rate-badge {
            color: #dc2626;
            padding: 3px 8px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 12px;
            display: inline-block;
            line-height: 1.1;
        }

        .amount-display {
            font-weight: 700;
            color: #1f2937;
            direction: rtl;
            font-size: 12px;
            line-height: 1.1;
        }

        .repayment-period {
            color: #2d3037;
            font-weight: 500;
            font-size: 12px;
            line-height: 1.1;
        }

        .vote-section {
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 10px;
            flex: 1;
        }

        .vote-btn {
            background: none;
            border: 2px solid;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.3s ease;
            font-size: 12px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 3px;
            position: relative;
            overflow: hidden;
            min-width: 60px;
            justify-content: center;
            line-height: 1.1;
            height: 28px;
        }

        .vote-btn::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255,255,255,0.3);
            border-radius: 50%;
            transition: all 0.3s ease;
            transform: translate(-50%, -50%);
        }

        .vote-btn:active::after {
            width: 100px;
            height: 100px;
        }

        .like-btn {
            color: #6b7280;
            border-color: #d1d5db;
            background: white;
        }

        .like-btn:hover {
            color: #059669;
            border-color: #059669;
            background: #f0fdf4;
        }

        .like-btn.active {
            color: white;
            border-color: #059669;
            background: #059669;
            box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
        }

        .dislike-btn {
            color: #6b7280;
            border-color: #d1d5db;
            background: white;
        }

        .dislike-btn:hover {
            color: #dc2626;
            border-color: #dc2626;
            background: #fef2f2;
        }

        .dislike-btn.active {
            color: white;
            border-color: #dc2626;
            background: #dc2626;
            box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
        }

        .vote-count {
            font-weight: 700;
            font-size: 12px;
            min-width: 16px;
            display: inline-block;
        }

        .like-count {
            color: #059669;
        }

        .dislike-count {
            color: #dc2626;
        }

        .vote-btn.active .vote-count {
            color: white;
        }

        .vote-percentage {
            font-size: 10px;
            color: #6b7280;
            font-weight: 500;
            line-height: 1;
            margin-top: 2px;
        }

        .vote-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none !important;
        }

        .vote-btn:disabled:hover {
            color: inherit;
            border-color: #d1d5db;
            background: white;
        }

        .rate-limit-message {
            color: #dc2626;
            font-size: 11px;
            margin-top: 5px;
            display: none;
            text-align: center;
        }

        /* استایل بخش آمار کاربران */
        .user-feedback-stats {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            padding: 20px;
            border-radius: 12px;
            margin: 30px 0;
            text-align: center;
        }

        .user-feedback-stats h3 {
            margin-bottom: 20px;
            font-size: 1.3rem;
            font-weight: 600;
            color: #2d3748;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            max-width: 1000px;
            margin: 0 auto;
        }

        .stat-item {
            background: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            border: 1px solid #e2e8f0;
        }

        .stat-number {
            font-size: 1.8rem;
            font-weight: bold;
            margin-bottom: 5px;
            color: #4f46e5;
        }

        .stat-popular {
            font-size: 1.1rem;
            font-weight: bold;
            margin-bottom: 5px;
            color: #059669;
        }

        .stat-label {
            font-size: 0.9rem;
            color: #6b7280;
        }

        /* ریسپانسیو */
        @media (max-width: 1024px) {
            .loan-table-main-title {
                font-size: 1.6rem;
            }
            
            .loan-comparison-table th,
            .loan-comparison-table td {
                padding: 6px 3px;
            }
            
            .loan-name-link {
                padding: 4px 6px;
                font-size: 12px;
            }
            
            .vote-btn {
                padding: 3px 6px;
                min-width: 55px;
                font-size: 11px;
                height: 26px;
            }
            
            .loan-interest-rate .interest-rate-badge {
                font-size: 11px;
                padding: 2px 6px;
            }
            
            .stats-grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 12px;
            }
            
            .stat-item {
                padding: 12px;
            }
            
            .stat-number {
                font-size: 1.5rem;
            }
        }

        @media (max-width: 768px) {
            .loan-table-main-title {
                font-size: 1.4rem;
                margin-bottom: 20px;
            }
            
            .loan-comparison-table-container {
                margin: 10px 0;
                border-radius: 8px;
            }
            
            .loan-comparison-table th,
            .loan-comparison-table td {
                padding: 6px 3px;
                font-size: 12px;
            }
            
            .loan-comparison-table th {
                padding: 8px 3px;
                font-size: 14px;
            }
            
            .loan-name-link {
                padding: 4px 6px;
                font-size: 12px;
                width: 95%;
            }
            
            .vote-section {
                gap: 3px;
            }
            
            .vote-btn {
                padding: 3px 6px;
                min-width: 55px;
                font-size: 11px;
                height: 26px;
            }
            
            .loan-interest-rate .interest-rate-badge {
                padding: 2px 6px;
                font-size: 10px;
				display: none;
            }
            
            .user-feedback-stats {
                padding: 15px;
                margin: 20px 0;
            }
            
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            
            .stat-number {
                font-size: 1.3rem;
            }
            
            .user-feedback-stats h3 {
                font-size: 1.1rem;
            }

            .loan-comparison-table td {
                border-right: none;
            }

            .vote-row-actions {
                flex-direction: column;
                gap: 10px;
                padding: 10px;
            }

            summary {
                justify-content: center;
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            .loan-table-main-title {
                font-size: 1.2rem;
            }
            
            .loan-comparison-table th:nth-child(1),
            .loan-comparison-table td:nth-child(1) {
                width: 30%;
            }
            
            .loan-comparison-table th:nth-child(2),
            .loan-comparison-table td:nth-child(2) {
                width: 28%;
            }
            
            .loan-comparison-table th:nth-child(3),
            .loan-comparison-table td:nth-child(3) {
                width: 22%;
            }
            
            .loan-comparison-table th:nth-child(4),
            .loan-comparison-table td:nth-child(4) {
                width: 20%;
            }
            
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
            }
            
            .stat-item {
                padding: 10px;
            }
            
            .stat-number {
                font-size: 1.2rem;
            }
            
            .stat-popular {
                font-size: 0.9rem;
            }
            
            .stat-label {
                font-size: 0.8rem;
            }

            summary {
                padding: 4px 8px;
                font-size: 11px;
            }

            .vote-btn {
                padding: 2px 5px;
                min-width: 50px;
                font-size: 10px;
                height: 24px;
            }
        }

        /* انیمیشن‌ها */
        @keyframes bounce {
            0%, 20%, 53%, 80%, 100% {
                transform: translate3d(0,0,0);
            }
            40%, 43% {
                transform: translate3d(0,-8px,0);
            }
            70% {
                transform: translate3d(0,-4px,0);
            }
            90% {
                transform: translate3d(0,-2px,0);
            }
        }

        .vote-btn.voted {
            animation: bounce 0.5s ease;
        }

        /* استایل‌های سیستم امبد */
        .loan-embed-container {
            width: 100% !important;
            margin: 0 auto !important;
            font-family: system-ui, -apple-system, sans-serif !important;
        }

        .embed-table-container {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .embed-footer {
            text-align: center;
            margin-top: 20px;
            padding: 15px;
            background: #f8fafc;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            font-size: 14px;
            color: #6b7280;
        }

        .embed-footer a {
            color: #4f46e5;
            text-decoration: none;
            font-weight: 600;
        }

        .embed-footer a:hover {
            text-decoration: underline;
        }

        /* ویجت امبد */
        .loan-widget-embed {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 15px;
            background: white;
            max-width: 100%;
            font-family: system-ui, sans-serif;
        }

        .widget-header h4 {
            margin: 0 0 10px 0;
            color: #374151;
            font-size: 16px;
            text-align: center;
        }

        .widget-footer {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #e5e7eb;
            text-align: center;
            font-size: 12px;
        }

        .widget-footer a {
            color: #4f46e5;
            text-decoration: none;
        }

        /* ریسپانسیو امبد */
        @media (max-width: 768px) {
            .loan-embed-container {
                margin: 10px 0 !important;
            }
            
            .embed-table-container {
                border-radius: 8px;
            }
            
            .embed-footer {
                padding: 12px;
                font-size: 12px;
            }
        }

        @media (max-width: 480px) {
            .loan-widget-embed {
                padding: 12px;
            }
            
            .widget-header h4 {
                font-size: 14px;
            }
        }
        
        
    

            /* استایل‌های وضعیت - حفظ شده برای نمایش دایره سبز/قرمز، حالا در ستون جداگانه */
            .status-badge {
                display: inline-flex;
                align-items: center;
                border-radius: 50px;
                font-size: 11px;
                font-weight: normal;
                color: white;
                text-align: center;
                min-width: 50px;
                padding-right: 5px;
            }
            .status-badge.active {
                background: radial-gradient(circle, #4CAF50, #A5D6A7); /* سبز از مرکز به بیرون کم‌رنگ */
            }
            .status-badge.inactive {
                background: radial-gradient(circle, #F44336, #E57373); /* قرمز از مرکز به بیرون کم‌رنگ */
            }
            .status-icon {
                margin-left: 4px;
                font-size: 14px;
            }
            .vote-btn:disabled {
                opacity: 0.5;
                cursor: not-allowed; /* غیرفعال کردن دکمه‌های vote برای طرح‌های inactive */
            }
            .loan-status-container {
                display: flex;
                flex-direction: column;
                align-items: flex-start; /* تراز چپ برای badge‌ها */
            }
            /* استایل‌های جدید برای ردیف جزئیات و دکمه‌ها */
            .loan-group {
                border-bottom: 3px solid #e5e7eb; /* جداکننده ضخیم بین هر طرح (پست) */
                background: #f9fafb; /* پس‌زمینه متفاوت برای هر پست */
                margin-bottom: 10px;
                border-radius: 8px;
                overflow: hidden;
            }
            /* استایل‌های HTML5 details و summary - آپدیت شده */
            details {
                margin: 0;
                border: none;
                border-radius: 0;
                overflow: visible;
            }
            summary {
                cursor: pointer;
                font-weight: normal;
                padding: 5px 10px;
                background: transparent;
                border: none;
                list-style: none;
                display: flex;
                justify-content: flex-end;
                align-items: center;
                direction: rtl;
                font-size: 12px;
                color: #4f46e5;
                text-decoration: none;
                border-radius: 6px;
                transition: all 0.3s ease;
                margin-left: auto; /* چسبیدن به راست در RTL */
            }
            summary::-webkit-details-marker {
                display: none;
            }
            summary::after {
                content: '>';
                margin-left: 5px;
                transition: transform 0.3s ease;
                font-size: 12px;
            }
            details[open] summary::after {
                transform: rotate(90deg);
            }
            details[open] summary {
                color: #3730a3;
            }
            .detail-content {
                margin-top: 10px;
                line-height: 1.6;
                direction: rtl;
                font-size: 14px;
                padding: 15px;
                background: #ffffff;
                border: 1px solid #e5e7eb;
                border-radius: 6px;
            }
            .vote-row-actions {
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                gap: 15px;
                direction: rtl; /* RTL */
                width: 100%;
                padding: 10px 15px;
                background: #f9fafb;
            }
            .vote-section {
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                gap: 10px;
                flex: 1;
            }
            .detail-row {
                display: table-row;
                background: transparent;
            }
            .detail-row td {
                padding: 0 !important;
                border: none !important;
                vertical-align: top !important;
            }
