/** * Desktop Mode — AI Assistant spotlight overlay. * * A system-level command palette that floats above the entire shell, * including the WP admin bar. Visually modeled on macOS Spotlight and * Linear's command menu — frosted-glass backdrop, spring-physics panel * entrance, large search input, accent-tinted header. * * z-index 10000 puts this above --desktop-mode-z-adminbar (9991) so the * overlay truly covers the full viewport. The panel itself is white/light * regardless of wallpaper, providing consistent contrast. * * @since 0.14.0 */ /* --------------------------------------------------------------------------- * Root overlay — full viewport, fades in/out * ------------------------------------------------------------------------- */ .desktop-mode-ai { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-start; justify-content: center; /* Land the panel at ~16-18% from the top — feels like Spotlight. clamp keeps it 60px from the top on very short screens and caps at 180px on tall displays so it never feels too low. */ padding-top: clamp( 60px, 16vh, 180px ); padding-inline: 16px; padding-bottom: 40px; opacity: 0; pointer-events: none; transition: opacity 0.18s ease; } /* [hidden] keeps the element out of the a11y tree between sessions. Only removed while the overlay is visually visible (open or animating). */ .desktop-mode-ai[hidden] { display: none; } .desktop-mode-ai.is-open { opacity: 1; pointer-events: auto; } /* --------------------------------------------------------------------------- * Backdrop — frosted glass * ------------------------------------------------------------------------- */ .desktop-mode-ai__backdrop { position: absolute; inset: 0; background: rgba( 0, 0, 0, 0.36 ); backdrop-filter: blur( 8px ) saturate( 0.75 ); -webkit-backdrop-filter: blur( 8px ) saturate( 0.75 ); /* Backdrop is intentionally non-interactive — the overlay stays open until the user explicitly clicks the × close button. */ pointer-events: none; } /* --------------------------------------------------------------------------- * Panel — the visible card * ------------------------------------------------------------------------- */ .desktop-mode-ai__panel { position: relative; /* sits above the backdrop */ width: 100%; max-width: 600px; background: rgba( 255, 255, 255, 0.97 ); border-radius: 16px; overflow: hidden; /* Tight under-shadow + wide atmospheric shadow */ box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.07 ), 0 4px 16px rgba( 0, 0, 0, 0.12 ), 0 24px 64px rgba( 0, 0, 0, 0.22 ); /* Spring-physics entrance: starts slightly small + shifted up, overshoots minimally, then settles at 1.0. */ transform: scale( 0.96 ) translateY( -8px ); transition: transform 0.28s cubic-bezier( 0.34, 1.56, 0.64, 1 ); will-change: transform; } .desktop-mode-ai.is-open .desktop-mode-ai__panel { transform: scale( 1 ) translateY( 0 ); } /* --------------------------------------------------------------------------- * Header — accent-tinted identity strip * ------------------------------------------------------------------------- */ .desktop-mode-ai__header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; /* Gradient fades from a very faint accent tint to white — visible on fresh/blue schemes, subtle on light schemes. */ background: linear-gradient( to bottom, color-mix( in srgb, var( --wp-admin-theme-color, #2271b1 ) 8%, #fff ), #fff ); border-bottom: 1px solid rgba( 0, 0, 0, 0.06 ); } .desktop-mode-ai__header-icon { display: flex; align-items: center; color: var( --wp-admin-theme-color, #2271b1 ); /* Glow so the sparkle feels alive on dark or saturated themes */ filter: drop-shadow( 0 0 5px color-mix( in srgb, var( --wp-admin-theme-color, #2271b1 ) 55%, transparent ) ); } .desktop-mode-ai__header-label { flex: 1; font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var( --wp-admin-theme-color, #2271b1 ); } /* .desktop-mode-ai__close styles moved to the bottom results section */ /* --------------------------------------------------------------------------- * Input row — the main interaction surface * ------------------------------------------------------------------------- */ .desktop-mode-ai__input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; /* Thin highlight at the bottom of the input area, visible when focused */ border-bottom: 1px solid transparent; transition: border-color 0.15s ease; } .desktop-mode-ai__input-wrap:has( .desktop-mode-ai__input:focus ) { border-bottom-color: rgba( 0, 0, 0, 0.06 ); } /* Input-row sparkle — visible always, tints toward the accent on focus so the panel reads as "AI assistant" rather than "search box". */ .desktop-mode-ai__input-icon { flex-shrink: 0; display: flex; align-items: center; color: var( --wp-admin-theme-color, #2271b1 ); opacity: 0.55; transition: opacity 0.18s ease, transform 0.18s ease; } .desktop-mode-ai__input-wrap:has( .desktop-mode-ai__input:focus ) .desktop-mode-ai__input-icon { opacity: 1; transform: scale( 1.08 ); } .desktop-mode-ai__input { flex: 1; min-width: 0; appearance: none; border: none; outline: none; background: transparent; font: inherit; font-size: 17px; font-weight: 400; line-height: 1.4; color: #1d2327; } .desktop-mode-ai__input::placeholder { color: #c3c4c7; font-weight: 400; } /* Submit button — hidden until the user types something, then springs in via opacity + scale transition. */ .desktop-mode-ai__submit { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; border-radius: 8px; background: var( --wp-admin-theme-color, #2271b1 ); color: #fff; cursor: pointer; padding: 0; opacity: 0; transform: scale( 0.7 ); pointer-events: none; transition: opacity 0.2s ease, transform 0.2s cubic-bezier( 0.34, 1.56, 0.64, 1 ); } .desktop-mode-ai__submit.has-value { opacity: 1; transform: scale( 1 ); pointer-events: auto; } .desktop-mode-ai__submit:hover { filter: brightness( 1.1 ); } .desktop-mode-ai__submit:active { transform: scale( 0.92 ); } .desktop-mode-ai__submit:focus-visible { outline: 2px solid var( --wp-admin-theme-color, #2271b1 ); outline-offset: 2px; } /* --------------------------------------------------------------------------- * Footer — hints and keyboard shortcut legend * ------------------------------------------------------------------------- */ .desktop-mode-ai__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px 10px; background: rgba( 0, 0, 0, 0.018 ); border-top: 1px solid rgba( 0, 0, 0, 0.05 ); } .desktop-mode-ai__footer-hint { font-size: 11px; color: #a7aaad; } .desktop-mode-ai__footer-keys { display: flex; align-items: center; gap: 2px; font-size: 11px; color: #b4b9be; white-space: nowrap; flex-shrink: 0; } .desktop-mode-ai__footer-keys kbd { font-family: inherit; font-size: 10px; padding: 1px 5px; border: 1px solid rgba( 0, 0, 0, 0.1 ); border-radius: 4px; background: rgba( 0, 0, 0, 0.03 ); color: #646970; } /* --------------------------------------------------------------------------- * Admin bar AI button — ⌘K badge + sparkle icon * Styles applied via wp_add_inline_style( 'admin-bar', ... ) in PHP. * The styles here are for reference; the actual output lives in * includes/admin-bar.php :: desktop_mode_enqueue_toggle_assets(). * ------------------------------------------------------------------------- */ /* (The admin-bar button styles are added inline in PHP to keep them on the admin-bar handle so they load even before desktop-mode.js.) */ /* --------------------------------------------------------------------------- * Close button — × icon, top-right of header * ------------------------------------------------------------------------- */ .desktop-mode-ai__close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; appearance: none; background: rgba( 0, 0, 0, 0.05 ); border: 1px solid rgba( 0, 0, 0, 0.1 ); border-radius: 6px; cursor: pointer; color: #646970; padding: 0; flex-shrink: 0; transition: background 0.1s, color 0.1s, border-color 0.1s; } .desktop-mode-ai__close:hover { background: rgba( 0, 0, 0, 0.09 ); border-color: rgba( 0, 0, 0, 0.2 ); color: #1d2327; } .desktop-mode-ai__close:focus-visible { outline: 2px solid var( --wp-admin-theme-color, #2271b1 ); outline-offset: 2px; } /* --------------------------------------------------------------------------- * Results / conversation area — three render modes: * • Suggestions (empty state, example prompts) * • Thinking (spinner + "Thinking…") * • Response (assistant bubble + entity card | admin links | nothing) * ------------------------------------------------------------------------- */ .desktop-mode-ai__results { border-top: 1px solid rgba( 0, 0, 0, 0.06 ); max-height: 420px; overflow-y: auto; overflow-x: hidden; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; } /* ----------------------------------------------------------------- * Suggestion chips (empty state) * ---------------------------------------------------------------- */ .desktop-mode-ai__suggestions-label { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #8c8f94; } .desktop-mode-ai__suggestions-list { display: flex; flex-wrap: wrap; gap: 6px; } .desktop-mode-ai__suggestion { appearance: none; border: 1px solid rgba( 0, 0, 0, 0.1 ); background: rgba( 0, 0, 0, 0.02 ); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; color: #50575e; cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s; } .desktop-mode-ai__suggestion:hover { background: color-mix( in srgb, var( --wp-admin-theme-color, #2271b1 ) 8%, #fff ); border-color: color-mix( in srgb, var( --wp-admin-theme-color, #2271b1 ) 30%, rgba( 0, 0, 0, 0.1 ) ); color: var( --wp-admin-theme-color, #2271b1 ); } /* ----------------------------------------------------------------- * Thinking / error state * ---------------------------------------------------------------- */ .desktop-mode-ai__state { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #646970; } .desktop-mode-ai__state--error { color: #d63638; align-items: flex-start; } @keyframes desktop-mode-spin { to { transform: rotate( 360deg ); } } .desktop-mode-ai__spinner-icon { animation: desktop-mode-spin 0.9s linear infinite; flex-shrink: 0; color: var( --wp-admin-theme-color, #2271b1 ); } /* ----------------------------------------------------------------- * Assistant message bubble — prefix for every response * ---------------------------------------------------------------- */ .desktop-mode-ai__bubble { display: flex; align-items: flex-start; gap: 10px; } .desktop-mode-ai__bubble-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix( in srgb, var( --wp-admin-theme-color, #2271b1 ) 12%, #fff ); color: var( --wp-admin-theme-color, #2271b1 ); } .desktop-mode-ai__bubble-text { padding-top: 3px; font-size: 13px; line-height: 1.5; color: #1d2327; flex: 1; min-width: 0; } /* Markdown output inside the assistant bubble — the renderer emits
,