/* ============================================
   طراحی مدرن و ریسپانسیو Pack Mazeh
   ============================================ */

:root {
    /* فواصل مدرن */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* شعاع مینیمال */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* سایه‌های مدرن */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* انیمیشن‌ها */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   بهبودهای عمومی
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   جداول مدرن و ریسپانسیو
   ============================================ */

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 640px;
    background: var(--glass-splash);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

table thead {
    background: var(--mazeh-purple);
}

table thead th {
    padding: var(--space-lg);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: right;
    color: white;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: all var(--transition-fast);
    cursor: pointer;
}

table tbody tr:hover {
    background: rgba(114, 52, 153, 0.05);
    transform: scale(1.01);
}

table tbody td {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   کارت‌های مدرن
   ============================================ */

.card-modern {
    background: var(--glass-splash);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--splash-purple);
}

/* ============================================
   دکمه‌های مدرن و ریسپانسیو
   ============================================ */

.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    min-height: 44px; /* برای لمس راحت در موبایل */
}

.btn-modern i {
    font-size: 1rem;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-modern:active {
    transform: translateY(0);
}

/* دکمه‌های رنگ‌بندی شده */
.btn-primary-modern {
    background: linear-gradient(135deg, var(--mazeh-purple), var(--mazeh-purple-dark));
    color: white;
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, var(--mazeh-purple-dark), var(--mazeh-purple));
    color: white;
}

.btn-success-modern {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-warning-modern {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-danger-modern {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-info-modern {
    background: linear-gradient(135deg, var(--candy-turquoise), var(--candy-turquoise-dark));
    color: white;
}

.btn-secondary-modern {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-splash-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* دکمه‌های کوچک */
.btn-sm-modern {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    min-height: 36px;
}

/* دکمه‌های بزرگ */
.btn-lg-modern {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 52px;
}

/* ============================================
   فرم‌های مدرن
   ============================================ */

.form-group-modern {
    margin-bottom: var(--space-lg);
}

.form-label-modern {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-splash-primary);
}

.form-input-modern,
.form-select-modern,
.form-textarea-modern {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-splash-primary);
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
    min-height: 44px; /* برای لمس راحت */
}

.form-input-modern:focus,
.form-select-modern:focus,
.form-textarea-modern:focus {
    outline: none;
    border-color: var(--splash-purple);
    box-shadow: 0 0 0 3px rgba(114, 52, 153, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.form-textarea-modern {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   مودال‌های مدرن
   ============================================ */

.modal-modern {
    background: var(--glass-splash);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.modal-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title-modern {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-splash-primary);
}

.modal-close-modern {
    background: none;
    border: none;
    color: var(--text-splash-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: var(--space-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close-modern:hover {
    color: var(--text-splash-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   داشبورد بهبود یافته
   ============================================ */

.dashboard-welcome-header {
    background: linear-gradient(135deg, var(--mazeh-purple), var(--mazeh-purple-dark));
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-item {
    background: var(--glass-splash);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.stat-item--primary .stat-icon-wrapper {
    background: linear-gradient(135deg, var(--mazeh-purple), var(--mazeh-purple-dark));
    color: white;
}

.stat-item--success .stat-icon-wrapper {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.stat-item--warning .stat-icon-wrapper {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.stat-item--info .stat-icon-wrapper {
    background: linear-gradient(135deg, var(--candy-turquoise), var(--candy-turquoise-dark));
    color: white;
}

.stat-item--danger .stat-icon-wrapper {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-splash-primary);
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-splash-secondary);
    margin-bottom: var(--space-xs);
}

.stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-splash-muted);
}

/* ============================================
   باتجرها و تگ‌ها
   ============================================ */

.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.badge-secondary {
    background: rgba(114, 52, 153, 0.2);
    color: var(--mazeh-purple);
}

/* ============================================
   فیوتر و جداکننده‌ها
   ============================================ */

.divider-modern {
    height: 1px;
    background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: var(--space-xl) 0;
}

.separator-modern {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 var(--space-md);
}

/* ============================================
   محتوای قابل گسترش (Accordion)
   ============================================ */

.accordion-modern {
    background: var(--glass-splash);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header-modern {
    padding: var(--space-lg);
    background: var(--mazeh-purple);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-fast);
}

.accordion-header-modern:hover {
    background: var(--mazeh-purple-dark);
}

.accordion-title-modern {
    font-weight: 600;
    color: white;
}

.accordion-icon-modern {
    transition: transform var(--transition-normal);
}

.accordion-header-modern.active .accordion-icon-modern {
    transform: rotate(180deg);
}

.accordion-content-modern {
    padding: var(--space-lg);
    display: none;
}

.accordion-content-modern.active {
    display: block;
}

/* ============================================
   ریسپانسیو - موبایل
   ============================================ */

@media (max-width: 768px) {
    /* جداول در موبایل */
    .table-responsive-wrapper {
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.8125rem;
    }
    
    table thead th,
    table tbody td {
        padding: var(--space-md);
    }
    
    /* کارت‌ها */
    .card-modern {
        padding: var(--space-lg);
    }
    
    /* آمار */
    .stats-overview {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .stat-item {
        padding: var(--space-lg);
    }
    
    .stat-icon-wrapper {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* دکمه‌ها */
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
    
    /* مودال */
    .modal-modern {
        padding: var(--space-lg);
        max-width: 95vw;
    }
    
    .modal-title-modern {
        font-size: 1.25rem;
    }
    
    /* فرم */
    .form-input-modern,
    .form-select-modern,
    .form-textarea-modern {
        padding: 0.75rem;
        font-size: 16px; /* جلوگیری از زوم در iOS */
    }
    
    /* Dashboard */
    .dashboard-welcome-header {
        padding: var(--space-lg);
    }
}

@media (max-width: 480px) {
    /* اندازه فونت‌ها */
    table {
        font-size: 0.75rem;
        min-width: 600px;
    }
    
    table thead th,
    table tbody td {
        padding: var(--space-sm);
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
    
    .btn-sm-modern {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
}

/* ============================================
   ریسپانسیو - تبلت
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   انیمیشن‌های ظریف
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ============================================
   بهبود دسترسی (Accessibility)
   ============================================ */

.btn-modern:focus-visible,
.form-input-modern:focus-visible,
.form-select-modern:focus-visible {
    outline: 2px solid var(--mazeh-purple);
    outline-offset: 2px;
}

/* حالت دکمه‌های غیرفعال */
.btn-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   گلد ریدی (Grid) سیستم
   ============================================ */

.grid-modern {
    display: grid;
    gap: var(--space-lg);
}

.grid-1 { grid-template-columns: repeat(1, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   لودرها و Spinner
   ============================================ */

.spinner-modern {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--mazeh-purple);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   هشدارها و پیام‌ها
   ============================================ */

.alert-modern {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.alert-modern i {
    font-size: 1.25rem;
    margin-top: 2px;
}

.alert-success-modern {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
    color: #10b981;
}

.alert-danger-modern {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
    color: #ef4444;
}

.alert-warning-modern {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #f59e0b;
}

.alert-info-modern {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: #3b82f6;
}

/* ============================================
   پیجینیشن مدرن
   ============================================ */

.pagination-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-xl) 0;
}

.pagination-btn-modern {
    min-width: 44px;
    height: 44px;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--glass-splash);
    color: var(--text-splash-primary);
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.pagination-btn-modern:hover:not(.disabled):not(.active) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.pagination-btn-modern.active {
    background: var(--mazeh-purple);
    color: white;
    border-color: var(--mazeh-purple);
}

.pagination-btn-modern.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .pagination-modern {
        gap: var(--space-xs);
    }
    
    .pagination-btn-modern {
        min-width: 40px;
        height: 40px;
        padding: 0 var(--space-sm);
        font-size: 0.875rem;
    }
}

