/* =====================================================
   Globals & Layout
===================================================== */
html,
body {
  overflow-x: hidden;
}

body {
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
  margin: 0;
  background: var(--bg-dark);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  font-size: 14px !important;
}

/* Scroll lock when sidebar open */
body.sidebar-open {
  overflow: hidden;
}

/* =====================================================
   Global Bar
===================================================== */
.qlus-global-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.qlus-global-bar .qlus-btn {
  margin-top: 0;
  margin-bottom: 0;
  border: none;
  box-shadow: none;
}

/* =====================================================
   Global Bar - Mobile
===================================================== */
@media (max-width: 992px) {
  .qlus-global-bar-wrapper {
    position: relative;
    background: var(--bg-light);
    height: auto;
  }

  .qlus-global-bar {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding: 0px;
    gap: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
    margin-left: 5px;
  }

  .qlus-global-bar .qlus-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .qlus-global-bar::-webkit-scrollbar {
    display: none;
  }

  .qlus-global-bar-wrapper::before,
  .qlus-global-bar-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 24px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
  }

  .qlus-global-bar-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-light), transparent);
  }

  .qlus-global-bar-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-light), transparent);
  }
}

/* =====================================================
   Buttons - Clean Base System
===================================================== */

/* BASE BUTTON */
.qlus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1-5);
  line-height: 1.2;
  vertical-align: middle;
  padding: var(--space-2) calc(var(--space-2) * 2 + 2px);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-1);
  cursor: pointer;
  text-decoration: none;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.qlus-btn:focus,
.qlus-btn:active {
  outline: none !important;
  box-shadow: none !important;
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

.qlus-btn:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px;
}

.qlus-btn:hover {
  background: var(--bg-light);
  border-color: var(--border-muted);
  color: var(--text);
}

.qlus-btn.ai-loading {
  background: linear-gradient(90deg, var(--primary) 0%, var(--info) 50%, var(--primary) 100%) !important;
  background-size: 200% 100% !important;
  animation: qlus-shimmer 1.5s infinite linear !important;
  color: #fff !important;
  cursor: wait !important;
  border-color: var(--primary) !important;
  pointer-events: none;
}

@keyframes qlus-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Disabled */
.qlus-btn.disabled,
.qlus-btn.disabled:hover,
.qlus-btn.disabled:focus,
.qlus-btn.disabled:active {
  opacity: 0.4 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}

/* BUTTON VARIANTS */
.qlus-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.qlus-btn.primary:hover,
.qlus-btn.primary:focus,
.qlus-btn.primary:active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.qlus-btn.secondary {
  background: var(--bg);
  border-color: var(--text);
  color: var(--text);
}

.qlus-btn.secondary:hover,
.qlus-btn.secondary:focus,
.qlus-btn.secondary:active {
  background: var(--bg-light);
  border-color: var(--text);
  color: var(--text);
}

.qlus-btn.header {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  padding: var(--space-1) var(--space-2);
}

.qlus-btn.header:hover {
  color: var(--text-muted);
}

.qlus-btn.tab {
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: var(--space-2) calc(var(--space-2) + 4px);
  border-radius: var(--radius-2);
  font-size: 14px;
}

.qlus-btn.tab:hover {
  background: var(--bg-light);
  border-color: var(--border-muted);
  color: var(--text);
}

.qlus-btn.tab.active {
  background: var(--highlight) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.qlus-btn.tab.active svg {
  stroke: var(--primary) !important;
}

/* Sidebar toggle */
.qlus-btn.sidebar-toggle {
  background: none;
  border: none;
  padding: 4px 4px;
  font-size: 36px;
  line-height: 1;
  color: var(--text-muted);
}

.qlus-btn.sidebar-toggle:hover {
  color: var(--primary);
}

/* ICONS */
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  /* prevents baseline shifts */
}

.qlus-btn svg {
  display: block;
  /* prevents baseline gaps */
  fill: none;
  stroke-width: 2;
  width: var(--icon-2);
  height: var(--icon-2);
  stroke: currentColor;
}

.qlus-block svg {
  display: block;
  width: var(--icon-2);
  height: var(--icon-2);
}

/* SPECIAL BUTTONS */
.qlus-delete-offer {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
}

.qlus-delete-offer:hover {
  text-decoration: underline;
}

/* =====================================================
   SNIPPET FILTER BUTTONS (new blockType-based system)
===================================================== */

.qlus-snippet-filter {
  background: var(--bg-light);
  border-color: var(--border-muted);
  color: var(--text);
}

.qlus-snippet-filter:hover {
  background: var(--bg-light);
  border-color: var(--border-muted);
}

/* icon colors */
.qlus-snippet-filter[data-filter="block-lib-1"] svg {
  stroke: var(--block-lib-1-color);
}

.qlus-snippet-filter[data-filter="block-lib-2"] svg {
  stroke: var(--block-lib-2-color);
}

.qlus-snippet-filter[data-filter="block-lib-3"] svg {
  stroke: var(--block-lib-3-color);
}

.qlus-snippet-filter[data-filter="block-lib-4"] svg {
  stroke: var(--block-lib-4-color);
}

.qlus-snippet-filter[data-filter="all"] svg {
  stroke: var(--text-muted);
}

/* Active state */
.qlus-snippet-filter.active {
  color: #fff !important;
  border-color: transparent !important;
}

.qlus-snippet-filter[data-filter="block-lib-1"].active {
  background: var(--block-lib-1-color) !important;
}

.qlus-snippet-filter[data-filter="block-lib-2"].active {
  background: var(--block-lib-2-color) !important;
}

.qlus-snippet-filter[data-filter="block-lib-3"].active {
  background: var(--block-lib-3-color) !important;
}

.qlus-snippet-filter[data-filter="block-lib-4"].active {
  background: var(--block-lib-4-color) !important;
}

.qlus-snippet-filter[data-filter="all"].active {
  background: var(--block-lib-all-color) !important;
}

/* White icons when active (on colored bg) */
.qlus-snippet-filter.active svg {
  stroke: #fff !important;
}

/* Drag-over state */
.qlus-snippet-filter.drag-over {
  outline: 2px dashed var(--primary);
  cursor: copy;
}

/* Dragging */
body.qlus-dragging-to-filters .qlus-snippet-filter {
  cursor: copy;
}



/* =====================================================
   Status & Messages
===================================================== */
.qlus-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: var(--radius-2);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--bg-dark);
  /* fallback */
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  min-width: 200px;
}

.qlus-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.qlus-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qlus-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: none;
}

.qlus-toast.success {
  background: var(--success);
}

.qlus-toast.error {
  background: var(--danger);
}

.save-status-wrapper {
  display: inline-block;
  margin-left: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  background: var(--bg-dark);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.save-status-wrapper.saving,
.save-status-wrapper.success,
.save-status-wrapper.error {
  opacity: 1;
}

.save-status-wrapper.saving {
  background: var(--warning);
  color: var(--bg-dark);
}

.save-status-wrapper.success {
  background: var(--success);
  color: var(--bg-dark);
}

.save-status-wrapper.error {
  background: var(--danger);
  color: var(--bg-dark);
  font-weight: 600;
}

.save-status-wrapper.fade-out {
  opacity: 0;
}

/* =====================================================
   Date Block Dialog
===================================================== */
.qlus-date-dialog {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2);
  padding: 16px 20px;
  box-shadow: var(--shadow-xl);
  max-width: 320px;
  z-index: 2000;
  background: var(--bg-light);
}

html.dark .qlus-date-dialog {
  background: var(--bg-light) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.qlus-date-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

html.dark .qlus-date-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.qlus-date-dialog label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qlus-date-dialog select {
  padding: var(--space-1-5) var(--space-2);
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--bg);
  color: var(--text);
}

html.dark .qlus-date-dialog select {
  background: var(--bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.qlus-date-dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding: 0;
  margin-top: 20px;
}

/* =====================================================
   Floating Menus (Tutorials, etc)
===================================================== */
.qlus-floating-menu {
  position: absolute;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2);
  padding: 12px;
  z-index: 99999;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 320px;
}

html.dark .qlus-floating-menu {
  background: var(--bg-light) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg);
}

.qlus-floating-menu .qlus-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 16px;
  font-size: 14px;
}

.qlus-date-dialog button {
  padding: var(--space-1-5) calc(var(--space-2) * 2 + 2px);
  font-size: 14px;
  border-radius: var(--radius-2);
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}

.qlus-date-dialog button[value="ok"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.qlus-date-dialog button[value="cancel"] {
  background: var(--bg);
  color: var(--text);
}

html.dark .qlus-date-dialog button[value="cancel"] {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* =====================================================
   Misc
===================================================== */

.qlus-placeholder {
  background: var(--bg-dark);
  border-bottom: 1px dotted var(--text-muted);
  padding: 0 2px;
  cursor: text;
}

.qlus-placeholder:empty::before {
  color: var(--text-muted);
}

/* =====================================================
   DnD touch fixes
===================================================== */

body.qlus-dragging-to-filters .qlus-block-icon {
  pointer-events: none !important;
}


.qlus-global-bar {
  box-shadow: var(--shadow-sm);
  background: var(--bg-light);
}

#qlus-sidebar {
  box-shadow: var(--shadow-md);
}

#qlus-sidebar-mobile {
  box-shadow: var(--shadow-lg);
}

.qlus-ai-popup,
.qlus-ai-suggestions {
  box-shadow: var(--shadow-lg);
}

.qlus-dropdown,
.qlus-select-menu {
  box-shadow: var(--shadow-lg);
  background: var(--bg-light);
}

.qlus-modal {
  box-shadow: var(--shadow-lg);
}

.qlus-modal {
  box-shadow: var(--shadow-lg);
}

.qlus-block.dragging {
  box-shadow: var(--shadow-md);
}

.qlus-card {
  background: var(--bg-light);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}

.qlus-center-pane {
  box-shadow: var(--shadow-md);
}

.qlus-btn {
  box-shadow: var(--shadow-sm);
}

.qlus-block {
  box-shadow: var(--shadow-sm);
}

.blokso-sidebar,
.blokso-card {
  box-shadow: var(--shadow-sm);
  border-color: var(--border) !important;
}


.qlus-drag-handle {
  /* Drag handle always visible next to the colored border */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  /* slightly larger icon */
  line-height: 1;
  padding: 8px 8px;
  /* Bigger hit area */
  cursor: grab;
  user-select: none;
  opacity: 0.5;
  /* subtler opacity until hover */
  display: inline-flex;
  flex-shrink: 0;
  transition: opacity 0.2s, background-color 0.2s;
  border-radius: 4px;
  touch-action: none;
}

.qlus-drag-handle:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
  /* Visual feedback on hover */
}

.qlus-drag-handle:active {
  cursor: grabbing;
}


/* Hide all menu items */
.page-id-2675 .main-navigation .main-nav ul li {
  display: none !important;
}

/* Show ONLY logout by item ID */
.page-id-2675 #menu-item-1449 {
  display: inline-flex !important;
}

/* Hide mobile hamburger toggle */
.page-id-2675 .menu-toggle {
  display: none !important;
}

/* Keep only the logo and logout aligned */
.page-id-2675 #site-navigation .inside-navigation {
  justify-content: flex-end !important;
}


/* Optional: shrink header height for onboarding */
.page-id-2675 .site-header {
  padding-bottom: 10px;
  padding-top: 10px;
}

/* =====================================================
   Forms & Inputs (Promoted from blokso-account)
===================================================== */

.qlus-label {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
  display: block;
  color: var(--text);
}

.qlus-input,
.qlus-select,
.qlus-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2);
  font-size: 14px;
  box-sizing: border-box;
  background: var(--bg-light);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s;
}

html.dark .qlus-input,
html.dark .qlus-select,
html.dark .qlus-textarea,
html.dark select,
html.dark input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html.dark option {
  background-color: var(--bg-light) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.qlus-input:focus,
.qlus-select:focus,
.qlus-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.qlus-input::placeholder,
.qlus-textarea::placeholder {
  color: var(--text-muted);
}

/* =====================================================
   Onboarding Tiles & Flags
===================================================== */

/* Grid Layouts */
.qlus-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.qlus-flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

/* Base Tile (Professions) */
.qlus-tile {
  position: relative;
  cursor: pointer;
  user-select: none;
}

/* Hide actual checkbox/radio */
.qlus-tile input[type="checkbox"],
.qlus-tile input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.qlus-tile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2);
  padding: 12px 8px;
  height: 100%;
  transition: all 0.2s ease;
  min-height: 100px;
}

.qlus-tile-content img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: 8px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.qlus-tile-content span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

/* Hover State */
.qlus-tile:hover .qlus-tile-content {
  border-color: var(--border-muted);
  background: var(--bg);
}

.qlus-tile:hover .qlus-tile-content img {
  opacity: 1;
}

/* Checked State */
.qlus-tile input:checked+.qlus-tile-content {
  border-color: var(--primary);
  background: var(--bg-light);
  box-shadow: 0 0 0 1px var(--primary);
}

.qlus-tile input:checked+.qlus-tile-content img {
  opacity: 1;
  transform: scale(1.1);
}

.qlus-tile input:checked+.qlus-tile-content span {
  color: var(--primary);
  font-weight: 600;
}

/* Flag Tile (Languages) */
.qlus-flag-tile .qlus-tile-content {
  min-height: 80px;
  padding: 10px 4px;
}

.qlus-flag-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
  display: block;
}