/* CSS متطور للواجهة الأمامية - رتب العملاء مع عرض بالدولار */

:root {
    --rosh-primary: #667eea;
    --rosh-secondary: #764ba2;
    --rosh-success: #48bb78;
    --rosh-warning: #ed8936;
    --rosh-error: #f56565;
    --rosh-info: #4299e1;
    
    --rosh-bronze: #cd7f32;
    --rosh-silver: #c0c0c0;
    --rosh-gold: #ffd700;
    --rosh-vip: #9932cc;
    
    --rosh-bg-light: #f8fafc;
    --rosh-bg-white: #ffffff;
    --rosh-text-dark: #2d3748;
    --rosh-text-light: #718096;
    --rosh-border: #e2e8f0;
    
    --rosh-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --rosh-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rosh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --rosh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --rosh-radius-sm: 0.375rem;
    --rosh-radius-md: 0.5rem;
    --rosh-radius-lg: 0.75rem;
    --rosh-radius-xl: 1rem;
    --rosh-radius-2xl: 1.5rem;
}

/* إعادة تعيين عام */
.rosh-customer-dashboard *,
.rosh-rank-progress-widget *,
.rosh-rank-benefits * {
    box-sizing: border-box;
}

/* لوحة تحكم العميل الرئيسية */
.rosh-customer-dashboard {
    background: linear-gradient(135deg, var(--rosh-bg-light) 0%, #e2e8f0 100%);
    border-radius: var(--rosh-radius-2xl);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: var(--rosh-shadow-xl);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--rosh-border);
}

.rosh-customer-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(102,126,234,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

/* عنوان لوحة التحكم */
.rosh-dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.rosh-dashboard-header h3 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--rosh-primary) 0%, var(--rosh-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rosh-dashboard-subtitle {
    color: var(--rosh-text-light);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

/* الرتبة الحالية */
.rosh-current-rank {
    background: linear-gradient(135deg, var(--rosh-primary) 0%, var(--rosh-secondary) 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--rosh-radius-xl);
    margin-bottom: 2rem;
    box-shadow: var(--rosh-shadow-lg);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.rosh-current-rank::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rosh-rotate 20s linear infinite;
}

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

.rosh-rank-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.rosh-rank-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: rosh-bounce 2s infinite;
}

@keyframes rosh-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.rosh-rank-info {
    flex: 1;
}

.rosh-rank-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rosh-rank-discount {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.95;
    font-weight: 600;
}

.rosh-rank-stats {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--rosh-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.rosh-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rosh-stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.rosh-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    direction: ltr;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* الرتبة التالية */
.rosh-next-rank {
    background: linear-gradient(135deg, var(--rosh-success) 0%, #38a169 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--rosh-radius-xl);
    margin-bottom: 2rem;
    box-shadow: var(--rosh-shadow-lg);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.rosh-next-rank::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: rosh-shine 3s infinite;
}

@keyframes rosh-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.rosh-next-rank-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.rosh-next-rank-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rosh-next-rank-benefit {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.95;
    font-weight: 600;
}

/* حاوي شريط التقدم */
.rosh-progress-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--rosh-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.rosh-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.rosh-progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    direction: ltr;
    position: relative;
}

.rosh-progress {
    background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    height: 100%;
    border-radius: 6px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rosh-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: rosh-shimmer 2s infinite;
}

@keyframes rosh-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.rosh-progress-text {
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
}

/* مزايا الرتب */
.rosh-next-benefits,
.rosh-vip-benefits,
.rosh-bronze-benefits {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--rosh-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.rosh-next-benefits h5,
.rosh-vip-benefits h5,
.rosh-bronze-benefits h6 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.rosh-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rosh-benefits-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    padding-right: 2rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.rosh-benefits-list li:last-child {
    border-bottom: none;
}

.rosh-benefits-list li::before {
    content: '✓';
    position: absolute;
    right: 0;
    top: 0.75rem;
    color: #90cdf4;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* أعلى رتبة */
.rosh-max-rank {
    background: linear-gradient(135deg, var(--rosh-vip) 0%, #8a2be2 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--rosh-radius-xl);
    text-align: center;
    box-shadow: var(--rosh-shadow-lg);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.rosh-max-rank::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: rosh-pulse 4s infinite;
}

@keyframes rosh-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.rosh-max-rank h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* بدون رتبة */
.rosh-no-rank {
    background: linear-gradient(135deg, var(--rosh-gold) 0%, #ffb347 100%);
    color: var(--rosh-text-dark);
    padding: 2rem;
    border-radius: var(--rosh-radius-xl);
    text-align: center;
    box-shadow: var(--rosh-shadow-lg);
    position: relative;
    z-index: 1;
}

.rosh-welcome-content h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rosh-first-rank-info {
    background: rgba(255, 255, 255, 0.3);
    padding: 1.5rem;
    border-radius: var(--rosh-radius-lg);
    margin-top: 1.5rem;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.rosh-first-rank-info h5 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* قسم النصائح */
.rosh-tips-section {
    background: var(--rosh-bg-white);
    padding: 2rem;
    border-radius: var(--rosh-radius-xl);
    box-shadow: var(--rosh-shadow-md);
    margin-top: 2rem;
    position: relative;
    z-index: 1;
    border: 1px solid var(--rosh-border);
}

.rosh-tips-section h5 {
    color: var(--rosh-text-dark);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.rosh-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.rosh-tip-card {
    background: linear-gradient(135deg, var(--rosh-bg-light) 0%, #e2e8f0 100%);
    padding: 1.5rem;
    border-radius: var(--rosh-radius-lg);
    text-align: center;
    border: 2px solid var(--rosh-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rosh-tip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.rosh-tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rosh-shadow-lg);
    border-color: var(--rosh-primary);
}

.rosh-tip-card:hover::before {
    left: 100%;
}

.rosh-tip-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rosh-tip-card p {
    color: #4a5568;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

/* ألوان مخصصة للرتب */
.rosh-current-rank.bronze {
    background: linear-gradient(135deg, var(--rosh-bronze) 0%, #b7791f 100%);
}

.rosh-current-rank.silver {
    background: linear-gradient(135deg, var(--rosh-silver) 0%, #a0a0a0 100%);
}

.rosh-current-rank.gold {
    background: linear-gradient(135deg, var(--rosh-gold) 0%, #e6c200 100%);
    color: var(--rosh-text-dark);
}

.rosh-current-rank.gold .rosh-rank-name,
.rosh-current-rank.gold .rosh-rank-discount {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.rosh-current-rank.vip {
    background: linear-gradient(135deg, var(--rosh-vip) 0%, #7c2d92 100%);
}

/* شريط التقدم المستقل */
.rosh-rank-progress-widget {
    background: var(--rosh-bg-white);
    padding: 2rem;
    border-radius: var(--rosh-radius-xl);
    box-shadow: var(--rosh-shadow-md);
    margin: 2rem auto;
    max-width: 600px;
    direction: rtl;
    text-align: right;
    border: 1px solid var(--rosh-border);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rosh-rank-progress-widget h4 {
    color: var(--rosh-text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
}

.rosh-remaining {
    text-align: center;
    color: var(--rosh-text-light);
    font-size: 1.1rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* رسائل الحالة */
.rosh-login-notice,
.rosh-no-rank-progress,
.rosh-max-rank-progress {
    background: var(--rosh-bg-light);
    border: 2px solid var(--rosh-border);
    color: var(--rosh-text-dark);
    padding: 2rem;
    border-radius: var(--rosh-radius-lg);
    text-align: center;
    margin: 2rem auto;
    max-width: 500px;
    font-size: 1.1rem;
    font-weight: 500;
}

.rosh-max-rank-progress {
    background: linear-gradient(135deg, var(--rosh-vip) 0%, #8a2be2 100%);
    color: white;
    border-color: var(--rosh-vip);
}

/* مؤشر الرتبة العائم */
#rosh-rank-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--rosh-primary) 0%, var(--rosh-secondary) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--rosh-radius-lg);
    box-shadow: var(--rosh-shadow-lg);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    direction: rtl;
}

#rosh-rank-indicator:hover {
    transform: scale(1.05);
    box-shadow: var(--rosh-shadow-xl);
}

.rank-icon {
    font-size: 1.2rem;
}

/* معلومات الخصم في السلة */
.rosh-discount-info {
    background: linear-gradient(135deg, var(--rosh-success) 0%, #38a169 100%);
    color: white;
    padding: 1rem;
    border-radius: var(--rosh-radius-md);
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
    box-shadow: var(--rosh-shadow-sm);
}

.discount-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.discount-value {
    font-size: 1.2rem;
    font-weight: 700;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .rosh-customer-dashboard,
    .rosh-rank-progress-widget {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .rosh-dashboard-header h3 {
        font-size: 2rem;
    }
    
    .rosh-current-rank,
    .rosh-next-rank,
    .rosh-max-rank,
    .rosh-no-rank {
        padding: 1.5rem;
    }
    
    .rosh-rank-badge {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .rosh-rank-icon {
        font-size: 2.5rem;
    }
    
    .rosh-rank-name {
        font-size: 1.5rem;
    }
    
    .rosh-progress-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .rosh-tips-grid {
        grid-template-columns: 1fr;
    }
    
    .rosh-stat-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    #rosh-rank-indicator {
        top: 10px;
        left: 10px;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .rosh-tips-section {
        padding: 1.5rem;
    }
    
    .rosh-tip-card {
        padding: 1rem;
    }
}

/* تأثيرات الحركة */
.rosh-customer-dashboard {
    animation: rosh-fadeInUp 0.8s ease-out;
}

@keyframes rosh-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rosh-current-rank,
.rosh-next-rank,
.rosh-max-rank,
.rosh-no-rank {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rosh-current-rank:hover,
.rosh-next-rank:hover,
.rosh-max-rank:hover,
.rosh-no-rank:hover {
    transform: scale(1.02);
}

/* تحسينات إمكانية الوصول */
.rosh-progress-bar {
    position: relative;
}

.rosh-progress-bar::after {
    content: attr(aria-label);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--rosh-text-light);
    margin-top: 0.25rem;
}

/* تحسينات الطباعة */
@media print {
    .rosh-customer-dashboard,
    .rosh-rank-progress-widget {
        box-shadow: none;
        border: 1px solid #000;
        background: white !important;
        color: black !important;
    }
    
    .rosh-current-rank,
    .rosh-next-rank,
    .rosh-max-rank,
    .rosh-no-rank {
        background: white !important;
        color: black !important;
        border: 1px solid #000;
    }
    
    #rosh-rank-indicator {
        display: none;
    }
    
    .rosh-tips-section {
        break-inside: avoid;
    }
}

/* تحسينات الوضع المظلم */
@media (prefers-color-scheme: dark) {
    :root {
        --rosh-bg-light: #1a202c;
        --rosh-bg-white: #2d3748;
        --rosh-text-dark: #f7fafc;
        --rosh-text-light: #a0aec0;
        --rosh-border: #4a5568;
    }
    
    .rosh-customer-dashboard {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .rosh-tips-section {
        background: #2d3748;
    }
    
    .rosh-tip-card {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        border-color: #4a5568;
    }
    
    .rosh-tip-card p {
        color: #a0aec0;
    }
}

/* تحسينات الحركة المخفضة */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .rosh-progress {
        transition: none;
    }
}

/* تحسينات إضافية للتفاعل */
.rosh-interactive {
    cursor: pointer;
    user-select: none;
}

.rosh-interactive:active {
    transform: scale(0.98);
}

/* تأثيرات الجسيمات للرتب العالية */
.rosh-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.rosh-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: rosh-float 3s infinite ease-in-out;
}

@keyframes rosh-float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 1; 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
        opacity: 0.5; 
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1200px) {
    .rosh-customer-dashboard {
        max-width: 900px;
    }
    
    .rosh-dashboard-header h3 {
        font-size: 3rem;
    }
    
    .rosh-tips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

