/* ========================================= */
/* مجوهرات العطاس - الملف المطور الشامل 2026 */
/* ========================================= */

/* 1. تخصيص شريط التمرير (Scrollbar) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #D6A74A; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #A37215; }

/* 2. إعدادات عامة وحماية المحتوى */
* { box-sizing: border-box; }
body { 
    overflow-x: hidden; 
    padding-top: 38px; /* هام: يمنع الشريط من تغطية المحتوى */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* السماح بالكتابة داخل حقول الإدخال */
input, textarea, select { -webkit-user-select: auto !important; user-select: auto !important; }

.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.gold-gradient-text {
    background: linear-gradient(to right, #A37215, #D6A74A, #A37215);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shine 3s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* 3. الحركات (Animations) */
.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { 
    from { transform: translateY(20px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}

/* 4. شريط أسعار الذهب الثابت - المطور 2026 */
#main-ticker {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background-color: #0f172a;
    height: 38px; /* ارتفاع الكمبيوتر */
    border-bottom: 1px solid rgba(214, 167, 74, 0.3);
}

/* حالة التمدد للجوال (يتم تفعيلها عبر JS) */
#main-ticker.expanded {
    height: auto !important;
    padding-bottom: 10px;
}

#gold-prices-container {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 100%;
}

.price-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 13px; 
    color: #fff; 
    white-space: nowrap; 
}

.price-value { font-family: 'monospace'; color: #D6A74A; font-weight: bold; }

/* السهم (يظهر في الجوال فقط) */
.ticker-arrow {
    transition: transform 0.3s ease;
    display: none; 
}

/* 5. تنسيق السلايدر (Trending Slider) */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
#trending-slider-container {
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    scroll-behavior: smooth;
}
.slider-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 20;
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; color: #4b5563;
}
.slider-nav-btn:hover { background: #D6A74A; color: white; border-color: #D6A74A; transform: translateY(-50%) scale(1.1); }
.slider-prev { left: 10px; }
.slider-next { right: 10px; }

/* 6. تنسيقات لوحة التحكم (Admin) */
.admin-sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
    color: #64748b; font-weight: 600; transition: all 0.3s ease; text-decoration: none;
}
.admin-sidebar-link:hover { background-color: #FBF8F1; color: #D6A74A; }
.admin-sidebar-link.active { background-color: #D6A74A; color: white; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background-color: #f8fafc; color: #475569; font-weight: 700; padding: 12px; text-align: right; border-bottom: 2px solid #e2e8f0; font-size: 0.85rem; white-space: nowrap; }
.admin-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; color: #334155; font-size: 0.9rem; vertical-align: middle; }
.admin-table tr:hover td { background-color: #FBF8F1; }

/* 7. إصلاحات الجوال (Mobile Fixes) */
@media (max-width: 640px) {
    body { padding-top: 35px; }
    #main-ticker { height: 35px; }

    #gold-prices-container { 
        flex-direction: column; /* ترتيب رأسي عند الفتح */
        gap: 0; 
        padding: 0 15px;
        justify-content: flex-start;
    }

    /* إخفاء العيارات في الوضع العادي للجوال */
    .price-item { 
        display: none; 
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    /* إظهار سطر الأونصة فقط كواجهة */
    .price-item.gold-ounce-display {
        display: flex !important;
        justify-content: space-between;
        order: -1;
        border: none;
    }

    /* إظهار الباقي عند التمدد */
    #main-ticker.expanded .price-item { display: flex !important; }

    .ticker-arrow { display: block !important; color: #D6A74A; }
    #main-ticker.expanded .ticker-arrow { transform: rotate(180deg); }

    h1 { font-size: 1.4rem !important; }
    h2 { font-size: 1.2rem !important; }
    p, span, div { font-size: 0.95rem !important; }

    /* شبكة المنتجات للجوال */
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr !important; gap: 1rem !important; }
    #special-app .grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem !important; }

    .fixed.inset-0 .bg-white { width: 92% !important; max-height: 85vh !important; margin: 10px auto !important; border-radius: 16px !important; }
}

/* 8. وضع التكبير (Maximized) */
.modal-maximized > div {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important; max-width: 100% !important;
    max-height: 100vh !important; margin: 0 !important; border-radius: 0 !important;
    z-index: 99999 !important; overflow-y: auto !important;
}
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* 9. تنسيقات الطباعة (Print Styles) */
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body > *:not(#adminOrderDetailsModal) { display: none !important; }
    #adminOrderDetailsModal, #adminOrderDetailsModal > div, #printable-order-content {
        position: static !important; overflow: visible !important; height: auto !important;
        display: block !important; width: 100% !important; margin: 0 !important; border: none !important;
    }
    .no-print, button { display: none !important; }
    .grid { display: grid !important; }
    .print\:grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
}

/* حماية الصور ومنع خروج النصوص */
img { max-width: 100%; height: auto; display: block; -webkit-user-drag: none; user-drag: none; }
p, span, div, h1, h2, h3, h4, h5, h6 { word-wrap: break-word; overflow-wrap: break-word; }