/* =============================================================
   الوضع الليلي (Dark Mode) لقالب poki-like
   يُفعّل فقط عند وجود class="dark-mode" على <html> (اختياري للزائر).
   لذلك لا يؤثر إطلاقاً على المظهر الافتراضي الفاتح.
   ملف مستقل — لإلغائه احذف رابطه من stylesheets.php
   ============================================================= */

/* ---------- زر التبديل العائم (يظهر في الوضعين) ---------- */
.gm-dark-toggle {
    position: fixed;
    bottom: 18px;
    left: 18px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #1b1e25;
    color: #ffd54a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, background 0.2s ease;
}
.gm-dark-toggle:hover { transform: scale(1.08); }
.gm-dark-toggle .fa-sun { display: none; }
.gm-dark-toggle .fa-moon { display: inline-block; }
html.dark-mode .gm-dark-toggle { background: #ffd54a; color: #15171c; }
html.dark-mode .gm-dark-toggle .fa-sun { display: inline-block; }
html.dark-mode .gm-dark-toggle .fa-moon { display: none; }

@media (max-width: 600px) {
    .gm-dark-toggle { width: 42px; height: 42px; bottom: 14px; left: 14px; }
}

/* =====================  قواعد الوضع الليلي  ===================== */
html.dark-mode { color: #e8e8ea; }

html.dark-mode body {
    background: #0f1115 !important;
    color: #e8e8ea;
}

/* البطاقات والحاويات البيضاء */
html.dark-mode .bgs,
html.dark-mode article,
html.dark-mode aside,
html.dark-mode blockquote,
html.dark-mode .relategames,
html.dark-mode #game-bottom,
html.dark-mode .game-walkthrough {
    background: #1b1e25 !important;
    border-radius: 8px;
}

/* الرأس والتذييل */
html.dark-mode #header,
html.dark-mode .head-inner,
html.dark-mode #footer,
html.dark-mode .new-games-pop-up-mobile,
html.dark-mode .new-games-pop-up {
    background: #161922 !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6) !important;
}
html.dark-mode .foot-inner,
html.dark-mode .foot-inner a,
html.dark-mode .foot-inner span { color: #7fc4ff !important; }

/* النصوص والعناوين */
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode p,
html.dark-mode .game-title,
html.dark-mode .splide-header-title,
html.dark-mode .post .post-name,
html.dark-mode .d-text,
html.dark-mode .category-section-top h2 { color: #e8e8ea !important; }

html.dark-mode a { color: #7fc4ff; }

/* قوائم الألعاب والبطاقات */
html.dark-mode .post,
html.dark-mode .games-list .post,
html.dark-mode .game-list-grid-container,
html.dark-mode .tag-list,
html.dark-mode .home-categories,
html.dark-mode .home-tags,
html.dark-mode #search-left .search-container {
    background: transparent !important;
}
html.dark-mode .post::before,
html.dark-mode .games-list.played-games .post::before { filter: brightness(0.8); }

/* حقول البحث والإدخال */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select,
html.dark-mode .search-input,
html.dark-mode .search-form .txt {
    background: #20242d !important;
    color: #e8e8ea !important;
    border-color: #2c313b !important;
}
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder { color: #9aa0ab !important; }

/* الشريط الجانبي */
html.dark-mode .sidebar { background: #161922 !important; }
html.dark-mode .sidebar-item-title,
html.dark-mode .sidebar-item-icon i { color: #c7ccd6 !important; }
html.dark-mode .sidebar .separator { background-color: #2c313b !important; color: #2c313b !important; }

/* السلايدر */
html.dark-mode .splide,
html.dark-mode .splide__slide { background: transparent !important; }

/* الحدود والفواصل */
html.dark-mode hr,
html.dark-mode .divider { border-color: #2c313b !important; background: #2c313b !important; }

/* صندوق التصويت أسفل اللعبة (له خلفية بيضاء صريحة) */
html.dark-mode .flex.items-center.w-full.bg-white {
    background: #1b1e25 !important;
}
html.dark-mode .vote-btn {
    background: #20242d !important;
    border-color: #2c313b !important;
    color: #7fc4ff !important;
}
html.dark-mode .play-info-blue { color: #7fc4ff !important; }
