/**
 * Advanced Table Widget Styles
 * استایل ویجت جدول پیشرفته
 */

/* ==============================================
   Base Table Styles
   ============================================== */
   a {
	   text-decoration: none !important;
   }
.advanced-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
}
a.table-button.btn-custom.cell-icon-text:hover {
    background: #C62828 !important;
}
.advanced-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: inherit;
}

.advanced-table th,
.advanced-table td {
    border: 1px solid #dee2e6;
    vertical-align: middle;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.advanced-table thead th {
    font-weight: 600;
    white-space: nowrap;
}

/* ==============================================
   Header Icon Styles
   ============================================== */
.advanced-table .header-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.advanced-table .header-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.advanced-table .header-icon i {
    font-size: 1em;
}

/* ==============================================
   Cell Content Styles
   ============================================== */
.advanced-table .cell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.advanced-table .cell-icon svg {
    width: 1.2em;
    height: 1.2em;
    fill: currentColor;
}

.advanced-table .cell-icon i {
    font-size: 1.2em;
}

.advanced-table .cell-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.advanced-table td img {
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==============================================
   Link Styles
   ============================================== */
.advanced-table td a:not(.table-button) {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.advanced-table td a:not(.table-button):hover {
    color: #222;
    text-decoration: underline;
}

/* ==============================================
   Button Styles
   ============================================== */
.advanced-table .table-button {
    display: inline-flex;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}
/* حالت عادی - مخفی */
figure.swiper-slide-inner:after {
    content: "\f00e";
    font-size: 25px;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900; /* برای آیکون‌های Solid */
    position: absolute;
    width: 50px;
    height: 50px;
    left: 50%;
    top: 51%;
    transform: translate(-50%, -50%) scale(0);
    background-color: #FF4D4D;
    border-radius: 50%;
    color: #fff;
    line-height: 49px;
    text-align: center;
    z-index: 9999999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* حالت hover - نمایش */
figure.swiper-slide-inner:hover:after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.advanced-table .table-button.btn-primary {
    background-color: #DCEDC8;
    color: #4CAF50;
    border-color: #C8E6C9;
}

.advanced-table .table-button.btn-primary:hover {
    background-color: #4CAF50;
    border-color: #4CAF50;
	color: #fff;
}

.advanced-table .table-button.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.advanced-table .table-button.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.advanced-table .table-button.btn-success {
    background-color: #27ae60;
    color: #ffffff;
    border-color: #27ae60;
}

.advanced-table .table-button.btn-success:hover {
    background-color: #1e8449;
    border-color: #1e8449;
}

.advanced-table .table-button.btn-danger {
    background-color: #e74c3c;
    color: #ffffff;
    border-color: #e74c3c;
}

.advanced-table .table-button.btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

.advanced-table .table-button.btn-warning {
    background-color: #f39c12;
    color: #ffffff;
    border-color: #f39c12;
}

.advanced-table .table-button.btn-warning:hover {
    background-color: #d68910;
    border-color: #d68910;
}

.advanced-table .table-button.btn-info {
    background-color: #17a2b8;
    color: #ffffff;
    border-color: #17a2b8;
}

.advanced-table .table-button.btn-info:hover {
    background-color: #138496;
    border-color: #138496;
}

.advanced-table .table-button.btn-outline {
    background-color: transparent;
    color: #3498db;
    border-color: #3498db;
}

.advanced-table .table-button.btn-outline:hover {
    background-color: #3498db;
    color: #ffffff;
}

/* ==============================================
   Striped Rows
   ============================================== */
.advanced-table.striped tbody tr:nth-child(even) td {
    background-color: #f8f9fa;
}

/* ==============================================
   Hover Effect
   ============================================== */
.advanced-table.hoverable tbody tr:hover td {
    background-color: #e3f2fd;
}

/* ==============================================
   Responsive - Scroll Mode
   ============================================== */
@media screen and (max-width: 768px) {
    .advanced-table-wrapper {
        overflow-x: auto;
    }
    
    .advanced-table.responsive-scroll {
        min-width: 600px;
    }
}

/* ==============================================
   Responsive - Stack Mode (Card View)
   ============================================== */
@media screen and (max-width: 768px) {
    .advanced-table.responsive-stack {
        display: block;
    }
    
    .advanced-table.responsive-stack thead {
        display: none;
    }
    
    .advanced-table.responsive-stack tbody {
        display: block;
    }
    
    .advanced-table.responsive-stack tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .advanced-table.responsive-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border: none;
        border-bottom: 1px solid #eee;
        text-align: right;
    }
    
    .advanced-table.responsive-stack tbody td:last-child {
        border-bottom: none;
    }
    
    .advanced-table.responsive-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2c3e50;
        margin-left: 15px;
        flex-shrink: 0;
    }
    
    .advanced-table.responsive-stack tbody td:empty::before {
        content: none;
    }
}

/* ==============================================
   Responsive - Collapse Mode
   ============================================== */
@media screen and (max-width: 768px) {
    .advanced-table.responsive-collapse th,
    .advanced-table.responsive-collapse td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    .advanced-table.responsive-collapse .table-button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

/* ==============================================
   RTL Support
   ============================================== */
[dir="rtl"] .advanced-table .header-icon {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .advanced-table.responsive-stack tbody td::before {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .advanced-table .cell-icon-text {
    flex-direction: row-reverse;
}

/* ==============================================
   Print Styles
   ============================================== */
@media print {
    .advanced-table-wrapper {
        overflow: visible;
    }
    
    .advanced-table {
        page-break-inside: auto;
    }
    
    .advanced-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    .advanced-table thead {
        display: table-header-group;
    }
    
    .advanced-table .table-button {
        border: 1px solid #333;
        background: none !important;
        color: #333 !important;
    }
}