/* =========================================================
   1. ELEMENTOR ISOLATION & RESET
========================================================= */
.elementor-widget-shortcode, 
.elementor-shortcode { width: 100% !important; display: block !important; overflow: visible !important; }
#mgfp-container.mgfp-isolation-mode { width: 100% !important; max-width: 740px !important; margin: 20px auto 80px auto !important; font-family: source-serif-pro, Georgia, Cambria, "Times New Roman", Times, serif; position: relative; box-sizing: border-box; background: transparent !important; }
.codex-editor__redactor > div:not(.ce-block) { display: none !important; }
.mgfp-hidden { display: none !important; }

/* =========================================================
   2. TOP HEADER, WORD COUNT & PUBLISH BUTTON
========================================================= */
.mgfp-isolation-mode .mgfp-header { display: flex !important; justify-content: space-between !important; align-items: center !important; margin-bottom: 40px !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; }
.mgfp-isolation-mode .mgfp-header-left, .mgfp-isolation-mode .mgfp-header-right { display: flex; align-items: center; gap: 15px; }
.mgfp-isolation-mode #mgfp-word-count { color: #a8a8a8 !important; font-size: 14px !important; font-weight: 500; }
.mgfp-isolation-mode #mgfp-status { color: #757575 !important; font-size: 14px !important; }
.mgfp-isolation-mode #mgfp-publish-btn { all: unset !important; background-color: #1a8917 !important; color: white !important; border-radius: 20px !important; padding: 6px 16px !important; font-size: 14px !important; cursor: pointer !important; display: inline-block !important; text-align: center !important; transition: background-color 0.2s !important; }
.mgfp-isolation-mode #mgfp-publish-btn:hover { background-color: #156d12 !important; }

/* =========================================================
   3. THE 3-DOTS DROPDOWN MENU & INLINE POPOVERS
========================================================= */
.mgfp-dropdown-wrapper { position: relative; display: inline-block; }
.mgfp-isolation-mode #mgfp-more-btn { all: unset !important; font-size: 22px !important; color: #757575 !important; cursor: pointer !important; padding: 0 5px !important; line-height: 1 !important; font-weight: bold; }
.mgfp-isolation-mode #mgfp-more-btn:hover { color: #111 !important; }
.mgfp-dropdown-menu { display: none; position: absolute; right: -10px; top: 35px; background: #fff; border: 1px solid #f2f2f2; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-radius: 4px; width: 240px; z-index: 10000; }
.mgfp-dropdown-menu.show { display: block; }
.mgfp-dropdown-menu::before { content: ''; position: absolute; top: -6px; right: 14px; width: 10px; height: 10px; background: #fff; border-top: 1px solid #f2f2f2; border-left: 1px solid #f2f2f2; transform: rotate(45deg); }
.mgfp-dropdown-menu ul { list-style: none !important; padding: 10px 0 !important; margin: 0 !important; }
.mgfp-dropdown-menu li a { display: block !important; padding: 8px 20px !important; color: #b3b3b3 !important; text-decoration: none !important; font-size: 14px !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; transition: color 0.1s; }
.mgfp-dropdown-menu li a:hover { color: #242424 !important; }
.mgfp-dropdown-menu .mgfp-divider { border-bottom: 1px solid #f2f2f2 !important; margin: 8px 0 !important; }
#mgfp-topics-popover, #mgfp-category-popover, #mgfp-feat-img-popover { display: none; z-index: 10000; }
#mgfp-topics-popover.show, #mgfp-category-popover.show, #mgfp-feat-img-popover.show { display: block; }

/* 🚀 FIX: Auto-Suggest Styles updated to prevent text highlighting on click */
.mgfp-autocomplete-list { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #e0e0e0; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10005; max-height: 150px; overflow-y: auto; }
.mgfp-tag-suggestion { padding: 8px 12px; font-size: 13px; color: #333; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid #f5f5f5; user-select: none; }
.mgfp-tag-suggestion:hover { background: #f0f0f0; color: #1a8917; }

/* =========================================================
   4. TITLE INPUT & EDITOR.JS BASE OVERRIDES
========================================================= */
.mgfp-isolation-mode input#mgfp-title { all: unset !important; display: block !important; width: 100% !important; font-size: 42px !important; font-weight: 700 !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; color: #111 !important; padding: 0 0 15px 0 !important; margin-bottom: 10px !important; line-height: 1.2 !important; border-bottom: 1px solid transparent !important; }
.mgfp-isolation-mode input#mgfp-title::placeholder { color: #b3b3b3 !important; opacity: 1 !important; }
#editorjs { min-height: 400px !important; margin-top: 20px !important; cursor: text; }
.ce-block__content, .ce-toolbar__content { max-width: 100% !important; }
.ce-paragraph { font-size: 21px !important; line-height: 1.58 !important; color: #242424 !important; margin-bottom: 24px !important; }
.ce-header { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; color: #111 !important; }
h1.ce-header { font-size: 42px !important; margin-top: 45px !important; font-weight: 800 !important; }
h2.ce-header { font-size: 34px !important; margin-top: 40px !important; }
h3.ce-header { font-size: 26px !important; margin-top: 30px !important; }
h4.ce-header { font-size: 22px !important; margin-top: 25px !important; font-weight: 600 !important; }

#editorjs { font-size: 16px !important; color: #111 !important; }
.cdx-input { color: #111 !important; font-size: 16px !important; }
.link-tool__input { color: #111 !important; background-color: transparent !important; border: none !important; border-bottom: 1px solid #ccc !important; border-radius: 0 !important; box-shadow: none !important; }
.link-tool__input:focus { border-bottom-color: #111 !important; outline: none !important; }

/* =========================================================
   5. DARK THEME: INLINE TOOLBAR (Medium Style)
========================================================= */
.ce-inline-toolbar { background-color: #242424 !important; border: 1px solid #242424 !important; border-radius: 8px !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important; z-index: 10000 !important; animation: toolbarFadeIn 0.2s ease-out forwards; }
@keyframes toolbarFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.ce-inline-tool { color: #fff !important; transition: background-color 0.15s ease, color 0.15s ease !important; }
.ce-inline-tool:hover { background-color: #383838 !important; color: #fff !important; }
.ce-inline-tool--active { color: #1a8917 !important; }
.ce-inline-toolbar__dropdown { color: #fff !important; border-right: 1px solid #444 !important; transition: background-color 0.15s ease !important; }
.ce-inline-toolbar__dropdown:hover { background-color: #383838 !important; border-radius: 5px 0 0 5px !important; }
.ce-inline-toolbar__dropdown-arrow { fill: #fff !important; }
.ce-inline-toolbar__actions-wrapper { background-color: #242424 !important; border-top: 1px solid #444 !important; }
.ce-inline-tool-input { background-color: #242424 !important; color: #fff !important; }
.ce-inline-tool-input::placeholder { color: #aaa !important; }
.ce-inline-tool svg, .ce-inline-toolbar__dropdown svg { fill: currentColor !important; }

/* =========================================================
   6. DARK THEME: BLOCK MENUS & ICONS (Notion Style)
========================================================= */
.ce-popover, .ce-popover__container { background-color: #242424 !important; border: 1px solid #333 !important; color: #fff !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important; border-radius: 8px !important; z-index: 10001 !important; }
.ce-popover-item:hover { background-color: #383838 !important; color: #fff !important; }
.cdx-search-field, .ce-popover__search { background-color: #242424 !important; border-bottom: 1px solid #444 !important; }
.cdx-search-field__input, .ce-popover__search-input, .ce-popover__search input { background-color: transparent !important; color: #ffffff !important; }
.cdx-search-field__input::placeholder, .ce-popover__search-input::placeholder { color: #888888 !important; }
.cdx-search-field__icon svg { fill: #888888 !important; }
.ce-popover-item__icon { background-color: transparent !important; box-shadow: none !important; width: 32px !important; height: 32px !important; color: #fff !important; }
.ce-popover-item__icon svg { width: 22px !important; height: 22px !important; fill: #ffffff !important; }
.cdx-block-icon, .ce-popover-item__icon svg, .ce-popover-item__icon i { filter: brightness(0) invert(1) !important; }
.ce-popover-item__icon b { color: #fff !important; font-weight: 600 !important; }
.ce-popover-item__title { font-size: 15px !important; font-weight: 500 !important; color: #fff !important; }
.ce-toolbar__plus, .ce-toolbar__settings-btn { background-color: transparent !important; color: #aaa !important; border: none !important; box-shadow: none !important; border-radius: 4px !important; transition: color 0.2s, background-color 0.2s !important; }
.ce-toolbar__plus:hover, .ce-toolbar__settings-btn:hover { color: #111 !important; background-color: #f0f0f0 !important; }
.ce-toolbar__settings-btn--hidden { display: inline-flex !important; opacity: 0.4 !important; }
.ce-settings { background-color: #242424 !important; border: 1px solid #333 !important; box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important; border-radius: 8px !important; color: #fff !important; }
.ce-settings__button { color: #fff !important; transition: background-color 0.15s ease !important; }
.ce-settings__button:hover { background-color: #383838 !important; color: #fff !important; }

/* =========================================================
   7. CATEGORY INJECTIONS & HIDING NATIVE TOOLS
========================================================= */
.ce-popover__items { max-height: 450px !important; overflow-y: auto !important; }
.ce-popover-item[data-item-name="paragraph"], .ce-popover-item[data-item-name="raw"], .ce-popover-item[data-item-name="image"] { display: none !important; }
.ce-popover-item[data-item-name="dummyText"] { position: relative; margin-top: 35px !important; }
.ce-popover-item[data-item-name="dummyText"]::before { content: "BASIC BLOCKS"; position: absolute; top: -30px; left: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #888; pointer-events: none; }
.ce-popover-item[data-item-name="dummyImage"] { position: relative; margin-top: 45px !important; }
.ce-popover-item[data-item-name="dummyImage"]::before { content: "MEDIA"; position: absolute; top: -30px; left: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #888; pointer-events: none; }
.ce-popover-item[data-item-name="dummyImage"]::after { content: ""; position: absolute; top: -40px; left: 0; width: 100%; height: 1px; background-color: #444; }

/* =========================================================
   8. GENERAL MODALS (Uploads & Searches)
========================================================= */
.mgfp-modal-overlay { position: fixed !important; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8) !important; backdrop-filter: blur(2px) !important; z-index: 100000 !important; display: flex; align-items: center; justify-content: center; }
.mgfp-modal-dialog { background: #fff !important; width: 100% !important; max-width: 500px !important; border: 1px solid #e0e0e0 !important; border-radius: 6px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important; overflow: hidden !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; }
.mgfp-modal-tabs { display: flex !important; border-bottom: 1px solid #f0f0f0 !important; padding: 0 15px !important; background: #fff !important; }
.mgfp-tab { background: none !important; border: none !important; padding: 16px 15px !important; cursor: pointer !important; font-size: 14px !important; color: #888 !important; border-bottom: 2px solid transparent !important; transition: color 0.2s ease !important; }
.mgfp-tab.active { color: #111 !important; border-bottom-color: #111 !important; font-weight: 500 !important; }
.mgfp-tab.disabled { cursor: not-allowed !important; opacity: 0.5 !important; }
.mgfp-tab-content { padding: 20px !important; background: #fff !important; }
.mgfp-wide-btn { width: 100% !important; padding: 12px !important; background: #fff !important; border: 1px solid #e0e0e0 !important; border-radius: 4px !important; cursor: pointer !important; font-size: 14px !important; color: #333 !important; font-weight: 500 !important; transition: background 0.15s !important; }
.mgfp-wide-btn:hover { background: #f7f7f7 !important; }
.mgfp-wide-input { width: 100% !important; padding: 12px 15px !important; border: 1px solid #e0e0e0 !important; border-radius: 4px !important; font-size: 14px !important; color: #333 !important; box-sizing: border-box !important; outline: none !important; }
.mgfp-wide-input:focus { border-color: #ccc !important; }
.mgfp-post-item { padding: 10px; border-bottom: 1px solid #eee; cursor: pointer; transition: background 0.15s; }
.mgfp-post-item:hover { background-color: #f5f5f5; }

/* =========================================================
   9. FEATURED IMAGE GRID THUMBNAILS
========================================================= */
#mgfp-fi-grid { padding: 4px !important; }
.mgfp-fi-thumb { width: 64px !important; height: 64px !important; object-fit: cover !important; border-radius: 6px !important; cursor: pointer !important; transition: all 0.2s ease !important; border: 3px solid transparent !important; display: block !important; box-sizing: border-box !important; margin: 0 !important; padding: 0 !important; }
.mgfp-fi-thumb:hover { transform: scale(1.05); border-color: #ccc !important; }
.mgfp-fi-thumb.selected { border-color: #1a8917 !important; transform: scale(1.08); box-shadow: 0 4px 10px rgba(26, 137, 23, 0.3) !important; }

/* =========================================================
   10. REVISIONS SYSTEM (Sidebar & Header)
========================================================= */
.mgfp-revision-header { display: flex; justify-content: center; align-items: center; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px 20px; margin-bottom: 40px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; gap: 15px; }
.mgfp-rev-text { color: #444; font-size: 14px; font-weight: 500; }
.mgfp-revision-header button { background: transparent; border: none; cursor: pointer; font-size: 14px; font-weight: 600; padding: 5px 10px; border-radius: 4px; transition: background 0.2s; }
#mgfp-rev-cancel { color: #757575; }
#mgfp-rev-cancel:hover { background: #f5f5f5; color: #111; }
#mgfp-rev-restore { color: #1a8917; }
#mgfp-rev-restore:hover { background: rgba(26, 137, 23, 0.1); }
.mgfp-sidebar-panel { position: fixed; top: 0; right: -400px; width: 350px; max-width: 100vw; height: 100vh; background: #fff; z-index: 100000; box-shadow: -4px 0 24px rgba(0,0,0,0.1); transition: right 0.3s ease-in-out; display: flex; flex-direction: column; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.mgfp-sidebar-panel.mgfp-sidebar-open { right: 0; }
.mgfp-sidebar-header { padding: 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.mgfp-sidebar-content { flex: 1; overflow-y: auto; padding: 10px 0; }
.mgfp-close-sidebar { background: none; border: none; font-size: 24px; cursor: pointer; color: #888; transition: color 0.2s; }
.mgfp-close-sidebar:hover { color: #111; }
.mgfp-rev-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #f9f9f9; cursor: pointer; transition: background 0.2s; }
.mgfp-rev-item:hover { background: #fcfcfc; }
.mgfp-rev-item-title { font-size: 14px; color: #111; font-weight: 500; line-height: 1.4; }
.mgfp-rev-item-date { font-size: 13px; color: #888; }

/* =========================================================
   11. PROFESSIONAL UI INTERACTIONS (Top Nav Tools)
========================================================= */
#mgfp-publish-btn, #mgfp-more-btn { cursor: pointer !important; }
.mgfp-isolation-mode #mgfp-publish-btn { transition: background-color 0.15s ease, transform 0.1s ease !important; }
.mgfp-isolation-mode #mgfp-publish-btn:hover { background-color: #156d12 !important; }
.mgfp-isolation-mode #mgfp-publish-btn:active { background-color: #105a0d !important; transform: scale(0.97) !important; }
.mgfp-isolation-mode #mgfp-more-btn { transition: color 0.15s ease !important; }
.mgfp-isolation-mode #mgfp-more-btn:hover { color: #111111 !important; }
.mgfp-dropdown-wrapper .mgfp-dropdown-menu.show ~ #mgfp-more-btn { color: #1a8917 !important; }

/* =========================================================
   12. CUSTOM FLOATING IMAGE TOOLBAR
========================================================= */
#mgfp-image-toolbar { position: absolute; display: none; background: #242424; border: 1px solid #333; border-radius: 6px; padding: 4px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); z-index: 10000; align-items: center; gap: 4px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#mgfp-image-toolbar.show { display: flex; animation: toolbarFadeIn 0.2s ease-out forwards; }
#mgfp-image-toolbar button { background: transparent; border: none; color: #fff; cursor: pointer; width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
#mgfp-image-toolbar button:hover, #mgfp-image-toolbar button.active { background: #383838; color: #1a8917; }
#mgfp-image-toolbar button.active svg { fill: #1a8917 !important; }
.mgfp-toolbar-divider { width: 1px; height: 20px; background: #444; margin: 0 4px; }
#mgfp-image-toolbar button svg { fill: currentColor; width: 18px; height: 18px; transition: fill 0.2s; }

.mgfp-align-left .image-tool__image { margin-left: 0 !important; margin-right: auto !important; max-width: 60% !important; }
.mgfp-align-center .image-tool__image { margin-left: auto !important; margin-right: auto !important; max-width: 100% !important; }
.mgfp-align-full .image-tool__image { width: 100vw !important; max-width: 100vw !important; position: relative !important; left: 50% !important; right: 50% !important; margin-left: -50vw !important; margin-right: -50vw !important; }

/* =========================================================
   13. 🚀 RICH LINK CARDS (Frontend Output)
========================================================= */
.mgfp-link-card { display: flex; border: 1px solid #e0e0e0; border-radius: 4px; text-decoration: none; color: inherit; overflow: hidden; margin-bottom: 24px; transition: box-shadow 0.2s; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.mgfp-link-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.mgfp-link-card-content { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.mgfp-link-card-title { font-weight: 600; font-size: 17px; margin-bottom: 8px; color: #111; line-height: 1.3; }
.mgfp-link-card-desc { font-size: 14px; color: #555; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.mgfp-link-card-anchor { font-size: 13px; color: #888; }
.mgfp-link-card-image { width: 200px; background-size: cover; background-position: center; border-left: 1px solid #e0e0e0; }

@media (max-width: 600px) {
    .mgfp-link-card { flex-direction: column-reverse; }
    .mgfp-link-card-image { width: 100%; height: 150px; border-left: none; border-bottom: 1px solid #e0e0e0; }
}