/**
 * ========================================
 * 🎨 قالب الفلترة الذكية - النظام الكامل
 * ========================================
 * نسخة كاملة مستقلة 100%
 * يحتوي على: Bootstrap, Icons, Fonts, RTL
 * 
 * @version 2.0.0
 * @date 18 أكتوبر 2025
 * @author FilterX Team
 * @rtl-support كامل
 */

/* ========================================
   0. External Dependencies (المكتبات الخارجية)
   ======================================== */

/* Bootstrap CSS 5.2.3 */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css');

/* Bootstrap Icons 1.10.5 */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css');

/* Arabic Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

/* ========================================
   1. CSS Variables (المتغيرات)
   ======================================== */
:root {
    /* Arabic Fonts */
    --font-primary: 'Cairo', 'Tajawal', 'Almarai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Tajawal', 'Cairo', sans-serif;
    --font-display: 'Cairo', sans-serif;
    
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #6366f1;
    --secondary-dark: #4f46e5;
    --secondary-light: #818cf8;
    --accent: #a855f7;
    --accent-dark: #9333ea;
    --success: #22c55e;
    --success-dark: #16a34a;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --info: #06b6d4;
    --info-dark: #0891b2;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    
    /* Colors (Legacy Support) */
    --color-primary: #667eea;
    --color-success: #11998e;
    --color-danger: #eb3349;
    --color-warning: #f59e0b;
    --color-info: #4facfe;
    --color-purple: #a855f7;
    
    /* Borders */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.12);
    --shadow-xl: 0 10px 40px rgba(102, 126, 234, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ========================================
   1.5. Base Styles (الأساسيات)
   ======================================== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    min-height: 100vh;
}

/* تباعد الأيقونات - عام */
i, .bi {
    display: inline-block;
}

/* تباعد الأيقونات مع النصوص */
i + span,
i + strong,
i + a,
i + button,
.bi + span,
.bi + strong,
.bi + a,
.bi + button {
    margin-right: 0.5rem;
}

span + i,
strong + i,
a + i,
button + i,
span + .bi,
strong + .bi,
a + .bi,
button + .bi {
    margin-left: 0.5rem;
}

/* Typography - العناوين */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.75rem; font-weight: 700; }
h4 { font-size: 1.5rem; font-weight: 600; }
h5 { font-size: 1.25rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

/* Paragraphs */
p {
    font-family: var(--font-primary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* RTL Support - دعم كامل */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Arabic Number Styling */
.arabic-numbers {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* ========================================
   2. Stats Cards (بطاقات الإحصائيات)
   ======================================== */

/* تنسيق عام للبطاقات في صفحة الحملات - responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    align-items: start; /* محاذاة البطاقات من الأعلى */
}

/* ضمان ارتفاع متساوٍ للبطاقات */
.stat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 140px;
}

/* للشاشات المتوسطة - 2 بطاقات في السطر */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* للشاشات الصغيرة - بطاقة واحدة في السطر */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* تنسيق خاص لبطاقات صفحة التقارير (6 بطاقات) */
.stats-grid-reports {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* للشاشات المتوسطة - 3 بطاقات في السطر */
@media (max-width: 1200px) {
    .stats-grid-reports {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* للشاشات الصغيرة - 2 بطاقات في السطر */
@media (max-width: 992px) {
    .stats-grid-reports {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* للشاشات الصغيرة جداً - بطاقة واحدة في السطر */
@media (max-width: 576px) {
    .stats-grid-reports {
        grid-template-columns: 1fr;
    }
}

/* تنسيق خاص لبطاقات صفحة العروض (5 بطاقات) */
.stats-grid-offers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

/* ضمان ارتفاع متساوٍ للبطاقات */
.stat-card {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 120px;
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    justify-content: space-between;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 0%, rgba(14, 165, 233, 0.03) 100%);
    border-radius: 0 0 0 80px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.12);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon .bi {
    margin: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
    font-family: var(--font-display);
    /* تحسين عرض الأرقام */
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-primary);
    /* تحسين المسافات للنص العربي */
    letter-spacing: 0.01em;
}

.stat-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   3. Hero Section (قسم البطل)
   ======================================== */
.hero-section,
.offers-hero,
.campaigns-hero,
.pairs-hero,
.accounts-hero {
    background: var(--gradient-primary);
    color: white !important;
    border-radius: var(--radius-lg);
    padding: 24px 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
}

/* التأكد من أن جميع العناصر داخل Hero بيضاء */
.hero-section *,
.offers-hero *,
.campaigns-hero *,
.pairs-hero *,
.accounts-hero *,
.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section h5,
.hero-section h6,
.hero-section p {
    color: white !important;
}

.hero-section h1,
.offers-hero h1,
.campaigns-hero h1,
.pairs-hero h1,
.accounts-hero h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 700;
    font-family: var(--font-display);
    /* تحسين وضوح النص العربي */
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    letter-spacing: -0.01em;
}

.hero-section h1 i,
.hero-section h1 .bi,
.offers-hero h1 i,
.offers-hero h1 .bi,
.campaigns-hero h1 i,
.campaigns-hero h1 .bi,
.pairs-hero h1 i,
.pairs-hero h1 .bi,
.accounts-hero h1 i,
.accounts-hero h1 .bi {
    margin-left: 0.5rem;
}

.hero-section p,
.offers-hero p,
.campaigns-hero p,
.pairs-hero p,
.accounts-hero p {
    font-size: 0.95rem;
    margin-bottom: 0;
    opacity: 0.9;
    font-family: var(--font-primary);
    /* تحسين قراءة النص العربي */
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Hero Buttons */
.hero-section .btn,
.offers-hero .btn,
.campaigns-hero .btn,
.pairs-hero .btn,
.accounts-hero .btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: var(--font-primary);
    /* تحسين وضوح النص في الأزرار */
    letter-spacing: 0.02em;
}

/* تباعد الأيقونات في الأزرار */
.btn i,
.btn .bi {
    margin-left: 0.5rem;
    margin-right: 0;
}

.btn i:first-child,
.btn .bi:first-child {
    margin-left: 10;
    margin-right: 0.5rem;
}

.hero-section .btn-lg,
.offers-hero .btn-lg,
.campaigns-hero .btn-lg,
.pairs-hero .btn-lg,
.accounts-hero .btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.hero-section .btn-light,
.offers-hero .btn-light,
.campaigns-hero .btn-light,
.pairs-hero .btn-light,
.accounts-hero .btn-light {
    background: white !important;
    color: #667eea !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: 14px 28px !important;
}

.hero-section .btn-light:hover,
.offers-hero .btn-light:hover,
.campaigns-hero .btn-light:hover,
.pairs-hero .btn-light:hover,
.accounts-hero .btn-light:hover {
    background: #f8f9fa !important;
    color: #667eea !important;
}

.hero-section .btn-success,
.offers-hero .btn-success,
.campaigns-hero .btn-success,
.pairs-hero .btn-success,
.accounts-hero .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: 14px 28px !important;
}

.hero-section .btn-success:hover,
.offers-hero .btn-success:hover,
.campaigns-hero .btn-success:hover,
.pairs-hero .btn-success:hover,
.accounts-hero .btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* أيقونات الأزرار في Hero */
.hero-section .btn-light i,
.offers-hero .btn-light i,
.campaigns-hero .btn-light i,
.pairs-hero .btn-light i,
.accounts-hero .btn-light i {
    color: #667eea !important;
}

/* ========================================
   4. Utility Classes (فئات مساعدة)
   ======================================== */
.gradient-primary {
    background: var(--gradient-primary);
}

.gradient-success {
    background: var(--gradient-success);
}

.gradient-danger {
    background: var(--gradient-danger);
}

.gradient-warning {
    background: var(--gradient-warning);
}

.gradient-info {
    background: var(--gradient-info);
}

.gradient-purple {
    background: var(--gradient-purple);
}

.text-purple {
    color: var(--color-purple) !important;
}

.bg-purple {
    background-color: var(--color-purple) !important;
    color: white !important;
}

/* ========================================
   5. Animations (الحركات)
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Animation delays for stat cards */
.stats-grid .stat-card:nth-child(1) { animation-delay: 0s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.3s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.4s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.5s; }

/* ========================================
   5.5. Arabic Typography Enhancements (تحسينات الطباعة العربية)
   ======================================== */

/* تحسين عرض النصوص العربية */
.arabic-text {
    font-family: var(--font-primary);
    line-height: 1.8;
    letter-spacing: 0.01em;
}

/* تحسين عرض الأرقام العربية */
.arabic-numbers,
.stat-value,
.badge {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* تحسين العناوين العربية */
.arabic-heading {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
}

/* تحسين الفقرات العربية */
.arabic-paragraph {
    font-family: var(--font-primary);
    line-height: 1.9;
    text-align: justify;
    text-justify: inter-word;
}

/* تحسين الأزرار العربية */
.btn,
button {
    font-family: var(--font-primary);
    letter-spacing: 0.02em;
}

/* تحسين الـ Badges العربية */
.badge {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* تحسين الجداول العربية */
table {
    font-family: var(--font-primary);
}

table th {
    font-weight: 600;
    letter-spacing: 0.01em;
}

table td {
    line-height: 1.6;
}

/* تحسين النماذج العربية */
.form-label {
    font-family: var(--font-primary);
    font-weight: 600;
}

.form-control,
.form-select,
input,
textarea,
select {
    font-family: var(--font-primary);
    line-height: 1.6;
}

/* تحسين Placeholder العربي */
::placeholder {
    font-family: var(--font-primary);
    opacity: 0.6;
}

/* ========================================
   Select2 (القائمة الذكية) - RTL Support
   ======================================== */

/* Container */
.select2-container {
    font-family: var(--font-primary);
    direction: rtl;
}

/* Selection Box */
.select2-container--default .select2-selection--single {
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #667eea;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Rendered Text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 26px;
    padding-right: 12px;
    padding-left: 30px;
    text-align: right;
    color: #495057;
    font-weight: 500;
}

/* Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
    left: 12px;
    right: auto;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #667eea transparent transparent transparent;
    border-width: 6px 5px 0 5px;
}

/* Dropdown */
.select2-container--default .select2-dropdown {
    border: 2px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 4px;
}

/* Search Box */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: var(--font-primary);
    direction: rtl;
    text-align: right;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #667eea;
    outline: none;
}

/* Results */
.select2-container--default .select2-results__option {
    padding: 10px 15px;
    font-family: var(--font-primary);
    text-align: right;
    direction: rtl;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--gradient-primary);
    color: white;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: #f8f9fa;
    color: #667eea;
    font-weight: 600;
}

/* Multiple Select */
.select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--gradient-primary);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 6px 12px;
    margin: 4px;
    font-weight: 500;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-left: 8px;
    margin-right: 0;
    font-size: 16px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ff6b6b;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #adb5bd;
    font-family: var(--font-primary);
}

/* Clear Button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-left: 8px;
    margin-right: 0;
    color: #dc3545;
    font-size: 18px;
}

/* Loading */
.select2-container--default .select2-results__option--loading {
    color: #667eea;
}

/* No Results */
.select2-container--default .select2-results__option--no-results {
    color: #6c757d;
    text-align: center;
    padding: 15px;
}

/* OptGroup Styling */
.select2-container--default .select2-results__group {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: right;
    direction: rtl;
    margin-top: 4px;
    border-radius: 6px 6px 0 0;
    letter-spacing: 0.5px;
}

.select2-container--default .select2-results__group:first-child {
    margin-top: 0;
}

.select2-container--default .select2-results__option[role="group"] {
    padding: 0;
}

.select2-container--default .select2-results__option[role="group"] .select2-results__options {
    background: #f8f9fa;
    border-radius: 0 0 6px 6px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.select2-container--default .select2-results__option[role="group"] .select2-results__option {
    padding-right: 25px;
    padding-left: 15px;
}

.select2-container--default .select2-results__option[role="group"] .select2-results__option:before {
    content: "◆";
    margin-left: 8px;
    color: #667eea;
    font-size: 0.7rem;
}

/* ========================================
   Stats Page - Hierarchical Table
   ======================================== */

/* تنسيقات جدول الإحصائيات */
#statsTable.table {
    margin-bottom: 0;
}

/* محاذاة عمود الاسم إلى اليمين */
#statsTable th:nth-child(1),
#statsTable td:nth-child(1) {
    text-align: right !important;
}

/* تنسيقات المستويات الهرمية */
.level-1-row {
    background-color: #f8f9fa !important;
    font-weight: 600;
}

.level-2-row {
    background-color: #fff !important;
}

.level-3-row {
    background-color: #fafbfc !important;
}

.level-1-name {
    font-size: 1.05rem;
    color: #2c3e50;
}

.level-2-name {
    font-size: 0.95rem;
    color: #34495e;
}

.level-3-name {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* ========================================
   Compact Filters (في header الجدول)
   ======================================== */

/* تصغير عنوان الجدول */
.table-card .card-header {
    padding: 0.75rem 1rem;
}

.table-card .card-header h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    color: #495057;
}

.table-card .card-header h5 i {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* تحسين المسافات بين الفلاتر */
.table-card .card-header .d-flex {
    gap: 0.5rem;
}

.table-card .card-header .gap-2 {
    gap: 0.5rem !important;
}

/* منع الانكسار - سطر واحد */
.table-card .card-header > div {
    overflow-x: auto;
    overflow-y: hidden;
}

.table-card .card-header select,
.table-card .card-header .search-input-group {
    min-width: fit-content;
}

.form-select-sm {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.search-input-group {
    position: relative;
}

.search-input-group .search-field {
    padding-right: 35px;
    font-size: 0.875rem;
    height: 31px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-input-group .search-field:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input-group .search-icon-wrapper {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* تحسين Tooltips العربية */
.tooltip {
    font-family: var(--font-primary);
}

/* تحسين Alerts العربية */
.alert {
    font-family: var(--font-primary);
    line-height: 1.6;
}

/* ========================================
   Stats Hero - Dynamic Hero Section
   ======================================== */

.stats-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stats-hero .hero-content {
    flex: 1;
}

.stats-hero .hero-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stats-hero .hero-icon-center {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stats-hero .hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.stats-hero .hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.stats-hero .hero-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.stats-hero .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.stats-hero .hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.stats-hero .btn-outline-primary,
.stats-hero .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stats-hero .btn-outline-primary:hover,
.stats-hero .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 992px) {
    .stats-hero .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stats-hero .hero-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Campaigns Table - محاذاة البيانات
   ======================================== */

/* محاذاة جميع الأعمدة للمنتصف */
#campaignsTable thead th {
    text-align: center !important;
    vertical-align: middle;
}

#campaignsTable tbody td {
    text-align: center !important;
    vertical-align: middle;
}

/* محاذاة عمود اسم الحملة لليمين */
#campaignsTable thead th:first-child,
#campaignsTable tbody td:first-child {
    text-align: right !important;
}

/* ========================================
   Campaign Name Cell - تنسيقات خلية اسم الحملة
   ======================================== */

.campaign-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.campaign-name-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.campaign-name-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c3e50;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-name-link:hover .campaign-name-text {
    color: var(--primary-color);
}

/* إخفاء أيقونة التقارير وإظهارها عند hover */
.chart-icon {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.campaign-name-cell:hover .chart-icon {
    opacity: 1;
}

.offer-info-icon {
    flex-shrink: 0;
    cursor: help;
    font-size: 1.1rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.campaign-name-cell:hover .offer-info-icon {
    opacity: 1;
}

.offer-info-icon:hover {
    color: var(--primary-color) !important;
    transform: scale(1.2);
}

/* ========================================
   Offer Name Cell - تنسيقات خلية اسم العرض
   ======================================== */

.offer-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.offer-name-cell strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* إخفاء أيقونة الحملات المرتبطة وإظهارها عند hover */
.campaigns-info-icon {
    flex-shrink: 0;
    cursor: help;
    font-size: 1.1rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.offer-name-cell:hover .campaigns-info-icon {
    opacity: 1;
}

.campaigns-info-icon:hover {
    color: var(--primary-color) !important;
    transform: scale(1.2);
}

/* Badge عدد الحملات */
.offer-name-cell .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    vertical-align: middle;
}

/* تحسين عرض Tooltip للحملات المرتبطة */
.tooltip-inner {
    max-width: 400px;
    text-align: right;
    white-space: pre-line;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ========================================
   Custom Scrollbars - سكرول احترافي
   ======================================== */

/* Scrollbar Base - أساس السكرول */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Webkit Scrollbar - للتصفحات الحديثة */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    border-radius: 10px;
    border: 1px solid #f7fafc;
    transition: all 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

*::-webkit-scrollbar-corner {
    background: #f7fafc;
}

/* ========================================
   Dropdown Scrollbars - سكرول القوائم المنسدلة
   ======================================== */

/* Account Selector Dropdown Scrollbar */
.pair-dropdown {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar للقوائم المنسدلة */
.pair-dropdown::-webkit-scrollbar {
    width: 6px;
}

.pair-dropdown::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
}

.pair-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.pair-dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transform: scaleX(1.2);
}

/* Firefox Scrollbar */
.pair-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 rgba(0,0,0,0.05);
}

/* ========================================
   Enhanced Dropdown Styling - تحسين شكل القائمة
   ======================================== */

.pair-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    background: #ffffff;
    backdrop-filter: blur(8px);
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dropdown Items Hover Effect */
.pair-dropdown-item {
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 4px;
}

.pair-dropdown-item:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Active Item Styling */
.pair-dropdown-item.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    color: #1e40af;
    font-weight: 600;
}

/* ========================================
   Responsive Scrollbars - سكرول متجاوب
   ======================================== */

@media (max-width: 768px) {
    .pair-dropdown {
        max-height: 250px;
    }
    
    *::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    .pair-dropdown::-webkit-scrollbar {
        width: 4px;
    }
}

/* ========================================
   Smooth Scrolling - تمرير ناعم
   ======================================== */

.pair-dropdown {
    scroll-behavior: smooth;
}

/* Hide Scrollbar on Mobile when not scrolling */
@media (max-width: 768px) {
    .pair-dropdown::-webkit-scrollbar {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .pair-dropdown:hover::-webkit-scrollbar {
        opacity: 1;
    }
}

/* ========================================
   Performance Optimizations - تحسينات الأداء
   ======================================== */

.pair-dropdown-item {
    will-change: transform, background;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.pair-dropdown {
    will-change: scroll-position;
}

/* Toast Container */
.toast-container-rtl {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1090;
    max-width: 400px;
    direction: rtl;
}

/* Toast Base */
.toast-rtl {
    min-width: 350px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    margin-bottom: 12px;
    animation: slideInRight 0.4s ease-out;
}

/* Toast Icon */
.toast-icon {
    font-size: 1.5rem;
    margin-left: 12px;
    margin-right: 16px;
    display: flex;
    align-items: center;
}

/* Toast Body */
.toast-rtl .toast-body {
    padding: 14px 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: right;
}

/* Toast Close Button */
.toast-rtl .btn-close {
    padding: 0.5rem;
    opacity: 0.8;
}

.toast-rtl .btn-close:hover {
    opacity: 1;
}

/* Toast Variants */
.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
}

.toast-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.toast-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.toast-dark {
    background: linear-gradient(135deg, #343a40 0%, #23272b 100%);
}

/* Animation */
@keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container-rtl {
        top: 70px;
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    
    .toast-rtl {
        min-width: 100%;
    }
}

/* ========================================
   Bots Card - تنسيقات خاصة
   ======================================== */

/* نسبة Bots في البطاقة */
#botsPercentage {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* تحذير Bots عالي */
.stat-card .text-danger {
    animation: pulse-danger 2s ease-in-out infinite;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* تحسين Modals العربية */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 30px;
    border-bottom: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.modal-header .btn-close {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    filter: brightness(0) invert(1);
    padding: 0;
    width: 36px;
    height: 36px;
    background-size: 22px;
    flex-shrink: 0;
}

.modal-header .btn-close:hover {
    opacity: 0.8;
    transform: translateY(-50%) scale(1.1);
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: white !important;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.modal-title i,
.modal-title .bi {
    font-size: 1.5rem;
    margin: 0;
}

.modal-body {
    font-family: var(--font-primary);
    line-height: 1.7;
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 15px 25px;
    justify-content: flex-start;
    gap: 10px;
}

/* تحسين Cards العربية */
.card-title {
    font-family: var(--font-display);
    font-weight: 700;
}

.card-text {
    font-family: var(--font-primary);
    line-height: 1.7;
}

/* تحسين Dropdowns العربية */
.dropdown-item {
    font-family: var(--font-primary);
    letter-spacing: 0.01em;
    color: #212529 !important; /* لون نص أسود واضح */
    text-decoration: none;
}

/* تحسين Navbar العربية */
.navbar {
    font-family: var(--font-primary);
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
}

.nav-link {
    font-family: var(--font-primary);
    font-weight: 500;
}

/* ========================================
   6. Table Card & Modern Table (الجداول)
   ======================================== */
.table-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9ecef;
    overflow: hidden;
    margin-bottom: 25px;
}

.table-card .card-header {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid #e9ecef;
    padding: 20px 25px;
    border-radius: 0;
}

.table-card .card-header h5 {
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    font-family: var(--font-display);
}

.table-card .card-header h5 i,
.table-card .card-header h5 .bi {
    margin-left: 0.5rem;
}

.table-card .card-body {
    padding: 0;
}


/* Force LTR direction on button groups to maintain layout consistency */
.btn-group {
    direction: ltr;
}

/* Modern Table Styles */
.table-modern {
    margin-bottom: 0;
    font-family: var(--font-primary);
}

.table-modern thead th {
    font-weight: 700;
    font-size: 14px;
    padding: 14px 12px;
    background: #f8f9fa;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    text-align: center !important;
    vertical-align: middle;
    font-family: var(--font-display);
}

.table-modern thead th i,
.table-modern thead th .bi {
    margin-left: 8px;
    font-size: 14px;
    vertical-align: middle;
    color: #667eea !important;
}

/* RTL Support - أيقونات الفرز */
.table-modern thead th {
    position: relative;
    padding-right: 30px !important;
    padding-left: 12px !important;
}

.table-modern thead th.sorting::before,
.table-modern thead th.sorting::after,
.table-modern thead th.sorting_asc::before,
.table-modern thead th.sorting_asc::after,
.table-modern thead th.sorting_desc::before,
.table-modern thead th.sorting_desc::after {
    right: 8px !important;
    left: auto !important;
}

/* تحسين أيقونات الفرز */
.table-modern thead th.sorting::before,
.table-modern thead th.sorting_asc::before,
.table-modern thead th.sorting_desc::before {
    opacity: 0.3;
}

.table-modern thead th.sorting::after,
.table-modern thead th.sorting_asc::after,
.table-modern thead th.sorting_desc::after {
    opacity: 0.3;
}

.table-modern thead th.sorting_asc::before {
    opacity: 1 !important;
}

.table-modern thead th.sorting_desc::after {
    opacity: 1 !important;
}

/* Table Body */
.table-modern tbody tr {
    transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    background-color: #f8f9fa;
}

.table-modern tbody td {
padding: 12px;
vertical-align: middle;
font-size: 14px;
transition: background-color 0.2s ease;
font-family: var(--font-primary);
text-align: center;
}

/* تكبير حجم الخط للأعمدة الرقمية */
.table-modern tbody td:nth-child(4),  /* المصروف */
.table-modern tbody td:nth-child(5),  /* مشاهدات (P) */
.table-modern tbody td:nth-child(6),  /* العائد */
.table-modern tbody td:nth-child(7),  /* مشاهدات (A) */
.table-modern tbody td:nth-child(8),  /* الربح */
.table-modern tbody td:nth-child(9) { /* ROI */
    font-size: 15px;
    font-weight: 600;
}

/* Table Footer */
.table-modern tfoot {
background: #f8f9fa;
font-weight: 600;
    font-weight: 600;
}

.table-modern tfoot th {
    padding: 14px 12px;
    border-top: 2px solid #dee2e6;
}

/* Table Badges */
.table-modern .badge {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    font-family: var(--font-primary);
}

.table-modern .badge i,
.table-modern .badge .bi {
    margin-left: 0.4rem;
    font-size: 12px;
}

/* تباعد عام للـ Badges */
.badge i,
.badge .bi {
    margin-left: 0.5rem;
    margin-right: 0;
}

.badge i:first-child,
.badge .bi:first-child {
    margin-left: 0;
    margin-right: 0.5rem;
}

.badge i:last-child,
.badge .bi:last-child {
    margin-left: 0.5rem;
    margin-right: 0;
}

.badge i:only-child,
.badge .bi:only-child {
    margin: 0;
}

/* Table Buttons - أزرار الإجراءات */
.table-modern .btn-sm {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-width: 2px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* أزرار الإجراءات - أيقونة فقط */
.table-modern .btn-sm i,
.table-modern .btn-sm .bi {
    font-size: 16px;
    margin: 0;
}

/* أزرار الإجراءات - Hover */
.table-modern .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* أزرار الإجراءات - ألوان محددة */
.table-modern .btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.table-modern .btn-outline-info:hover {
    background: #06b6d4;
    border-color: #06b6d4;
    color: white;
}

.table-modern .btn-outline-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.table-modern .btn-outline-success:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Table Row States */
.table-modern tbody tr.offer-active {
    background: linear-gradient(to left, rgba(212, 237, 218, 0.25) 0%, #ffffff 100%);
    border-right: 4px solid #28a745;
}

.table-modern tbody tr.offer-active:hover {
    background: linear-gradient(to left, rgba(212, 237, 218, 0.45) 0%, rgba(212, 237, 218, 0.1) 100%);
}

.table-modern tbody tr.offer-archived {
    background: linear-gradient(to left, #f8f9fa 0%, #ffffff 100%);
    opacity: 0.7;
    border-right: 4px solid #6c757d;
}

.table-modern tbody tr.offer-archived:hover {
    background: linear-gradient(to left, #e9ecef 0%, #f8f9fa 100%);
    opacity: 0.8;
}

.table-modern tbody tr.offer-pending {
    background: linear-gradient(to left, rgba(255, 243, 205, 0.3) 0%, #ffffff 100%);
    border-right: 4px solid #ffc107;
}

.table-modern tbody tr.offer-pending:hover {
    background: linear-gradient(to left, rgba(255, 243, 205, 0.5) 0%, rgba(255, 243, 205, 0.1) 100%);
}

.table-modern tbody tr.campaign-active {
    background: linear-gradient(to left, rgba(212, 237, 218, 0.25) 0%, #ffffff 100%);
    border-right: 4px solid #28a745;
}

.table-modern tbody tr.campaign-active:hover {
    background: linear-gradient(to left, rgba(212, 237, 218, 0.45) 0%, rgba(212, 237, 218, 0.1) 100%);
}

.table-modern tbody tr.campaign-archived {
    background: linear-gradient(to left, #f8f9fa 0%, #ffffff 100%);
    opacity: 0.7;
    border-right: 4px solid #6c757d;
}

.table-modern tbody tr.campaign-archived:hover {
    background: linear-gradient(to left, #e9ecef 0%, #f8f9fa 100%);
    opacity: 0.8;
}

.table-modern tbody tr.campaign-paused {
    background: linear-gradient(to left, rgba(255, 243, 205, 0.25) 0%, #ffffff 100%);
    border-right: 4px solid #ffc107;
}

.table-modern tbody tr.campaign-paused:hover {
    background: linear-gradient(to left, rgba(255, 243, 205, 0.45) 0%, rgba(255, 243, 205, 0.1) 100%);
}

/* ========================================
   7. Search Input Component (حقل البحث)
   ======================================== */

/* Search Input Group */
.search-input-group {
    position: relative;
    display: inline-block;
}

.search-icon-wrapper {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    pointer-events: none;
    z-index: 1;
    font-size: 18px;
}

.search-field {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    font-family: var(--font-primary);
    direction: rtl;
    text-align: right;
}

.search-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-field::placeholder {
    color: #adb5bd;
    font-family: var(--font-primary);
}

/* ========================================
   8. DataTables Pagination (ترقيم الصفحات)
   ======================================== */

/* إزالة جميع التنسيقات الافتراضية */
.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .page-item {
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    color: inherit !important;
}

/* إظهار عنصر length في الأسفل فقط */
.dataTables_wrapper .top .dataTables_length {
    display: none !important;
}

.dataTables_wrapper .bottom .dataTables_length {
    display: block !important;
}

/* تصميم منطقة التحكم السفلية */
.dataTables_wrapper .dataTables_info {
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    font-family: var(--font-primary);
}

.dataTables_wrapper .dataTables_paginate {
    padding: 12px 0;
}

/* تصميم أزرار الصفحات */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    padding: 10px 14px !important;
    margin: 0 5px !important;
    border-radius: 8px !important;
    border: 2px solid #e0e0e0 !important;
    background: white !important;
    background-image: none !important;
    color: #495057 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    min-width: 44px !important;
    height: 44px !important;
    text-align: center !important;
    box-shadow: none !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: var(--font-primary);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled),
.dataTables_wrapper .dataTables_paginate .paginate_button:active:not(.disabled),
.dataTables_wrapper .dataTables_paginate .paginate_button:focus:not(.disabled) {
    background: var(--gradient-primary) !important;
    background-image: var(--gradient-primary) !important;
    color: white !important;
    border-color: #667eea !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--gradient-primary) !important;
    background-image: var(--gradient-primary) !important;
    color: white !important;
    border-color: #667eea !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    transform: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background: #f8f9fa !important;
    background-image: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* أزرار السابق والتالي - أيقونات */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-size: 0 !important;
    position: relative;
    width: 40px;
    padding: 8px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous::before {
    content: "\F285";
    font-family: 'bootstrap-icons' !important;
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.next::before {
    content: "\F284";
    font-family: 'bootstrap-icons' !important;
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* تخطيط منطقة التحكم السفلية */
.dataTables_wrapper .row:last-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 2px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    margin: 0 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
    width: 100% !important;
}

.dataTables_wrapper .row:last-child > div {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 15px 15px;
}

/* ترتيب العناصر: التحكم على اليمين، الصفحات على اليسار */
.dataTables_wrapper .table-controls-left {
    order: 1;
    margin-right: auto;
    padding-right: 20px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
}

.dataTables_wrapper .dataTables_paginate {
    order: 2;
    margin-left: 0;
    padding-left: 0;
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    float: none !important;
    text-align: left !important;
    flex-shrink: 0 !important;
}

/* منع التفاف الأرقام */
.dataTables_wrapper .dataTables_paginate.paging_simple_numbers {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    flex-shrink: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .pagination .page-item {
    display: inline-flex !important;
    float: none !important;
    margin: 10 !important;
}

/* إزالة أي float أو clear */
.dataTables_wrapper .dataTables_paginate span {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
}

.dataTables_wrapper .dataTables_paginate span .paginate_button {
    float: none !important;
    display: inline-flex !important;
    vertical-align: middle !important;
}

/* تحسين عرض معلومات الجدول */
.dataTables_wrapper .dataTables_info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    line-height: 1;
    margin: 0;
    height: 44px;
    font-family: var(--font-primary);
}

.dataTables_wrapper .dataTables_info::before {
    content: "\F4A1";
    font-family: 'bootstrap-icons';
    color: #667eea;
    font-size: 16px;
    line-height: 1;
}

/* قائمة عدد المدخلات */
.custom-length-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 44px;
    line-height: 1;
}

.custom-length-control:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.custom-length-control i {
    color: #667eea;
    font-size: 16px;
    line-height: 1;
}

.custom-length-control select {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    padding: 0;
    min-width: 50px;
    line-height: 1;
}

/* تطبيق custom-length-control على dataTables_length */
.dataTables_wrapper .dataTables_length.custom-length-control {
    display: inline-flex !important;
}

.dataTables_wrapper .dataTables_length.custom-length-control label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1;
    width: 100%;
}

.dataTables_wrapper .dataTables_length.custom-length-control select {
    order: 1;
    flex: 1;
}

.dataTables_wrapper .dataTables_length.custom-length-control i {
    order: 2;
    flex-shrink: 0;
    display: inline-block !important;
}

/* إصلاح RTL */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length {
    float: none !important;
}

.dataTables_wrapper .row:last-child > div {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
}

/* تحسينات إضافية */
.dataTables_wrapper .dataTables_processing {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 25px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    font-family: var(--font-primary);
}

.dataTables_wrapper .dataTables_empty {
    padding: 30px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-primary);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stat Footer */
.stat-footer {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.stat-footer .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* ========================================
   3. Hero Section (قسم البطل)
   ======================================== */

/* Input Groups RTL Fix */
.input-group {
    display: flex !important;
    flex-direction: row-reverse !important;
    direction:ltr;
}

.input-group > :first-child {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > :last-child {
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :not(:first-child):not(.dropdown-menu) {
    margin-right: -1px !important;
    margin-left: 0 !important;
}

.input-group .form-control[type="number"] {
    text-align: left !important;
    direction: ltr !important;
}

/* Dropdown RTL Fix */
.dropdown-menu {
    text-align: right !important;
    direction: rtl !important;
}

.dropdown-item {
    text-align: right !important;
    direction: rtl !important;
}

.dropdown-item .bi,
.dropdown-item i {
    margin-left: 0.5rem;
    margin-right: 0;
    width: 1.2rem;
    text-align: center;
    display: inline-block;
}

.dropdown-menu[data-bs-popper] {
    right: 0 !important;
    left: auto !important;
}

/* Navbar RTL Fix */
.navbar {
    direction: rtl !important;
}

.navbar-brand {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

.navbar-brand .bi,
.navbar-brand i {
    margin-left: 0.5rem;
    margin-right: 0;
}

.navbar-nav {
    direction: rtl !important;
}

.nav-link .bi,
.nav-link i {
    margin-left: 0.4rem;
    margin-right: 0;
}

.navbar-toggler {
    margin-right: auto !important;
    margin-left: 0 !important;
}

.navbar-collapse {
    direction: rtl !important;
}

.navbar-nav .nav-item {
    text-align: right;
}

.navbar .btn .bi,
.navbar .btn i {
    margin-left: 0.3rem;
    margin-right: 0;
}

/* Footer RTL Fix */
footer {
    direction: rtl !important;
}

footer .container {
    direction: rtl !important;
}

footer .nav {
    direction: rtl !important;
    flex-direction: row-reverse !important;
}

footer .nav-item {
    text-align: right;
}

footer .nav-link {
    text-align: right;
}

/* DataTables Buttons RTL */
body[dir="rtl"] .dt-buttons {
    display: flex;
    gap: .5rem;
}

body[dir="rtl"] .dt-buttons .btn .bi {
    margin-left: .35rem;
    margin-right: 0;
}

.dt-buttons {
    margin-bottom: .5rem;
}

/* Unified Badge Styles */
.badge-status-active {
    background-color: #198754;
}

.badge-status-archived {
    background-color: #6c757d;
}

.badge-status-pending {
    background-color: #ffc107;
    color: #000;
}

.badge-status-banned {
    background-color: #dc3545;
}

.badge-soft {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
}

/* Unified KPI Cards */
.card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card .icon {
    font-size: 4rem;
    opacity: 0.1;
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Unified Cell Styles */
.fx-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.fx-name {
    font-weight: 600;
}

.fx-actions .btn {
    padding: .25rem .5rem;
}

.fx-actions .btn i {
    font-size: 1rem;
}

/* Tooltip for Long URLs */
.tooltip-url .tooltip-inner {
    max-width: 360px;
    white-space: normal;
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

/* ========================================
   Form Cards & Rule Cards (بطاقات النماذج والقواعد)
   ======================================== */

/* Rule Card - بطاقة القاعدة */
.rule-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.rule-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rule-card.disabled {
    opacity: 0.6;
    background: #f8f9fa;
}

/* Rule Header */
.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.rule-header h4 {
    margin: 0;
    color: #2c3e50;
    font-weight: 700;
    font-family: var(--font-display);
}

.rule-header h4 i,
.rule-header h4 .bi {
    margin-left: 0.5rem;
}

.rule-header .form-check {
    margin: 0;
}

.rule-header .form-check-label {
    font-weight: 600;
    font-size: 14px;
}

/* Rule Description */
.rule-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* Rule Example */
.rule-example {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #495057;
    border-left: 3px solid #ffc107;
}

/* Rule Badges */
.rule-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Badge Styles */
.badge-recommended {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.badge-easy {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

/* General Badge Styles */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    border: 1px solid transparent;
}

.badge i,
.badge .bi {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Rule Title */
.rule-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-title:hover {
    color: #007bff;
}

/* Selected Rule */
.rule-card.selected {
    border-color: #28a745;
    background: #d4edda;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.form-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: block;
    font-family: var(--font-primary);
}

.form-label .text-muted {
    font-weight: 400;
    font-size: 13px;
    display: inline;
    margin-right: 0.5rem;
}

.form-label i,
.form-label .bi {
    margin-left: 0.5rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 8px;
}

.input-group-text {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    min-width: 45px;
    justify-content: center;
}

.input-group-text i,
.input-group-text .bi {
    margin: 0;
}

/* Form Controls */
.form-control,
.form-select {
    padding: 10px 14px;
    font-size: 14px;
    font-variant-numeric: lining-nums;
    direction: ltr;
    text-align: right;
}

.form-control[type="number"],
.form-control[type="text"],
.form-control[type="url"],
.form-control[type="email"] {
    direction: ltr;
    text-align: left;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* Form Switch */
.form-check-input {
    width: 3em;
    height: 1.5em;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* Form Text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 8px;
    display: block;
    line-height: 1.5;
}

/* Small Text under inputs */
small.text-muted {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* ========================================
   Notification Cards (بطاقات الإشعارات)
   ======================================== */

.notification-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    transition: all 0.3s ease;
}

.notification-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.notification-card.success {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
}

.notification-card.error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.notification-card.stopped {
    border-left: 4px solid #ef4444;
}

.notification-card.started {
    border-left: 4px solid #10b981;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.notification-icon.stopped {
    background: #fee2e2;
    color: #dc2626;
}

.notification-icon.started {
    background: #d1fae5;
    color: #059669;
}

/* ========================================
   Nav Pills (التبويبات)
   ======================================== */

.nav-pills .nav-link {
    color: #667eea;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.nav-pills .nav-link:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.nav-pills .nav-link.active {
    background: var(--gradient-primary);
    border-color: #667eea;
    color: white;
}

.nav-pills .nav-link i,
.nav-pills .nav-link .bi {
    margin-left: 0.5rem;
}

.nav-pills .nav-item {
    margin-left: 10px;
}

/* ========================================
   Progress Bar (شريط التقدم)
   ======================================== */
.progress {
    height: 10px;
    border-radius: 8px;
    background: #e9ecef;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-bar {
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    font-size: 0.7rem;
    line-height: 10px;
    color: white;
    text-align: center;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Progress Variants */
.progress-bar.bg-success {
    background: var(--gradient-success);
}

.progress-bar.bg-danger {
    background: var(--gradient-danger);
}

.progress-bar.bg-warning {
    background: var(--gradient-warning);
}

.progress-bar.bg-info {
    background: var(--gradient-info);
}

/* ========================================
   10. Responsive Design (التصميم المتجاوب)
   ======================================== */
/* Responsive للبطاقات - صفحة الحملات (8 بطاقات) */
@media (max-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive للبطاقات - صفحة التقارير (6 بطاقات) */
@media (max-width: 1400px) {
    .stats-grid-reports {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid-reports {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-reports {
        grid-template-columns: 1fr;
    }
}

/* Responsive للبطاقات - صفحة العروض (5 بطاقات) */
@media (max-width: 1400px) {
    .stats-grid-offers {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid-offers {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-offers {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .hero-section,
    .offers-hero,
    .campaigns-hero,
    .pairs-hero,
    .accounts-hero {
        padding: 20px;
    }
    
    /* DataTables Pagination Responsive */
    .dataTables_wrapper .row:last-child {
        padding: 12px 15px;
    }
    
    .dataTables_wrapper .row:last-child > div {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-controls-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: center;
        white-space: normal !important;
    }
    
    .dataTables_wrapper .dataTables_info {
        width: 100%;
        justify-content: center;
    }
    
    .custom-length-control {
        width: auto;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 6px 10px !important;
        margin: 0 2px !important;
        font-size: 12px;
        min-width: 35px;
    }
}

/* ========================================
   15. Tracking System Styles (تنسيقات نظام التتبع)
   ======================================== */

/* Tracking Hero - مبسط ومباشر */
.tracking-hero {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: 24px 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
}

.tracking-hero h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.tracking-hero p {
    font-size: 0.95rem;
    margin-bottom: 0;
    opacity: 0.9;
}

/* ROI Colors */
.roi-positive {
    color: #10b981;
    font-weight: bold;
}

.roi-negative {
    color: #ef4444;
    font-weight: bold;
}

.roi-excellent {
    color: #10b981;
    font-weight: 700;
}

.roi-good {
    color: #f59e0b;
    font-weight: 600;
}

.roi-poor {
    color: #ef4444;
    font-weight: 600;
}

/* Profit Colors */
.profit-positive {
    color: #10b981;
    font-weight: 700;
    font-size: 15px;
}

.profit-negative {
    color: #ef4444;
    font-weight: 700;
    font-size: 15px;
}

.profit-zero {
    color: #6b7280;
    font-weight: 600;
}

/* Network Data Colors */
.propeller-data {
    color: #e74c3c;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.adsterra-data {
    color: #27ae60;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.propeller-data i,
.adsterra-data i {
    font-size: 13px;
    opacity: 0.85;
}

/* Table Headers - Network Colors */
.header-propeller {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    font-weight: 900;
    font-size: 17px;
    padding: 16px 14px;
    border: none;
    text-align: center !important;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.header-adsterra {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    font-weight: 900;
    font-size: 17px;
    padding: 16px 14px;
    border: none;
    text-align: center !important;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.header-performance {
    background: var(--gradient-primary) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    font-weight: 900;
    font-size: 17px;
    padding: 16px 14px;
    border: none;
    text-align: center !important;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.header-propeller i,
.header-adsterra i,
.header-performance i {
    margin-left: 10px;
    font-size: 20px;
    vertical-align: middle;
    font-weight: bold;
}

/* Pair Selector - Custom Dropdown */
.pair-selector-wrapper {
    position: relative;
    min-width: 320px;
}

.pair-selector-button {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    width: 100%;
    text-align: right;
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pair-selector-button:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.pair-selector-button .pair-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pair-selector-button .pair-name {
    flex: 1;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #667eea !important; /* لون النص في الزر الأساسي */
    font-weight: 600;
}

.pair-selector-button .dropdown-arrow {
    color: #667eea;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.pair-selector-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.pair-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease;
}

.pair-dropdown.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pair-dropdown-item {
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.pair-dropdown-item:last-child {
    border-bottom: none;
}

.pair-dropdown-item:hover {
    background: #f8f9fa;
}

.pair-dropdown-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.pair-dropdown-item .pair-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pair-dropdown-item .pair-info {
    flex: 1;
    text-align: right;
}

.pair-dropdown-item .pair-info .name {
    font-weight: 600;
    color: #667eea !important; /* لون الخط الأساسي */
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.pair-dropdown-item .pair-info .accounts {
    font-size: 0.75rem;
    color: #000000 !important; /* أسود بدلاً من رمادي */
}

.pair-dropdown-item.active .pair-info .name {
    color: #667eea !important; /* لون عند الاختيار */
    font-weight: 700;
}

/* تنسيق العنصر المختار في القائمة */
.pair-dropdown-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-right: 3px solid #667eea;
}

.pair-dropdown-item .pair-info .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-top: 2px;
}

/* Date Range Button */
.btn-daterange {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
}

.btn-daterange:hover {
    background: white;
    color: #667eea;
    border-color: white;
}

/* Icon Only Buttons - نفس ارتفاع btn-daterange */
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-icon i {
    margin: 0 !important;
}

.btn-icon.btn-light {
    background: white;
    color: #667eea;
    border-color: #e0e0e0;
}

.btn-icon.btn-light:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-icon.btn-success {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.btn-icon.btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.btn-icon.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-icon.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Campaign Status Row Colors - نظام شامل */

/* Status 1: مسودة - أزرق فاتح */
.campaign-draft {
    background: linear-gradient(to left, rgba(207, 226, 255, 0.2) 0%, #ffffff 100%);
    border-right: 4px solid #0dcaf0;
}

.campaign-draft:hover {
    background: linear-gradient(to left, rgba(207, 226, 255, 0.3) 0%, rgba(207, 226, 255, 0.1) 100%);
}

/* Status 2: قيد المراجعة - أصفر */
.campaign-review {
    background: linear-gradient(to left, rgba(255, 243, 205, 0.3) 0%, #ffffff 100%);
    border-right: 4px solid #ffc107;
}

.campaign-review:hover {
    background: linear-gradient(to left, rgba(255, 243, 205, 0.5) 0%, rgba(255, 243, 205, 0.1) 100%);
}

/* Status 3: مرفوضة - أحمر داكن */
.campaign-rejected {
    background: linear-gradient(to left, rgba(248, 215, 218, 0.4) 0%, #ffffff 100%);
    opacity: 0.8;
    border-right: 4px solid #dc3545;
}

.campaign-rejected:hover {
    background: linear-gradient(to left, rgba(248, 215, 218, 0.6) 0%, rgba(248, 215, 218, 0.2) 100%);
    opacity: 0.9;
}

.campaign-rejected .campaign-name-ellipsis {
    color: #dc3545;
    text-decoration: line-through;
}

/* Status 4: جاهزة - أزرق */
.campaign-ready {
    background: linear-gradient(to left, rgba(13, 110, 253, 0.1) 0%, #ffffff 100%);
    border-right: 4px solid #0d6efd;
}

.campaign-ready:hover {
    background: linear-gradient(to left, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.05) 100%);
}

/* Status 7: متوقفة مؤقتاً - برتقالي */
.campaign-paused {
    background: linear-gradient(to left, rgba(255, 193, 7, 0.15) 0%, #ffffff 100%);
    opacity: 0.85;
    border-right: 4px solid #fd7e14;
}

.campaign-paused:hover {
    background: linear-gradient(to left, rgba(255, 193, 7, 0.25) 0%, rgba(255, 193, 7, 0.05) 100%);
    opacity: 0.95;
}

.campaign-paused .campaign-name-ellipsis {
    color: #856404;
}

/* Status 8: متوقفة - رمادي */
.campaign-stopped {
    background: linear-gradient(to left, #f8f9fa 0%, #ffffff 100%);
    opacity: 0.7;
    border-right: 4px solid #6c757d;
}

.campaign-stopped:hover {
    background: linear-gradient(to left, #e9ecef 0%, #f8f9fa 100%);
    opacity: 0.8;
}

.campaign-stopped .campaign-name-ellipsis {
    color: #6c757d;
    text-decoration: line-through;
}

/* Status 9: مكتملة - رمادي داكن */
.campaign-completed {
    background: linear-gradient(to left, rgba(52, 58, 64, 0.1) 0%, #ffffff 100%);
    opacity: 0.75;
    border-right: 4px solid #343a40;
}

.campaign-completed:hover {
    background: linear-gradient(to left, rgba(52, 58, 64, 0.15) 0%, rgba(52, 58, 64, 0.05) 100%);
    opacity: 0.85;
}

.campaign-completed .campaign-name-ellipsis {
    color: #495057;
}

/* Status 6: نشطة + ROI ممتاز (>50%) - أخضر */
.campaign-active.campaign-excellent {
    background: linear-gradient(to left, rgba(212, 237, 218, 0.35) 0%, #ffffff 100%);
    border-right: 4px solid #28a745;
}

.campaign-active.campaign-excellent:hover {
    background: linear-gradient(to left, rgba(212, 237, 218, 0.55) 0%, rgba(212, 237, 218, 0.15) 100%);
}

/* Status 6: نشطة + ROI جيد (20-50%) - أزرق فاتح */
.campaign-active.campaign-good {
    background: linear-gradient(to left, rgba(13, 202, 240, 0.1) 0%, #ffffff 100%);
    border-right: 4px solid #0dcaf0;
}

.campaign-active.campaign-good:hover {
    background: linear-gradient(to left, rgba(13, 202, 240, 0.15) 0%, rgba(13, 202, 240, 0.05) 100%);
}

/* Status 6: نشطة + ROI متوسط (0-20%) - أصفر خفيف */
.campaign-active.campaign-average {
    border-right: 4px solid #ffc107;
}

.campaign-active.campaign-average:hover {
    background: linear-gradient(to left, rgba(255, 193, 7, 0.08) 0%, #ffffff 100%);
}

/* Status 6: نشطة + ROI سلبي (<0%) - أحمر */
.campaign-active.campaign-poor {
    background: linear-gradient(to left, rgba(248, 215, 218, 0.3) 0%, #ffffff 100%);
    border-right: 4px solid #dc3545;
}

.campaign-active.campaign-poor:hover {
    background: linear-gradient(to left, rgba(248, 215, 218, 0.5) 0%, rgba(248, 215, 218, 0.1) 100%);
}

/* Sync Badge */
.sync-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
}

/* Badge Purple */
.badge.bg-purple {
    background: var(--gradient-purple) !important;
    color: white;
}

/* تحسين عرض الأرقام في الجدول */
.table-modern tbody td {
    white-space: nowrap;
}

/* تحسين الحدود بين الأعمدة */
.table-modern tbody td.propeller-col:first-of-type {
    border-right: 3px solid rgba(231, 76, 60, 0.2);
}

.table-modern tbody td.adsterra-col:first-of-type {
    border-right: 3px solid rgba(39, 174, 96, 0.2);
}

/* تحسين hover للصفوف */
.table-modern tbody tr:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* ========================================
   📅 Date Range Picker - تنسيقات احترافية
   ======================================== */

/* الحاوية الرئيسية */
.daterangepicker {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
    padding: 0 !important;
    margin-top: 8px !important;
}

/* Header - الشهر والسنة */
.daterangepicker .calendar-table {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.daterangepicker .calendar-table thead tr:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
}

.daterangepicker .calendar-table thead tr:first-child th {
    color: #fff !important;
    font-weight: 600;
    padding: 12px 8px;
    border: none !important;
}

/* أيام الأسبوع */
.daterangepicker .calendar-table thead tr:nth-child(2) th {
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 5px;
    border: none !important;
}

/* الأيام */
.daterangepicker td {
    border-radius: 8px !important;
    transition: all 0.2s ease;
    font-weight: 500;
}

.daterangepicker td.available:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    transform: scale(1.05);
}

/* اليوم المحدد */
.daterangepicker td.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.daterangepicker td.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%) !important;
}

/* اليوم الحالي */
.daterangepicker td.today {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 700;
}

/* النطاق المحدد */
.daterangepicker td.in-range {
    background: rgba(102, 126, 234, 0.15) !important;
    color: #667eea !important;
}

.daterangepicker td.start-date,
.daterangepicker td.end-date {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    font-weight: 700;
}

/* الأيام غير المتاحة */
.daterangepicker td.off,
.daterangepicker td.disabled {
    color: #ddd !important;
    background: transparent !important;
}

/* قائمة الاختيارات السريعة */
.daterangepicker .ranges {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
}

.daterangepicker .ranges li {
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 6px;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.daterangepicker .ranges li:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateX(-4px);
}

.daterangepicker .ranges li.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* الأزرار */
.daterangepicker .drp-buttons {
    border-top: 2px solid #f0f0f0;
    padding: 16px;
    text-align: left;
}

.daterangepicker .drp-buttons .btn {
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.daterangepicker .drp-buttons .applyBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.daterangepicker .drp-buttons .applyBtn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.daterangepicker .drp-buttons .cancelBtn {
    background: #fff;
    border: 2px solid #e0e0e0;
    color: #6c757d;
}

.daterangepicker .drp-buttons .cancelBtn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

/* أسهم التنقل */
.daterangepicker .prev,
.daterangepicker .next {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.daterangepicker .prev:hover,
.daterangepicker .next:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* RTL Support */
.daterangepicker[dir="rtl"] .ranges li:hover {
    transform: translateX(4px);
}

/* Animation */
.daterangepicker {
    animation: datePickerFadeIn 0.3s ease;
}

@keyframes datePickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .daterangepicker {
        width: 100% !important;
        max-width: 350px;
    }
    
    .daterangepicker .ranges {
        width: 100% !important;
    }
    
    .daterangepicker .drp-calendar {
        max-width: 100%;
    }
}

/* ========================================
   Automation Rules Page Styles - تنسيقات صفحة الأتمتة
   ======================================== */

/* Rules Section - قسم القواعد المبسط */
.rules-section {
    padding: 2rem 0;
}

.section-intro p {
    font-size: 1.1rem;
    color: #6c757d;
}

.pair-info-alert {
    margin-top: 1.5rem;
}

.pair-info-alert .alert {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 12px;
}

.pair-info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pair-info-content {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
}

.pair-info-content small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Rules Grid - شبكة القواعد */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Rule Card Simple - بطاقة القاعدة المبسطة */
.rule-card-simple {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rule-card-simple:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.rule-card-simple.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.03) 0%, rgba(34, 197, 94, 0.03) 100%);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.15);
    transform: translateY(-1px);
}

/* Rule Header Simple */
.rule-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.rule-category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.category-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    white-space: nowrap;
}

.rule-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.rule-card-simple.selected .rule-status {
    background: #28a745;
    border-color: #28a745;
    transform: scale(1.1);
}

.rule-status i {
    font-size: 1rem;
    color: #dee2e6;
    transition: all 0.3s ease;
}

.rule-card-simple.selected .rule-status i {
    color: white;
    transform: scale(1.1);
}

/* Rule Content */
.rule-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rule-title-simple {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.rule-description-simple {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Rule Badges Container */
.rule-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Rule Badge */
.rule-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.rule-badge i {
    font-size: 0.8rem;
}

/* Rule Difficulty */
.rule-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
}

/* Difficulty Colors */
.rule-difficulty[data-difficulty="سهل"] {
    color: #28a745;
}

.rule-difficulty[data-difficulty="متوسط"] {
    color: #ffc107;
}

.rule-difficulty[data-difficulty="متقدم"] {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .rules-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rule-card-simple {
        min-height: 180px;
        padding: 1.25rem;
    }

    .section-intro h3 {
        font-size: 1.5rem;
    }
}

.category-protection { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); }
.category-profit { background: linear-gradient(135deg, #51cf66 0%, #40c057 100%); }
.category-reset { background: linear-gradient(135deg, #74c0fc 0%, #339af0 100%); }

/* تنسيقات العرض الترحيبي */
.welcome-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem 0;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.welcome-title .bi {
    font-size: 2.2rem;
    animation: robotPulse 2s ease-in-out infinite;
}

@keyframes robotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
}

.stats-overview {
    max-width: 800px;
    margin: 0 auto;
}

.stat-card-modern {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card-modern:hover {
    transform: translateY(-5px);
}

.stat-icon-modern {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content-modern h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
}

.stat-desc {
    margin: 0.5rem 0 0 0;
    color: #718096;
    font-size: 0.9rem;
}

.section-title {
    color: #2d3748;
    font-weight: 600;
    text-align: center;
}

.steps-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-content h5 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.cta-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.cta-arrow {
    animation: bounce 2s infinite;
}

.empty-state {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.empty-icon {
    opacity: 0.5;
}

.empty-title {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 1rem;
}

.welcome-message {
    max-width: 600px;
    margin: 0 auto;
}

.cta-simple {
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
}

.cta-pointer {
    position: relative;
    display: inline-block;
}

.pointer-arrow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.campaign-info-card {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Header */
.campaign-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.campaign-info-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.campaign-info-title {
    flex: 1;
}

.campaign-info-title h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.4;
}

.campaign-info-title .campaign-id {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

/* Grid */
.campaign-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Info Item */
.info-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.info-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.info-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label i {
    color: #667eea;
    font-size: 1rem;
}

.info-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2c3e50;
    word-break: break-word;
}

/* Status Badge في Info Card */
.info-value .badge {
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .campaign-info-card {
        padding: 16px;
    }
    
    .campaign-info-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .campaign-info-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .campaign-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-item {
        padding: 12px;
    }
}

/* ========================================
   🕐 Timezone Selector - القائمة الذكية
   ======================================== */

.timezone-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 0;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    height: 42px; /* نفس ارتفاع حقل البحث */
    padding: 0 12px;
}

.timezone-selector-wrapper:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.timezone-selector-wrapper i {
    color: #667eea;
    font-size: 16px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.timezone-selector-wrapper:hover i {
    transform: rotate(360deg);
}

.timezone-selector-wrapper small {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
}

/* القائمة المنسدلة */
.timezone-select {
    min-width: 140px;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    background: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    padding-left: 24px;
    height: 100%;
}

.timezone-select:focus {
    outline: none;
}

/* خيارات القائمة */
.timezone-select option {
    padding: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    background: white;
    color: #2c3e50;
}

.timezone-select option:hover {
    background: #f8f9fa;
}

/* Emoji في الخيارات */
.timezone-select option::before {
    margin-left: 8px;
}

/* Animation عند التغيير */
.timezone-select.changing {
    animation: timezoneChange 0.4s ease;
}

@keyframes timezoneChange {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* RTL Support */
[dir="rtl"] .timezone-select {
    background-position: right 8px center;
    padding-left: 0;
    padding-right: 24px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .timezone-selector-wrapper {
        height: 38px;
        padding: 0 10px;
        gap: 4px;
    }
    
    .timezone-selector-wrapper small {
        display: none; /* إخفاء النص في الموبايل */
    }
    
    .timezone-selector-wrapper i {
        font-size: 14px;
    }
    
    .timezone-select {
        min-width: 120px;
        font-size: 12px;
        padding-left: 20px;
    }
    
    [dir="rtl"] .timezone-select {
        padding-left: 0;
        padding-right: 20px;
        background-position: right 6px center;
    }
}

/* Dark Mode Support (اختياري) */
@media (prefers-color-scheme: dark) {
    .timezone-selector-wrapper {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        border-color: #4a5568;
    }
    
    .timezone-select {
        background-color: #2c3e50;
        color: #e9ecef;
        border-color: #4a5568;
    }
    
    .timezone-select option {
        background-color: #2c3e50;
        color: #e9ecef;
    }
}

/* ========================================
   🕐 Navbar Time Display - عرض التوقيت
   ======================================== */

.navbar-time-display {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    transition: all 0.3s ease;
}

.navbar-time-display:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* صف التوقيت */
.time-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.2;
}

.time-row i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.time-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.time-value {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fff;
    font-size: 13px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.date-value {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    margin-right: 4px;
}

.timezone-name {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* تأثير نبض للتوقيت المحلي */
.local-time .time-value {
    animation: timePulse 2s ease-in-out infinite;
}

@keyframes timePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive - إخفاء في الشاشات الصغيرة */
@media (max-width: 991px) {
    .navbar-time-display {
        display: none !important;
    }
}

/* ========================================
   📌 Campaign ID Inline - رقم الحملة المدمج
   ======================================== */

.campaign-id-inline {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.campaign-id-inline:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.campaign-name-text {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.95rem;
    font-weight: 500;
    color: #212529;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* تنسيقات campaign-info محسّنة */
.campaign-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.campaign-info .campaign-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #212529;
    line-height: 1.4;
}

.campaign-info .campaign-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: #6c757d;
}

.campaign-info .campaign-meta i {
    font-size: 0.875rem;
}

.campaign-info .campaign-meta .bi-clock {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .campaign-id-inline {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin-left: 6px;
    }
    
    .campaign-name-text {
        max-width: calc(100% - 80px);
        font-size: 0.875rem;
    }
    
    .campaign-info .campaign-meta {
        font-size: 0.75rem;
    }
}

/* ========================================
   📊 Fixed Column Widths - عروض ثابتة للأعمدة
   ======================================== */

/* جدول التتبع (Tracking) - عروض مرنة */

/* 1. الحالة - 7% */
#trackingTable thead th:nth-child(1),
#trackingTable tbody td:nth-child(1) {
    width: 7% !important;
    min-width: 80px !important;
}

/* 2. API - 5% */
#trackingTable thead th:nth-child(2),
#trackingTable tbody td:nth-child(2) {
    width: 5% !important;
    min-width: 50px !important;
}

/* 3. الحملة - 23% */
#trackingTable thead th:nth-child(3),
#trackingTable tbody td:nth-child(3) {
    width: 23% !important;
    min-width: 250px !important;
}

/* 4-8. الأعمدة الرقمية - 8% لكل */
#trackingTable thead th:nth-child(4),
#trackingTable thead th:nth-child(5),
#trackingTable thead th:nth-child(6),
#trackingTable thead th:nth-child(7),
#trackingTable thead th:nth-child(8),
#trackingTable tbody td:nth-child(4),
#trackingTable tbody td:nth-child(5),
#trackingTable tbody td:nth-child(6),
#trackingTable tbody td:nth-child(7),
#trackingTable tbody td:nth-child(8) {
    width: 8% !important;
    min-width: 85px !important;
}

/* 9. ROI - 6% */
#trackingTable thead th:nth-child(9),
#trackingTable tbody td:nth-child(9) {
    width: 6% !important;
    min-width: 70px !important;
}

/* 10. الإجراءات - 15% */
#trackingTable thead th:nth-child(10),
#trackingTable tbody td:nth-child(10) {
    width: 15% !important;
    min-width: 160px !important;
}

/* تحسين عرض عمود الحملة */
.campaign-info-cell {
    min-width: 250px !important;
}

/* Horizontal Scroll للجدول */
.table-responsive-full {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* تحسين scrollbar */
.table-responsive-full::-webkit-scrollbar {
    height: 8px;
}

.table-responsive-full::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive-full::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive-full::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* تثبيت عرض الجدول */
#trackingTable {
    width: 100% !important;
    min-width: 1100px !important;
    table-layout: fixed !important;
}

/* ========================================
   📸 Snapshots Table - جدول اللقطات
   ======================================== */

/* جدول اللقطات - عروض مرنة */
#snapshotsTable {
    width: 100% !important;
    min-width: 1000px !important;
    table-layout: fixed !important;
}

/* تكبير حجم الخط للأعمدة الرقمية في جدول اللقطات */
#snapshotsTable tbody td:nth-child(3),  /* التكلفة */
#snapshotsTable tbody td:nth-child(4),  /* العائد */
#snapshotsTable tbody td:nth-child(5),  /* الربح */
#snapshotsTable tbody td:nth-child(6),  /* ROI */
#snapshotsTable tbody td:nth-child(7),  /* المشاهدات */
#snapshotsTable tbody td:nth-child(8),  /* النقرات */
#snapshotsTable tbody td:nth-child(9) { /* التحويلات */
    font-size: 15px;
    font-weight: 600;
}

/* ========================================
   🔧 Additional Components - مكونات إضافية
   ======================================== */

/* Search Input Placeholder */
#customSearchInput::placeholder {
    color: #999;
    opacity: 1;
    font-weight: 400;
}

#customSearchInput {
    color: #333;
}

/* Actions Column */
.actions-col {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.actions-col .d-flex {
    flex-wrap: nowrap !important;
}

.actions-col .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 36px;
    white-space: nowrap;
}

.actions-col .btn i {
    font-size: 1rem;
}

/* Performance Column (تاريخ الإنشاء) */
.performance-col {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    white-space: nowrap;
}

.performance-col .d-flex {
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
}

.performance-col strong {
    font-size: 0.875rem;
}

.performance-col .bi-calendar,
.performance-col .bi-clock {
    font-size: 0.75rem;
}

/* Pair Name Column (اسم الزوج) */
.pair-name-col {
    min-width: 200px;
    max-width: 300px;
    width: auto;
}

.pair-name-col .campaign-id-inline {
    font-size: 0.7rem;
    padding: 3px 8px;
}

/* Propeller Column (حساب المعلن) */
.propeller-col {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    white-space: nowrap;
}

.propeller-col > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.propeller-col .d-flex {
    flex-wrap: nowrap !important;
}

.propeller-col .fw-semibold {
    font-size: 0.875rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.propeller-col small {
    font-size: 0.7rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.propeller-col i {
    font-size: 0.9rem;
}

/* Adsterra Column (حساب الناشر) */
.adsterra-col {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    white-space: nowrap;
}

.adsterra-col > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.adsterra-col .badge {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 4px 8px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adsterra-col .badge i {
    font-size: 0.7rem;
    margin-left: 4px;
}

.adsterra-col small {
    display: block;
    white-space: nowrap;
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Spin Animation */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* API Status Cell */
.api-status-cell {
    vertical-align: middle;
}

/* Campaign ID Badge (legacy - use campaign-id-inline instead) */
.campaign-id-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Zone ID Badge */
.zone-id-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(240, 147, 251, 0.3);
}

/* Zone Row Classes */
.zone-excellent {
    background-color: rgba(40, 167, 69, 0.05);
}

.zone-good {
    background-color: rgba(255, 193, 7, 0.05);
}

.zone-average {
    background-color: rgba(23, 162, 184, 0.05);
}

.zone-poor {
    background-color: rgba(220, 53, 69, 0.05);
}

/* Campaign Date */
.campaign-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    flex-wrap: wrap;
}

.campaign-date i {
    color: #667eea;
}

.campaign-date strong {
    color: #333;
    font-weight: 600;
}

/* ========================================
   Icon Picker & Preview (اختيار الأيقونات)
   ======================================== */

/* Icon Preview Box - صندوق معاينة الأيقونة */
.icon-preview-box {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.icon-preview-box i {
    font-size: 2.5rem;
}

.icon-preview-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Icon Picker Button Styles - أزرار اختيار الأيقونات */
.icon-picker-btn {
    transition: all 0.2s ease;
    border-radius: 8px;
    aspect-ratio: 1;
}

.icon-picker-btn:hover {
    transform: scale(1.1);
    z-index: 10;
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: white;
}

.icon-picker-btn:active {
    transform: scale(0.95);
}

/* Pulse Scale Animation - تأثير النبض */
.pulse-scale {
    animation: pulseScale 0.4s ease;
}

@keyframes pulseScale {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.15); 
    }
}

/* Color Preview في الجدول */
.color-preview-small {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    display: inline-block;
    transition: all 0.2s ease;
}

.color-preview-small:hover {
    transform: scale(1.2);
    border-color: #adb5bd;
}

/* ========================================
   🔧 Admin Pages Styles (تنسيقات صفحات الإدارة)
   ======================================== */

/* Admin Hero Section */
.cleanup-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.cleanup-hero h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cleanup-hero p {
    opacity: 0.95;
    font-size: 1.1rem;
}

/* Admin Action Cards */
.action-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.action-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.action-card-danger {
    border: 3px solid #ff0000 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
}

.action-card h4 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.action-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Admin Action Buttons */
.action-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.action-btn i {
    font-size: 1.1rem;
}

/* Button Variants */
.btn-danger-action {
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    color: white;
}

.btn-danger-action:hover {
    background: linear-gradient(135deg, #e00739 0%, #ff9b7a 100%);
    box-shadow: 0 5px 20px rgba(255, 8, 68, 0.4);
}

.btn-warning-action {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-warning-action:hover {
    background: linear-gradient(135deg, #e07eeb 0%, #e54558 100%);
    box-shadow: 0 5px 20px rgba(240, 147, 251, 0.4);
}

.btn-success-action {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success-action:hover {
    background: linear-gradient(135deg, #0e8076 0%, #2dd968 100%);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

.btn-nuclear {
    background: linear-gradient(135deg, #000000 0%, #ff0000 100%);
    color: white;
    border: 3px solid #ff0000;
    animation: pulse-nuclear 2s infinite;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-nuclear:hover {
    background: linear-gradient(135deg, #1a0000 0%, #ff1a1a 100%);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
}

@keyframes pulse-nuclear {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
        transform: scale(1.02);
    }
}

/* Admin Stats Cards */
.admin-stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin: 0;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-number {
    font-size: 2rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-weight: 500;
}

.stat-card .small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Progress Bar Custom */
.progress-bar-custom {
    height: 30px;
    border-radius: 15px;
    background: #e9ecef;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Admin Alerts */
.admin-alert,
.alert {
    border-radius: 12px;
}

.alert h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.alert ul {
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

.alert code,
.table-sm code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

/* RTL Support for Admin */
[dir="rtl"] .action-btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .alert h6 i,
[dir="rtl"] .action-card h4 i {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .alert ul {
    padding-right: 0;
    padding-left: 1.5rem;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .action-card {
        padding: 1rem;
    }
    
    .action-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ========================================
   صفحة قواعد الحملات الديناميكية
   ======================================== */

.rules-container {
    max-width: 1400px;
    margin: 0 auto;
}

.network-section {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.network-section:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.08);
}

.network-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.network-header .flex-grow-1 {
    flex: 1;
}

.network-header .flex-grow-1 h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.network-header .flex-grow-1 p {
    margin: 0.25rem 0 0 0;
    color: #64748b;
    font-size: 0.875rem;
}

.network-header .text-end small {
    color: #94a3b8;
    font-weight: 500;
}

.network-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
}

.network-status.active { background: #28a745; }
.network-status.inactive { background: #6c757d; }
.network-status.error { background: #dc3545; }

.rule-card {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.06);
}

.rule-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-badge i {
    font-size: 0.6rem;
}

.rule-actions {
    display: flex;
    gap: 0.5rem;
}

.operator-select, .metric-select {
    width: auto;
    min-width: 140px;
}

.threshold-input {
    width: auto;
    min-width: 100px;
}

.add-rule-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.add-rule-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.remove-rule-btn {
    background: #dc3545;
    border: none;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.remove-rule-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.copy-rule-btn {
    background: #17a2b8;
    border: none;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.copy-rule-btn:hover {
    background: #138496;
    transform: scale(1.05);
}

.rule-templates {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.template-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border: none;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 0.125rem;
    transition: all 0.2s;
    cursor: pointer;
}

.template-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.preview-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.preview-content {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.rule-preview {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.rule-preview strong {
    color: #495057;
}

.rule-preview .badge {
    font-size: 0.7rem;
}

.analytics-card {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    color: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.analytics-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.analytics-card .card-title {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #334155;
    font-weight: 600;
}

.analytics-card .card-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #1e293b;
}

.analytics-card .card-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    opacity: 1;
}

/* AI Insights والتوقعات */
.alert-smart {
    background: linear-gradient(135deg, #FFF3CD 0%, #FFEAA7 100%);
    border: 1px solid #FFECB5;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.alert-smart:hover {
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
    transform: translateY(-1px);
}

.alert-smart .alert-icon {
    color: #856404;
    margin-left: 0.5rem;
}

/* تحسين ألوان التنبيهات الذكية */
.alert-smart.alert-warning {
    background: linear-gradient(135deg, #FFF3CD 0%, #FFEAA7 100%);
    border-color: #FFECB5;
}

.alert-smart.alert-success {
    background: linear-gradient(135deg, #D4EDDA 0%, #C3E6CB 100%);
    border-color: #C3E6CB;
}

.alert-smart.alert-primary {
    background: linear-gradient(135deg, #CCE5FF 0%, #B3D7FF 100%);
    border-color: #B3D7FF;
}

/* تحسين عرض التوقعات */
.prediction-card {
    background: linear-gradient(135deg, #E8F5E8 0%, #F1F8E9 100%);
    border: 2px solid #C8E6C9;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.prediction-card:hover {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}

.prediction-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.prediction-value.positive {
    color: #28a745;
}

.prediction-value.negative {
    color: #dc3545;
}

.prediction-label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
}

.confidence-badge {
    margin-top: 1rem;
}

.confidence-badge .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

/* أيقونات الاتجاه */
.trend-icon {
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.trend-icon.positive {
    color: #28a745;
}

.trend-icon.negative {
    color: #dc3545;
}

.rule-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.stat-item strong {
    color: #334155;
}

.bulk-actions {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.bulk-actions .btn {
    margin: 0.125rem;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .network-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .rule-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .rule-stats {
        flex-direction: column;
    }

    .operator-select, .metric-select {
        min-width: 120px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Animation delays for stat cards */
.stats-grid .stat-card:nth-child(1) {
    animation-delay: 0s;
}

.stats-grid .stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stats-grid .stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stats-grid .stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

.stats-grid .stat-card:nth-child(5) {
    animation-delay: 0.4s;
}

/* Rule Level */
.rule-level {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
}

/* Level Colors */
.rule-level[data-level="beginner"] {
    color: #28a745;
}

.rule-level[data-level="intermediate"] {
    color: #ffc107;
}

.rule-level[data-level="advanced"] {
    color: #dc3545;
}

/* Enabled Rules */
.rule-card-simple.enabled {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(34, 197, 94, 0.05) 100%);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.15);
}

.rule-card-simple.enabled .rule-status i {
    color: #28a745;
    transform: scale(1.1);
}

/* Rule Category */
.rule-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    white-space: nowrap;
}

.rule-status-badge {
    flex-shrink: 0;
}

/* Enhanced Card States */
.rule-card-simple {
    transition: all 0.3s ease;
}

.rule-card-simple.enabled {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(34, 197, 94, 0.08) 100%);
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.rule-card-simple.enabled:hover {
    border-color: #28a745;
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.25);
    transform: translateY(-3px);
}

.rule-card-simple:not(.enabled) {
    border-color: #dee2e6;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rule-card-simple:not(.enabled):hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Status Text */
.status-text {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

.status-text.enabled {
    color: #fff;
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.status-text.disabled {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Selected Card State - Enhanced */
.rule-card-simple.selected {
    border: 3px solid #667eea !important;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4) !important;
    transform: translateY(-3px) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%) !important;
}

.rule-card-simple.selected.enabled {
    border: 3px solid #28a745 !important;
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4) !important;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(34, 197, 94, 0.08) 100%) !important;
}

/* ========================================
   📊 Pair Details Hero Compact - تفاصيل الزوج المدمجة
   ======================================== */

.pair-details-hero-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.pair-details-hero-compact i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.pair-details-hero-compact strong {
    color: #fff;
    font-weight: 600;
}

.network-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.network-info i {
    font-size: 0.9rem;
}

.network-info small {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.network-info .bi-bullseye {
    color: rgba(255, 255, 255, 0.8);
}

.network-info .bi-broadcast {
    color: rgba(255, 255, 255, 0.8);
}

.network-info .bi-arrow-left-right {
    color: rgba(255, 255, 255, 0.6);
}

.pair-stats-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-compact {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.stat-compact:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.stat-compact i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.stat-compact strong {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-compact small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    margin-top: 0.1rem;
    display: block;
}

/* Activity status colors */
.stat-compact .text-success {
    color: #28a745 !important;
}

.stat-compact .text-danger {
    color: #dc3545 !important;
}

.stat-compact .text-warning {
    color: #ffc107 !important;
}

.stat-compact .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .pair-details-hero-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pair-stats-compact {
        width: 100%;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .stat-compact {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   📖 Rule Explanation Modal (شرح القواعد)
   ======================================== */

.rule-explanation-modal .modal-dialog {
    max-width: 700px;
}

.rule-explanation-modal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.rule-explanation-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 2rem;
}

.rule-explanation-modal .modal-header h5 {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rule-explanation-modal .modal-header h5 span:first-child {
    font-size: 1.5rem;
    opacity: 0.9;
}

.rule-explanation-modal .modal-body {
    padding: 2rem;
}

.rule-explanation-modal .modal-body .alert {
    border-radius: 15px;
    border: none;
    font-size: 0.95rem;
}

.rule-explanation-modal .modal-body .alert h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-explanation-modal .modal-body .alert h6 i {
    font-size: 1.1rem;
}

.rule-explanation-modal .modal-body .alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.rule-explanation-modal .modal-body .alert-success h6 {
    color: #155724;
}

.rule-explanation-modal .modal-body .alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.rule-explanation-modal .modal-body .alert-info h6 {
    color: #0c5460;
}

.rule-explanation-modal .modal-body ul {
    margin: 0;
    padding-right: 1.5rem;
}

.rule-explanation-modal .modal-body ul li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.rule-explanation-modal .modal-footer {
    border: none;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.rule-explanation-modal .btn-secondary {
    background: #6c757d;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rule-explanation-modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Rule Info Button */
.rule-info-btn {
    padding: 0.375rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.rule-info-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    transform: scale(1.1);
}

.rule-info-btn i {
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .rule-explanation-modal .modal-dialog {
        margin: 0.5rem;
        max-width: none;
    }
    
    .rule-explanation-modal .modal-header,
    .rule-explanation-modal .modal-body,
    .rule-explanation-modal .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .rule-explanation-modal .modal-header h5 {
        font-size: 1.1rem;
    }
}

/* RTL Support for Modal */
[dir="rtl"] .rule-explanation-modal .modal-body ul {
    padding-right: 0;
    padding-left: 1.5rem;
}

[dir="rtl"] .rule-explanation-modal .alert-success,
[dir="rtl"] .rule-explanation-modal .alert-info {
    border-left: none;
    border-right: 4px solid currentColor;
}
