#gfr-dashboard {
    direction: rtl;
    font-family: inherit, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

#gfr-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.gfr-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-end;
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border: 1px solid #e8ecef;
}

.gfr-filter {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.gfr-filter label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gfr-filter select {
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #e8ecef;
    min-width: 180px;
    font-size: 14px;
    background: #ffffff;
    color: #2c3e50;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
}

.gfr-filter select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.gfr-filter select:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

#gfr-filter-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-height: 48px;
}

#gfr-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

#gfr-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.gfr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gfr-stat-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #e8ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.gfr-stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.gfr-stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.gfr-stat-box:nth-child(1)::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.gfr-stat-box:nth-child(2)::before {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.gfr-stat-box:nth-child(3)::before {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.gfr-stat-box:nth-child(4)::before {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

.gfr-stat-box:nth-child(5)::before {
    background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
}

.stat-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 500;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 5px;
}

.gfr-chart-wrap {
    margin-top: 30px;
    background: #ffffff;
    padding: 30px;
    border: 1px solid #e8ecef;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: relative;
}

.gfr-chart-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

/* جدول DataTables */
#gfr-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border: 1px solid #e8ecef;
    margin-bottom: 30px;
}

#gfr-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

#gfr-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #2c3e50;
    font-size: 14px;
}

#gfr-table tbody tr:hover {
    background-color: #f8f9ff;
}

#gfr-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

#gfr-table tbody tr:nth-child(even):hover {
    background-color: #f8f9ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    #gfr-dashboard {
        margin: 10px 0;
        padding: 15px;
    }
    
    .gfr-filters {
        padding: 20px;
        gap: 15px;
    }
    
    .gfr-filter {
        min-width: 100%;
    }
    
    .gfr-filter select {
        min-width: 100%;
    }
    
    #gfr-filter-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    .gfr-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-value {
        font-size: 2em;
    }
    
    .gfr-chart-wrap {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .gfr-stat-box {
        padding: 20px 15px;
    }
    
    .stat-value {
        font-size: 1.8em;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    #gfr-table thead th,
    #gfr-table tbody td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

/* انیمیشن‌های اضافی */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gfr-stat-box {
    animation: fadeInUp 0.6s ease-out;
}

.gfr-stat-box:nth-child(1) { animation-delay: 0.1s; }
.gfr-stat-box:nth-child(2) { animation-delay: 0.2s; }
.gfr-stat-box:nth-child(3) { animation-delay: 0.3s; }
.gfr-stat-box:nth-child(4) { animation-delay: 0.4s; }
.gfr-stat-box:nth-child(5) { animation-delay: 0.5s; }

/* اسکرول بار سفارشی */
#gfr-dashboard ::-webkit-scrollbar {
    width: 8px;
}

#gfr-dashboard ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#gfr-dashboard ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

#gfr-dashboard ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* فوکوس و دسترسی */
#gfr-filter-btn:focus,
.gfr-filter select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* لودینگ اسپینر برای دکمه */
#gfr-filter-btn.loading {
    position: relative;
    color: transparent;
}

#gfr-filter-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* لودینگ کلی شورت کد */
#gfr-dashboard {
    position: relative;
}

#gfr-dashboard.loading {
    pointer-events: none;
}

.gfr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gfr-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gfr-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* اسپینر اصلی */
.gfr-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.gfr-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #e8ecef;
    border-top-color: #667eea;
    border-right-color: #764ba2;
    animation: spin 1s linear infinite;
}

.gfr-spinner::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #667eea;
    animation: spin 1.5s linear infinite reverse;
}

/* متن لودینگ */
.gfr-loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    letter-spacing: 0.5px;
}

.gfr-loading-subtext {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin-top: 5px;
    animation: pulse 2s ease-in-out infinite;
}

/* انیمیشن‌ها */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* نقاط متحرک */
.gfr-dots {
    display: inline-flex;
    gap: 4px;
    margin-right: 5px;
}

.gfr-dots span {
    width: 4px;
    height: 4px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.gfr-dots span:nth-child(1) { animation-delay: -0.32s; }
.gfr-dots span:nth-child(2) { animation-delay: -0.16s; }
.gfr-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* لودینگ مراحل مختلف */
.gfr-loading-stage {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 10px;
    min-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.gfr-loading-stage.active {
    color: #667eea;
    font-weight: 600;
}

.gfr-loading-stage::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gfr-loading-stage.active::before {
    opacity: 1;
}

/* پروگرس بار */
.gfr-progress-bar {
    width: 200px;
    height: 3px;
    background: #e8ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.gfr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive */
@media (max-width: 768px) {
    .gfr-spinner {
        width: 50px;
        height: 50px;
    }
    
    .gfr-loading-text {
        font-size: 14px;
    }
    
    .gfr-loading-subtext {
        font-size: 12px;
    }
    
    .gfr-progress-bar {
        width: 150px;
    }
}
/* استایل‌های کنترل‌های نمودار */
.gfr-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-end;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8ecef;
}

.gfr-chart-control {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.gfr-chart-control label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gfr-chart-control select {
    padding: 10px 12px;
    border-radius: 6px;
    border: 2px solid #e8ecef;
    font-size: 13px;
    background: #ffffff;
    color: #2c3e50;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
}

.gfr-chart-control select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chart-update {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    min-height: 40px;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
}

#chart-update:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* آمار نمودار */
.gfr-chart-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.chart-stat {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #e8ecef;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chart-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-stat:nth-child(1) {
    border-top: 3px solid #667eea;
}

.chart-stat:nth-child(2) {
    border-top: 3px solid #22c55e;
}

.chart-stat:nth-child(3) {
    border-top: 3px solid #ef4444;
}

.chart-stat span {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-top: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* بهبود نمودار */
.gfr-chart-wrap {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #e8ecef;
}

.gfr-chart-wrap h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.gfr-chart-wrap h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Responsive Design برای کنترل‌های جدید */
@media (max-width: 768px) {
    .gfr-chart-controls {
        padding: 15px;
        gap: 12px;
    }
    
    .gfr-chart-control {
        min-width: 120px;
        flex: 1;
    }
    
    #chart-update {
        width: 100%;
        margin-top: 10px;
    }
    
    .gfr-chart-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-stat {
        padding: 12px 15px;
    }
    
    .chart-stat span {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .gfr-chart-control {
        min-width: 100%;
    }
    
    .gfr-chart-controls {
        flex-direction: column;
    }
    
    .chart-stat {
        font-size: 13px;
    }
    
    .chart-stat span {
        font-size: 15px;
    }
}
