/* ============================================================================
 * نظام إدارة غرفة الأخبار والإنتاج الإعلامي (style.css - النسخة 2.0)
 * يدعم الألوان الديناميكية (--brand-primary / --brand-accent) والوضع الليلي والهواتف
 * ============================================================================ */

:root {
    --brand-primary: #84103d;
    --brand-accent: #f89634;
}

body {
    font-family: 'Almarai', sans-serif;
}

/* تخصيص شريط التمرير */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--brand-primary);
    border-radius: 20px;
}
.dark ::-webkit-scrollbar-thumb {
    background-color: var(--brand-accent);
}

/* حركات النوافذ والتنبيهات */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-enter { animation: slideIn 0.28s ease-out forwards; }
.toast-exit  { animation: fadeOut 0.45s ease-in forwards; }
.fade-in     { animation: fadeIn 0.28s ease-out forwards; }

.modal-bg {
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

/* أزرار التنقل السريع */
.qnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5563;
    transition: all 0.15s ease;
    cursor: pointer;
}
.qnav-btn:hover {
    background-color: rgba(132, 16, 61, 0.08);
    color: var(--brand-primary);
}
.qnav-btn.active {
    background-color: var(--brand-primary);
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
html.dark .qnav-btn {
    color: #d1d5db;
}
html.dark .qnav-btn.active {
    background-color: var(--brand-primary);
    color: #ffffff !important;
}

/* مؤشرات SLA */
.sla-ok      { background-color: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.sla-warn    { background-color: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.sla-overdue { background-color: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; animation: pulse 2s infinite; }

html.dark .sla-ok      { background-color: #064e3b; color: #a7f3d0; border-color: #059669; }
html.dark .sla-warn    { background-color: #78350f; color: #fde68a; border-color: #d97706; }
html.dark .sla-overdue { background-color: #7f1d1d; color: #fecaca; border-color: #dc2626; }

/* تنسيق عرض الفروقات (Diff View) */
.diff-added   { background-color: #dcfce7; color: #166534; padding: 0 3px; border-radius: 3px; }
.diff-removed { background-color: #fee2e2; color: #991b1b; text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
html.dark .diff-added   { background-color: #14532d; color: #bbf7d0; }
html.dark .diff-removed { background-color: #7f1d1d; color: #fecaca; }

/* سحب وإفلات الشرائح */
.slide-block-item.dragging {
    opacity: 0.45;
    border-style: dashed;
    border-color: var(--brand-primary);
}
.drag-handle {
    cursor: grab;
}
.drag-handle:active {
    cursor: grabbing;
}

/* ============================================================================
 * تصحيح تعارضات الوضع الليلي (Dark Mode Global Harmonization)
 * ============================================================================ */
html.dark .bg-white {
    background-color: #1f2937 !important;
    color: #f3f4f6;
}
html.dark .bg-gray-50,
html.dark .bg-gray-50\/50,
html.dark .bg-gray-50\/30,
html.dark .bg-gray-50\/90 {
    background-color: #111827 !important;
    color: #e5e7eb;
}
html.dark .bg-gray-100 {
    background-color: #374151 !important;
    color: #e5e7eb;
}
html.dark .text-gray-800,
html.dark .text-gray-700 {
    color: #f3f4f6 !important;
}
html.dark .text-gray-600,
html.dark .text-gray-500 {
    color: #9ca3af !important;
}
html.dark .border-gray-200,
html.dark .border-gray-100,
html.dark .border-gray-300,
html.dark .border,
html.dark .border-t,
html.dark .border-b {
    border-color: #374151 !important;
}
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html.dark textarea,
html.dark select {
    background-color: #111827 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}
html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
    border-color: var(--brand-accent) !important;
}

/* الحفاظ على ألوان حقول الملاحظات والروابط */
.note-field-box {
    background-color: #fef9c3 !important;
    border-color: #fde047 !important;
    color: #854d0e !important;
}
html.dark .note-field-box {
    background-color: #422006 !important;
    border-color: #a16207 !important;
    color: #fef08a !important;
}
.link-field-box {
    background-color: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}
html.dark .link-field-box {
    background-color: #052e16 !important;
    border-color: #15803d !important;
    color: #bbf7d0 !important;
}
