/**
 * OX CHART - أنماط لوحة التحكم وتحسينات الأداء
 * تنسيقات لإعدادات تحسين الأداء وعرض البيانات الحقيقية
 */

/* لوحة الإعدادات */
.settings-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-toggle {
    width: 44px;
    height: 44px;
    background-color: rgba(25, 36, 66, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    transition: all 0.3s ease;
    z-index: 1001;
}

.settings-toggle:after {
    content: '⚙️';
    font-size: 22px;
}

body:not(.performance-mode) .settings-toggle {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-toggle:hover {
    background-color: rgba(52, 152, 219, 0.8);
    transform: rotate(45deg);
}

.settings-menu {
    position: absolute;
    top: 50px;
    right: 0;
    width: 280px;
    background-color: rgba(25, 36, 66, 0.85);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.performance-mode) .settings-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-menu.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.settings-menu h3 {
    margin-top: 0;
    font-size: 18px;
    color: #3498db;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    font-weight: 600;
}

.settings-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-menu li {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.settings-menu label {
    flex-grow: 1;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.settings-menu label i {
    margin-right: 8px;
    color: #3498db;
    font-size: 18px;
}

.settings-menu .footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* التبديل لمفاتيح التبديل */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    z-index: 10; /* زيادة z-index للتأكد من إمكانية النقر */
}

.toggle-switch input {
    opacity: 0;
    width: 100%; /* تغيير عرض عنصر الإدخال ليغطي المساحة كاملة */
    height: 100%; /* تغيير ارتفاع عنصر الإدخال ليغطي المساحة كاملة */
    position: absolute;
    z-index: 20; /* جعل عنصر الإدخال فوق الجميع */
    cursor: pointer;
    margin: 0; /* إزالة الهوامش الافتراضية */
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    pointer-events: none; /* منع السلايدر من التداخل مع النقر على الإدخال */
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* منع الدائرة من التداخل مع النقر على الإدخال */
}

input:checked + .toggle-slider {
    background-color: #3498db;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* تأكيد على أن الوسوم li و label لا تتعارض مع النقر */
.settings-menu li {
    position: relative;
}

.settings-menu label {
    pointer-events: none; /* السماح بوصول النقر إلى عنصر الإدخال تحتها */
}

/* شاشة التحميل */
.ticker-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 200px;
}

.loading-pulse {
    position: relative;
    color: var(--gray-300);
}

.loading-pulse:after {
    content: '';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% {
        content: '';
    }
    25% {
        content: '.';
    }
    50% {
        content: '..';
    }
    75% {
        content: '...';
    }
    100% {
        content: '';
    }
}

/* تنسيقات التكيف مع الأجهزة المختلفة */
.performance-warning {
    display: none;
    padding: 8px 15px;
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border-radius: 5px;
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
}

/* وضع الأداء المحسن */
.performance-mode {
    /* تعطيل التأثيرات الثقيلة عند تفعيل وضع الأداء */
    background: linear-gradient(135deg, #0F172A, #334155) !important;
}

.performance-mode .hero-canvas-container {
    display: none !important;
}

.performance-mode .hero-enhanced {
    background: linear-gradient(135deg, #0F172A, #334155);
}

.performance-mode .title-enhanced,
.performance-mode .countdown-number-enhanced {
    animation: none !important;
    text-shadow: none !important;
}

.performance-mode .animate-floating {
    animation: none !important;
}
