/* Preline Essential Styles for Sidebar and Dropdowns */

/* ================================================
   OVERLAY BASE (modals, file upload, etc.)
   ================================================ */
.hs-overlay {
  display: none;
}

.hs-overlay.open {
  display: block;
}

/* ================================================
   SIDEBAR — MOBILE FIRST (transform-based animation)
   display:none can't animate; we use transform instead.
   JS adds/removes class "sidebar-open".
   ================================================ */

/* Always rendered; hidden off-screen via transform on mobile */
#hs-pro-sidebar {
  display: block !important;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  will-change: transform;
  z-index: 61;
}

/* Open state — JS toggles this class */
#hs-pro-sidebar.sidebar-open {
  transform: translateX(0) !important;
}

/* Desktop (≥768px): always fully visible, no translation */
@media (min-width: 768px) {
  #hs-pro-sidebar {
    transform: translateX(0) !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 60;
  }
}

/* ================================================
   MOBILE BACKDROP
   Uses opacity+visibility for smooth fade (not display)
   ================================================ */
#mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.55);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  /* visibility delay on close matches transition duration */
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

#mobile-sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
  /* visibility shows immediately on open */
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

/* ================================================
   HAMBURGER — animated 3-line ↔ X icon
   ================================================ */
#mobile-sidebar-toggle .hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

#mobile-sidebar-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

#mobile-sidebar-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#mobile-sidebar-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ================================================
   DROPDOWN STATES
   ================================================ */
.hs-dropdown-menu {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hs-dropdown.open>.hs-dropdown-menu,
.hs-dropdown-menu.open {
  display: block;
  opacity: 1;
}

/* ================================================
   DARK MODE TOGGLE
   ================================================ */
.hs-dark-mode-active .hs-dark-mode:not(.hs-dark-mode-active\:flex) {
  display: none !important;
}

.hs-dark-mode-active .hs-dark-mode.hs-dark-mode-active\:flex {
  display: flex !important;
}

html:not(.dark) .hs-dark-mode.hs-dark-mode-active\:hidden {
  display: flex !important;
}

html:not(.dark) .hs-dark-mode.hs-dark-mode-active\:flex {
  display: none !important;
}

html.dark .hs-dark-mode.hs-dark-mode-active\:hidden {
  display: none !important;
}

html.dark .hs-dark-mode.hs-dark-mode-active\:flex {
  display: flex !important;
}

.dis-none {
  display: none !important;
}


.onboarding-checkbox {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: white;
  cursor: pointer;
  position: relative;
}

.onboarding-checkbox:checked {
  background-color: #587d4a;
  border-color: #587d4a;
}

.onboarding-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.375rem;
  height: 0.625rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.onboarding-checkbox:focus {
  outline: none;
}