/* ============================================================
   dark-fix.css  —  v444
   الوضع الليلي: كل أيقونة تُرسم خطوطاً بيضاء (outline)، لا كتل مصمتة.
   أُزيلت القاعدة الشاملة [style*="background:#fff"] من v443
   لأنها كانت تُسوّد عناصر مقصود أن تكون بيضاء (خط تبويب الشورتس).
   ============================================================ */

/* 1) متغيّرات كانت مستعملة وغير مُعرَّفة أصلاً */
:root{ --bg2:#f0f2f5; --hover:#f2f2f2; --overlay:rgba(0,0,0,.45); }
[data-theme="dark"]{ --bg2:#1c1c1e; --hover:#2c2c2e; --overlay:rgba(0,0,0,.7); }

/* 2) سيلكتور مكسور في pages.css (نقطة بدل قوس) */
[data-theme="dark"] .profile-tab{color:#8e8e8e !important;}
[data-theme="dark"] .profile-tab.active{color:#fff !important;border-bottom-color:#fff !important;opacity:1 !important;}
[data-theme="dark"] .profile-tab svg{stroke:currentColor !important;}
[data-theme="dark"] .profile-tab.active svg{stroke:#fff !important;}
[data-theme="dark"] .profile-tab.active svg[fill]:not([fill="none"]){fill:#fff !important;}

/* 3) الأيقونات — خطوط بيضاء، نطاق محدود */
[data-theme="dark"] .icon-btn svg,
[data-theme="dark"] .top-bar svg,
[data-theme="dark"] .profile-top-bar svg,
[data-theme="dark"] .create-header svg,
[data-theme="dark"] .nav-btn svg,
[data-theme="dark"] .action-btn svg,
[data-theme="dark"] .btn-back svg,
[data-theme="dark"] .settings-row svg,
[data-theme="dark"] .settings-item svg,
[data-theme="dark"] .menu-row svg,
[data-theme="dark"] .list-row svg,
[data-theme="dark"] .drawer-menu svg,
[data-theme="dark"] .post-menu-btn svg,
[data-theme="dark"] .comment-send-btn svg,
[data-theme="dark"] .comment-del svg,
[data-theme="dark"] .search-bar-wrap svg,
[data-theme="dark"] .user-row svg,
[data-theme="dark"] .notif-item svg,
[data-theme="dark"] .chat-header svg{
  stroke:#fff !important; color:#fff !important;
}
/* الأشكال المصمتة داخل تلك الأيقونات: نُفرّغها فتصير خطوطاً */
[data-theme="dark"] .icon-btn svg [fill]:not([fill="none"]):not([fill="currentColor"]),
[data-theme="dark"] .top-bar svg [fill]:not([fill="none"]):not([fill="currentColor"]),
[data-theme="dark"] .nav-btn svg [fill]:not([fill="none"]):not([fill="currentColor"]),
[data-theme="dark"] .settings-row svg [fill]:not([fill="none"]):not([fill="currentColor"]),
[data-theme="dark"] .menu-row svg [fill]:not([fill="none"]):not([fill="currentColor"]){
  fill:none !important; stroke:#fff !important;
}
/* SVG منفرد بلون أسود ثابت (voice.js #222، feed.js #111، profile-tabs.js #111) */
[data-theme="dark"] svg[stroke="#111"],[data-theme="dark"] svg[stroke="#222"],
[data-theme="dark"] svg[stroke="#333"],[data-theme="dark"] svg[stroke="#000"],
[data-theme="dark"] svg[stroke="#000000"],[data-theme="dark"] svg[stroke="black"],
[data-theme="dark"] [stroke="#111"],[data-theme="dark"] [stroke="#222"],
[data-theme="dark"] [stroke="#333"],[data-theme="dark"] [stroke="#000"]{ stroke:#fff !important; }
[data-theme="dark"] svg[fill="#111"],[data-theme="dark"] svg[fill="#222"],
[data-theme="dark"] svg[fill="#333"],[data-theme="dark"] svg[fill="#000"],
[data-theme="dark"] svg[fill="#000000"],[data-theme="dark"] svg[fill="black"],
[data-theme="dark"] [fill="#111"],[data-theme="dark"] [fill="#222"],
[data-theme="dark"] [fill="#333"],[data-theme="dark"] [fill="#000000"]{ fill:#fff !important; }

/* استثناءات دلالية */
[data-theme="dark"] .action-btn.liked svg{stroke:#E53935 !important;fill:#E53935 !important;}
[data-theme="dark"] .action-btn.saved svg{stroke:#FFD700 !important;fill:#FFD700 !important;}
[data-theme="dark"] .gx-share-icon svg,[data-theme="dark"] .gx-share-icon *,
[data-theme="dark"] .gift-icon svg,[data-theme="dark"] .gift-icon *{stroke:initial !important;fill:initial !important;}
[data-theme="dark"] #shortsOverlay svg,[data-theme="dark"] .live-room svg,
[data-theme="dark"] .live-modal-overlay svg,[data-theme="dark"] .img-viewer svg{stroke:initial;fill:initial;}

/* الخط تحت تبويب الشورتس — أبيض دائماً */
[data-theme="dark"] #shortsTabUnderline{background:#fff !important;}

/* 4) زر + في البار: إطار أبيض بدل كتلة بيضاء */
[data-theme="dark"] #globalBottomBar #nbCreate > div,
[data-theme="dark"] .nav-btn.center-btn > div{
  background:transparent !important; border:2px solid #fff !important; border-radius:10px !important;
}
[data-theme="dark"] #globalBottomBar #nbCreate svg,
[data-theme="dark"] .nav-btn.center-btn svg{stroke:#fff !important;fill:none !important;}

/* 5) البطاقات والشيتات */
[data-theme="dark"] .post-menu-sheet,[data-theme="dark"] .gx-share-sheet,
[data-theme="dark"] .menu-sheet,[data-theme="dark"] .bottom-sheet,
[data-theme="dark"] .modal-content,[data-theme="dark"] .dialog,
[data-theme="dark"] .popup,[data-theme="dark"] .dropdown,
[data-theme="dark"] .emoji-picker,[data-theme="dark"] .mini-profile-card{
  background:var(--card) !important; color:var(--text) !important; border-color:var(--border) !important;
}

/* 6) بطاقات بيضاء من inline style في JS — مقيّدة داخل .page فقط */
[data-theme="dark"] .page [style*="background:#fff"]:not(#shortsTabUnderline):not([class*="share"]):not([class*="gift"]),
[data-theme="dark"] .page [style*="background: #fff"]:not(#shortsTabUnderline),
[data-theme="dark"] .page [style*="background:#ffffff"]:not(#shortsTabUnderline),
[data-theme="dark"] .page [style*="background:#fafafa"],
[data-theme="dark"] .page [style*="background:#f5f5f5"],
[data-theme="dark"] .page [style*="background:#eee"]{
  background:var(--card) !important; color:var(--text) !important;
}
[data-theme="dark"] .page [style*="color:#000"],
[data-theme="dark"] .page [style*="color:#111"],
[data-theme="dark"] .page [style*="color:#222"]{color:var(--text) !important;}

/* 7) الحقول */
[data-theme="dark"] input,[data-theme="dark"] textarea,[data-theme="dark"] select{
  background:var(--input-bg) !important; color:var(--text) !important;
  border-color:var(--border) !important; -webkit-text-fill-color:var(--text);
}
[data-theme="dark"] input::placeholder,[data-theme="dark"] textarea::placeholder{color:var(--text2) !important;}
[data-theme="dark"] input:-webkit-autofill,[data-theme="dark"] input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text) !important;
  -webkit-box-shadow:0 0 0 1000px var(--input-bg) inset !important; caret-color:var(--text);
}

/* 8) الحالات الفارغة والتحميل */
[data-theme="dark"] .feed-empty,[data-theme="dark"] .conv-empty,
[data-theme="dark"] .notif-empty,[data-theme="dark"] .search-empty,
[data-theme="dark"] .comments-empty{color:var(--text2) !important;}
[data-theme="dark"] .skel{
  background:linear-gradient(90deg,#1c1c1e 25%,#2c2c2e 50%,#1c1c1e 75%) !important;
  background-size:200% 100% !important;
}
[data-theme="dark"] .notif-unread{background:#141416 !important;}

/* 9) تبقى ملوّنة */
[data-theme="dark"] .btn-primary{background:#EE1D52 !important;color:#fff !important;}
[data-theme="dark"] .btn-primary svg{stroke:#fff !important;}
[data-theme="dark"] .follow-btn:not(.following),[data-theme="dark"] .tt-follow-btn,
[data-theme="dark"] .follow-profile-btn:not(.following){background:#EE1D52 !important;color:#fff !important;}
[data-theme="dark"] .btn-share.ready{background:#2AABEE !important;color:#fff !important;border-color:#2AABEE !important;}

/* ============================================================
   v445 — تصحيحات
   ============================================================ */

/* ✅ إلغاء قاعدة v444 الخاطئة: fill:initial = أسود!
   أيقونات الشورتس أصلاً fill="white" — نتركها وشأنها تماماً */
[data-theme="dark"] #shortsOverlay svg,
[data-theme="dark"] #shortsOverlay svg *,
[data-theme="dark"] .live-room svg,
[data-theme="dark"] .live-room svg *,
[data-theme="dark"] .live-modal-overlay svg,
[data-theme="dark"] .img-viewer svg{
  stroke:unset; fill:unset;
}
/* ضمان: أزرار الشورتس بيضاء دائماً (لايك/تعليق/حفظ/مشاركة) */
[data-theme="dark"] #shortsOverlay svg[fill="white"],
[data-theme="dark"] #shortsOverlay svg[fill="#fff"]{fill:#fff !important;stroke:#fff !important;}
[data-theme="dark"] #shortsOverlay svg[fill="#E53935"]{fill:#E53935 !important;stroke:#E53935 !important;}

/* ✅ حبّة أزرار الاتصال في الشات */
/* [v448] أُزيلت الخلفية الرمادية والخلفية البيضاء النشطة — أيقونات مجرّدة فقط */
.chat-call-pill{background:none;}
.chat-call-pill button{color:#1a1a1a;background:none;}
.chat-call-pill .chat-call-active{background:none;box-shadow:none;}
[data-theme="dark"] .chat-call-pill{background:none !important;}
[data-theme="dark"] .chat-call-pill button{color:#fff !important;}
[data-theme="dark"] .chat-call-pill button svg{fill:#fff !important;stroke:none !important;}
[data-theme="dark"] .chat-call-pill .chat-call-active{background:none !important;box-shadow:none !important;}

/* ✅ زر ➕ السفلي: يتبع الوضع */
#globalBottomBar #nbCreate > div{background:#000;border:none;}
#globalBottomBar #nbCreate svg{stroke:#fff;fill:none;}
[data-theme="dark"] #globalBottomBar:not(.bar-dark) #nbCreate > div{
  background:transparent !important; border:2px solid #fff !important; border-radius:10px !important;
}
[data-theme="dark"] #globalBottomBar:not(.bar-dark) #nbCreate svg{stroke:#fff !important;fill:none !important;}

/* ✅ أيقونات شيت المشاركة الملوّنة: تبقى كما صُمّمت، والرموز البيضاء تبقى بيضاء */
[data-theme="dark"] .gx-share-icon svg,
[data-theme="dark"] .gx-share-icon svg *{stroke:unset !important;fill:unset !important;}
[data-theme="dark"] .gx-share-icon svg[fill="#fff"],
[data-theme="dark"] .gx-share-icon svg[fill="white"]{fill:#fff !important;}

/* ✅ شريط الحالة/التنقل للنظام */
html,body{background-color:var(--bg);}

/* [v445] زر الخيارات ⋮ في المحادثة */
#chatMoreBtn{color:var(--text);}
#chatMoreBtn svg{fill:currentColor !important;stroke:none !important;}
[data-theme="dark"] #chatMoreBtn{color:#fff !important;}
[data-theme="dark"] #chatMoreBtn svg{fill:#fff !important;}

/* ============================================================
   v447 — السبب الجذري لـ«كل شيء أبيض» في الوضع الليلي
   base.css يعرّف:  [data-theme="dark"]{ --primary:#ffffff }
   و --primary مستعمل في ~40 موضع (المفاتيح، الهاشتاغ، المنشن،
   زر البحث، زر إضافة الميديا، السبينر...) ⇒ كلها كتل بيضاء.
   نُعيد لون العلامة التجارية للعناصر الدلالية.
   ============================================================ */
:root{ --accent:#EE1D52; }
[data-theme="dark"]{ --accent:#EE1D52; }

/* المفاتيح (Toggles) — كانت بيضاء ساطعة عند التفعيل */
[data-theme="dark"] .vy-switch input:checked + .vy-slider{
  background:var(--accent) !important;
}
[data-theme="dark"] .vy-switch .vy-slider{
  background:#3a3a3c !important;
}
[data-theme="dark"] .vy-switch .vy-slider::before{
  background:#fff !important;
}

/* أزرار الإجراء الملوّنة — تبقى بلون العلامة لا بيضاء */
[data-theme="dark"] .search-go-btn{
  background:var(--accent) !important; color:#fff !important;
}
[data-theme="dark"] .search-go-btn svg{stroke:#fff !important;}
[data-theme="dark"] .add-media-btn{color:var(--accent) !important;}
[data-theme="dark"] .add-media-btn svg{stroke:var(--accent) !important;}
[data-theme="dark"] .edit-ava-hint{color:var(--accent) !important;}

/* الهاشتاغ والمنشن والروابط */
[data-theme="dark"] .hashtag,
[data-theme="dark"] .mention{color:#4ea3ff !important;}
[data-theme="dark"] .post-link{color:#4ea3ff !important;}

/* السبينر */
[data-theme="dark"] .spinner{border-top-color:var(--accent) !important;}

/* [v455] لا خلفية رمادية خلف أزرار الإشعارات/البحث في الرسائل (فاتح وداكن) */
[data-theme="dark"] #messagesPage .top-bar { border-bottom:none !important; }
[data-theme="dark"] #notificationsPage .top-bar { border-bottom:none !important; }
[data-theme="dark"] #notificationsPage .notif-item,
[data-theme="dark"] #notificationsPage .notif-unread { background:transparent !important; border-bottom:none !important; }
[data-theme="dark"] #notificationsPage .notif-item:active { background:#1c1c1e !important; }
