/* بهینه‌سازی CSS برای آل ور */

/* Critical CSS - بارگذاری اولیه */
.fa, .fas, .far, .fab {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.far {
    font-weight: 400;
}

.fab {
    font-family: "Font Awesome 6 Brands" !important;
}

/* بهینه‌سازی آمار */
.alwer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #007cba;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 24px;
    color: #007cba;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* بهینه‌سازی منوی حساب کاربری */
.woocommerce-MyAccount-navigation {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-MyAccount-navigation li {
    margin-bottom: 10px;
}

.woocommerce-MyAccount-navigation a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.woocommerce-MyAccount-navigation a:hover,
.woocommerce-MyAccount-navigation a.is-active {
    background: #007cba;
    color: white;
}

.woocommerce-MyAccount-navigation a i {
    margin-left: 10px;
    width: 20px;
    text-align: center;
}

/* بهینه‌سازی تب‌ها */
.stats-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 30px;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.tab-button.active {
    color: #007cba;
    border-bottom-color: #007cba;
    font-weight: bold;
}

.tab-button:hover {
    color: #007cba;
    background: #f8f9fa;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* بهینه‌سازی responsive */
@media (max-width: 768px) {
    .alwer-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        text-align: center;
        border-bottom: 1px solid #e9ecef;
        border-right: none;
        min-width: auto;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-icon {
        font-size: 20px;
    }
}

/* بهینه‌سازی انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: fadeIn 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* بهینه‌سازی لودینگ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* بهینه‌سازی فونت‌ها - FontAwesome از CDN استفاده می‌شود */

/* بهینه‌سازی تصاویر */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* بهینه‌سازی لینک‌ها */
a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #005a87;
}

/* بهینه‌سازی دکمه‌ها */
button, .button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

button:hover, .button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* بهینه‌سازی فرم‌ها */
input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}
