/* =========================================================
   Portfolio Demo Overlay — Minimal Banner, Guided Tour &
   Simulated Destination Modal (light & dark mode aware)
   ========================================================= */

html {
  height: 100%;
  overflow: hidden;
}

body.wcm-demo-mode {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

body.wcm-demo-mode .app-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  width: 100%;
}

/* Top Minimal Portfolio Banner */
#wcm-demo-banner {
  width: 100%;
  flex-shrink: 0;
  background: #14161b;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  z-index: 9800;
  position: relative;
}

.wcm-demo-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wcm-demo-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wcm-demo-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.wcm-demo-back-link:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.wcm-demo-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcm-demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6a13;
  box-shadow: 0 0 0 3px rgba(255, 106, 19, 0.25);
  flex-shrink: 0;
}

.wcm-demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wcm-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.wcm-demo-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
}

.wcm-demo-btn-accent {
  background: #ff6a13;
  border-color: #ff6a13;
  color: #ffffff;
}

.wcm-demo-btn-accent:hover {
  background: #e65907;
  border-color: #e65907;
}

.wcm-demo-btn-icon {
  padding: 4px 7px;
}

.wcm-demo-count-chip {
  background: rgba(0, 0, 0, 0.22);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}

/* Collapsed Floating Re-open Pill */
#wcm-demo-collapsed-pill {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 9850;
  display: none;
  align-items: center;
  gap: 6px;
  background: #14161b;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  transition: transform 0.15s ease, background 0.15s ease;
}

#wcm-demo-collapsed-pill:hover {
  background: #1f242d;
  transform: translateY(-1px);
}

body.wcm-demo-collapsed #wcm-demo-banner {
  display: none;
}

body.wcm-demo-collapsed #wcm-demo-collapsed-pill {
  display: inline-flex;
}

/* Guided "Things to Try" Compact Draggable Always-On-Top Stepper Card */
#wcm-demo-guide-drawer {
  position: fixed;
  top: 50px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--surface, #ffffff);
  color: var(--text, #1c1c1e);
  border: 1px solid var(--border, #e5e5ea);
  border-radius: 14px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 106, 19, 0.14);
  z-index: 200000 !important;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#wcm-demo-guide-drawer.open {
  display: flex;
}

#wcm-demo-guide-drawer.is-dragging {
  user-select: none;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.34), 0 0 0 1.5px rgba(255, 106, 19, 0.45);
}

.wcm-guide-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e5e5ea);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--toolbar-bg, #f9f9fb);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#wcm-demo-guide-drawer.is-dragging .wcm-guide-header {
  cursor: grabbing;
}

.wcm-guide-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.wcm-guide-drag-grip {
  color: var(--text-light, #8e8e93);
  font-size: 13px;
  letter-spacing: -1px;
  line-height: 1;
  flex-shrink: 0;
}

.wcm-guide-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text, #1c1c1e);
  white-space: nowrap;
}

.wcm-guide-step-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 106, 19, 0.14);
  color: #ff6a13;
  white-space: nowrap;
}

.wcm-guide-close {
  background: none;
  border: none;
  color: var(--text-light, #8e8e93);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 6px;
}

.wcm-guide-close:hover {
  background: var(--btn-hover, #e8e8ed);
  color: var(--text, #1c1c1e);
}

.wcm-guide-body {
  padding: 13px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wcm-guide-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text, #1c1c1e);
  line-height: 1.3;
  margin: 0;
}

.wcm-guide-item-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-light, #64748b);
  margin: 0;
}

.wcm-guide-item-desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: var(--toolbar-bg, #f1f5f9);
  color: var(--accent, #ff6a13);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.wcm-guide-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.wcm-guide-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text, #1c1c1e);
  cursor: pointer;
  user-select: none;
}

.wcm-guide-done-toggle input[type="checkbox"] {
  accent-color: var(--accent, #ff6a13);
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
}

.wcm-guide-note-link {
  border: none;
  background: transparent;
  color: var(--accent, #ff6a13);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}

.wcm-guide-note-link:hover {
  text-decoration: underline;
}

.wcm-guide-footer {
  padding: 9px 12px;
  border-top: 1px solid var(--border, #e5e5ea);
  background: var(--toolbar-bg, #f9f9fb);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wcm-guide-nav-btn {
  border: 1px solid var(--border, #e5e5ea);
  background: var(--surface, #ffffff);
  color: var(--text, #1c1c1e);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.wcm-guide-nav-btn:hover:not(:disabled) {
  border-color: var(--accent, #ff6a13);
  color: var(--accent, #ff6a13);
}

.wcm-guide-nav-btn.primary {
  background: var(--accent, #ff6a13);
  border-color: var(--accent, #ff6a13);
  color: #ffffff;
}

.wcm-guide-nav-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover, #e65907);
  border-color: var(--accent-hover, #e65907);
  color: #ffffff;
}

.wcm-guide-nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.wcm-guide-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wcm-guide-dot-btn {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--border, #cbd5e1);
  cursor: pointer;
  transition: width 0.15s ease, background 0.15s ease;
}

.wcm-guide-dot-btn.done {
  background: #22c55e;
}

.wcm-guide-dot-btn.active {
  width: 18px;
  background: var(--accent, #ff6a13);
}

/* Simulated Destination Link Preview Modal */
#wcm-demo-link-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  z-index: 100500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#wcm-demo-link-modal-overlay.open {
  display: flex;
}

.wcm-link-modal {
  width: 460px;
  max-width: 100%;
  background: var(--surface, #ffffff);
  color: var(--text, #1c1c1e);
  border: 1px solid var(--border, #e5e5ea);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  animation: wcmLinkModalIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wcmLinkModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wcm-link-modal-head {
  padding: 16px 20px 12px;
  background: var(--toolbar-bg, #f9f9fb);
  border-bottom: 1px solid var(--border, #e5e5ea);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wcm-link-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 106, 19, 0.14);
  color: #ff6a13;
}

.wcm-link-modal-body {
  padding: 18px 20px;
}

.wcm-link-modal-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #1c1c1e);
}

.wcm-link-modal-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-light, #64748b);
  background: var(--toolbar-bg, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 7px 10px;
  word-break: break-all;
  margin-bottom: 12px;
}

.wcm-link-modal-summary {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text, #334155);
}

.wcm-link-modal-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-light, #64748b);
}

.wcm-link-modal-note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-light, #64748b);
  background: var(--toolbar-bg, #f8fafc);
  border-left: 3px solid var(--accent, #ff6a13);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
}

.wcm-link-modal-foot {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wcm-link-modal-close-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent, #ff6a13);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.wcm-link-modal-close-btn:hover {
  background: var(--accent-hover, #e65907);
}

/* Dark mode refinements */
body.dark-mode .wcm-guide-item-desc,
body.dark-mode .wcm-link-modal-summary {
  color: #cbd5e1;
}

/* =========================================================
   Bottom Floating Utility Stack (Info, Reminder, Santa Bag)
   - All 3 buttons & wrappers sit at z-index: 1500 (above .app-container: 1000)
   - Whichever panel is expanded elevates its wrapper to z-index: 2600 (above all 3 icons)
   - Frosted surface pill prevents scrolled note text from bleeding through icons
   - Safe-area bottom offset keeps icons above iOS home indicator
   ========================================================= */
.floating-info-btn {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1500 !important;
}

#globalAlarmContainer {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1500 !important;
}

#christmasSantaBagContainer {
  bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1500 !important;
}

#globalAlarmContainer:has(#globalAlarmMenu[style*="flex"]),
#christmasSantaBagContainer:has(#christmasSantaBagMenu[style*="flex"]) {
  z-index: 2600 !important;
}

.floating-info-btn,
#globalAlarmBtn:not(.has-completed),
#christmasSantaBagBtn {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08)) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

body.dark-mode .floating-info-btn,
body.dark-mode #globalAlarmBtn:not(.has-completed),
body.dark-mode #christmasSantaBagBtn {
  background: rgba(30, 30, 34, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
}

#globalAlarmMenu,
#christmasSantaBagMenu {
  z-index: 2600 !important;
}

/* Fix horizontal overflow in My Signature modal (Extension input flex min-width) */
#signatureModal .modal-body {
  overflow-x: hidden;
  box-sizing: border-box;
}

#sigPhoneSelect,
#sigExtInput {
  min-width: 0 !important;
  box-sizing: border-box !important;
  width: 0;
}

#sigPhoneSelect {
  flex: 2 1 140px !important;
}

#sigExtInput {
  flex: 1 1 90px !important;
}

@media (max-width: 640px) {
  .wcm-demo-pill-badge {
    display: none;
  }
  .wcm-demo-banner-inner {
    padding: 6px 10px;
  }
}
