/* Application styles, loaded after Vuexy's core.css. */

/* Brand colours (EntCMS logo / qbit.hr) instead of Vuexy's purple #7367f0
******************************************************************************
   primary #8100ce - the qbit purple (the logo's spine); on the dark theme a lighter #a64dff, as bright as Vuexy's own
   colour, so purple text and labels stay readable there. Subtle backgrounds, borders and button shades are mixed from
   --bs-primary, so one set of rules serves both themes. Charts read --bs-primary (js/config.js) and follow. Vuexy
   hard-codes the colour in a few component variables (buttons, links, progress) - those are repeated here. */
:root,
[data-bs-theme="light"] {
  --bs-primary: #8100ce;
  --bs-primary-rgb: 129, 0, 206;
  --bs-primary-bg-subtle: #ebd6f7;
  --bs-primary-border-subtle: #cc99eb;
  --bs-primary-text-emphasis: #340052;
  --bs-purple: #8100ce;
  --bs-link-color: #8100ce;
  --bs-link-color-rgb: 129, 0, 206;
  --bs-link-hover-color: #6e00af;
  --bs-link-hover-color-rgb: 110, 0, 175;
  --ent-brand-blue: #0079de;
}

[data-bs-theme="dark"] {
  --bs-primary: #a64dff;
  --bs-primary-rgb: 166, 77, 255;
  --bs-primary-bg-subtle: #45306f;
  --bs-primary-border-subtle: #5b3a8f;
  --bs-primary-text-emphasis: #cc99ff;
  --bs-purple: #a64dff;
  --bs-link-color: #b86bff;
  --bs-link-color-rgb: 184, 107, 255;
  --bs-link-hover-color: #cc99ff;
  --bs-link-hover-color-rgb: 204, 153, 255;
  --ent-brand-blue: #1e90ff;
}

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: color-mix(in sRGB, var(--bs-primary) 85%, #000);
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-bg: color-mix(in sRGB, var(--bs-primary) 76%, #000);
  --bs-btn-active-border-color: var(--bs-btn-active-bg);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-bg: var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
  --bs-btn-disabled-color: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

.progress,
.progress-stacked {
  --bs-progress-bar-bg: var(--bs-primary);
}

/* the active menu item in the logo's gradient: purple to blue */
.menu-item.active > .menu-link:not(.menu-toggle) {
  background: linear-gradient(90deg, var(--bs-primary) 0%, var(--ent-brand-blue, #0079de) 100%);
}

/* Layout adjustments the Vuexy layout relies on (from the template's demo.css)
******************************************************************************/

.menu .app-brand {
  height: 72px;
}

/* Vuexy relies on the (hidden) brand text pushing the toggle out of the collapsed rail; the square icon alone
   leaves room for it, so hide it explicitly until the menu is hovered open */
@media (min-width: 1200px) {
  .layout-menu-collapsed:not(.layout-menu-hover) .layout-menu .app-brand .layout-menu-toggle {
    display: none;
  }
}

/* the EntCMS mark in the menu brand - shown expanded and collapsed (Vuexy hides .app-brand-img-collapsed while the
   menu is open, expecting a separate full logo) */
.app-brand-logo .app-brand-mark {
  width: 32px;
  height: 32px;
}

/* the EntCMS wordmark next to the mark (menu, sign-in): "Ent" in QBit navy, "CMS" in the mark's purple-to-blue gradient
   - see wwwroot/img/entcms-logo.svg */
.entcms-wordmark {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #12045d;
}

.entcms-wordmark span {
  background: linear-gradient(90deg, #8100ce, #0079de);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* dark theme: white instead of navy, a lighter gradient */
[data-bs-theme="dark"] .entcms-wordmark {
  color: #fff;
}

[data-bs-theme="dark"] .entcms-wordmark span {
  background-image: linear-gradient(90deg, #c06bff, #02dad7);
}

/* the site switcher in the navbar can hold many sites */
.site-switcher {
  max-height: 70vh;
  overflow-y: auto;
}

/* .layout-navbar-fixed: keep the page content below the fixed navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}

.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 72px !important;
}

.content-wrapper .navbar {
  z-index: auto;
}

/* Vue
******************************************************************************/

/* In-DOM templates stay hidden until the Vue app has mounted */
[v-cloak] {
  display: none !important;
}

/* Loader (src/js/app.ts) */
.app-loader {
  position: absolute;
  inset: 0;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  background-color: rgba(var(--bs-body-bg-rgb), .65);
}

.app-loader.is-fixed {
  position: fixed;
}

/* Save / Cancel bar of the new/edit forms: stays at the bottom of the screen while the form scrolls */
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
}

/* Lists (src/js/components/list.ts): sortable column headers
******************************************************************************/

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable .sort-icon {
  opacity: .35;
}

th.sortable.sorted .sort-icon {
  opacity: 1;
}

/* drag handle of sortable rows (categories, gallery images) */
.drag-handle {
  cursor: grab;
}

.sortable-ghost {
  opacity: .4;
}

/* image thumbnails in lists and forms */
.thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  background-color: var(--bs-gray-50, #f8f8f8);
}
