/* ns-darkmode-atomic.css - نسخه اتمیک کامل */
/* اینورت کامل بدون از دست دادن چسبندگی */

/* 1. اینورت اصلی روی HTML */
[data-theme="dark"] {
    filter: invert(1) hue-rotate(180deg) !important;
    background: white !important;
}

/* 2. بازگرداندن تصاویر و مدیا */
[data-theme="dark"] img,
[data-theme="dark"] video,
[data-theme="dark"] iframe,
[data-theme="dark"] canvas,
[data-theme="dark"] svg,
[data-theme="dark"] picture {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* 3. دکمه تغییر حالت */
/* دکمه تغییر حالت - آیکون ماه/خورشید */
#ns-ultimate-toggle-btn.ns-darkmode-btn-fixed {
    position: fixed !important;
    bottom: 20px !important;
    left: 30px !important;
    z-index: 2147483647 !important;
    
    /* آیکون ماه/خورشید */
    background: #000000 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 24px 24px !important;
    
    /* اندازه و شکل */
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    
    /* حذف متن */
    font-size: 0 !important;
    color: transparent !important;
    text-indent: -9999px !important;
    
    /* استایل‌های پایه */
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
    filter: invert(1) hue-rotate(180deg) !important;
}

/* 4. حل مشکل چسبندگی - بسیار مهم */
[data-theme="dark"] .elementor-sticky,
[data-theme="dark"] .elementor-section.elementor-sticky,
[data-theme="dark"] .wpforo-header,
[data-theme="dark"] .wpforo-wrap .is-sticky,
[data-theme="dark"] [class*="sticky"],
[data-theme="dark"] [class*="fixed"],
[data-theme="dark"] .sticky,
[data-theme="dark"] .fixed {
    position: sticky !important;
    transform: none !important;
    will-change: auto !important;
}

/* 5. حل مشکل عرض صفحه در انجمن */
[data-theme="dark"] .wpforo-wrap,
[data-theme="dark"] .wpforo-content,
[data-theme="dark"] .wpforo-forum {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* 6. حل مشکل المان‌های المنتور در فوتر و سایت */
[data-theme="dark"] .elementor-widget,
[data-theme="dark"] .elementor-column,
[data-theme="dark"] .elementor-section,
[data-theme="dark"] .elementor-container {
    filter: none !important;
    transform: none !important;
}

/* 7. حل مشکل دکمه‌ها در فوتر و سایت */
[data-theme="dark"] button:not(#ns-ultimate-toggle-btn),
[data-theme="dark"] .elementor-button,
[data-theme="dark"] .wpforo-button,
[data-theme="dark"] .button,
[data-theme="dark"] .btn {
    filter: none !important;
}

/* 8. حل مشکل ویجت‌های المنتور */
[data-theme="dark"] .elementor-widget-container,
[data-theme="dark"] .elementor-widget-wrap {
    filter: none !important;
    transform: none !important;
}

/* 9. حل مشکل کشیدگی و نمایش بد در المنتور */
[data-theme="dark"] .elementor-element {
    transform: none !important;
    filter: none !important;
}

[data-theme="dark"] .elementor-section-wrap,
[data-theme="dark"] .elementor-row {
    transform: none !important;
}

/* 10. حل مشکل برای کل wpForo */
[data-theme="dark"] .wpforo-wrap * {
    filter: none !important;
}

[data-theme="dark"] .wpforo-content *,
[data-theme="dark"] .wpforo-forum *,
[data-theme="dark"] .wpforo-topic *,
[data-theme="dark"] .wpforo-post * {
    filter: none !important;
}

/* 11. حل مشکل منوهای چسبنده در انجمن */
[data-theme="dark"] .wpforo-header,
[data-theme="dark"] .wpforo-navigation {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

/* 12. حل مشکل فوتر المنتور */
[data-theme="dark"] .elementor-location-footer,
[data-theme="dark"] footer.elementor-section {
    filter: none !important;
}

[data-theme="dark"] .elementor-location-footer * {
    filter: none !important;
}

/* 13. حل مشکل باکس‌ها و کارت‌ها */
[data-theme="dark"] .elementor-element-populated,
[data-theme="dark"] .wpforo-post {
    filter: none !important;
    transform: none !important;
}

/* 14. حل مشکل آیکون‌ها */
[data-theme="dark"] .elementor-icon,
[data-theme="dark"] .wpforo-icon,
[data-theme="dark"] .fas,
[data-theme="dark"] .far,
[data-theme="dark"] .fab {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* 15. انیمیشن ملایم */
html, body {
    transition: filter 0.4s ease !important;
}

/* 16. حل مشکل اسکرول و overflow */
[data-theme="dark"] body {
    overflow-x: hidden !important;
}

/* 17. حل مشکل برای فرم‌ها و inputها */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    filter: none !important;
    background: white !important;
    color: black !important;
}

/* 18. حل مشکل برای لینک‌ها */
[data-theme="dark"] a {
    filter: none !important;
}

/* 19. حل مشکل برای متن‌ها */
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    filter: none !important;
}

/* 20. حل نهایی برای المان‌های خاص که رنگ نمی‌گیرند */
[data-theme="dark"] .elementor-element *,
[data-theme="dark"] .wpforo-wrap *,
[data-theme="dark"] .elementor-widget *,
[data-theme="dark"] .elementor-section * {
    filter: none !important;
}