/* Sidebar open/close (admin/nav_sidebar.html, sidebar.js). */

/* x-show would flash the backdrop before Alpine starts. */
html:not(.talkesim-alpine-ready) .talkesim-sidebar-backdrop {
  display: none;
}

.talkesim-sidebar-wrapper {
  transition: width 0.2s ease-out;
}

.talkesim-sidebar-panel {
  transition: width 0.2s ease-out, transform 0.2s ease-out;
}

/* Dragging the resize handle must follow the pointer, not ease after it. */
.talkesim-sidebar-resizing,
.talkesim-sidebar-resizing .talkesim-sidebar-panel,
/* No animation for the state a page loads with. */
html:not(.talkesim-alpine-ready) .talkesim-sidebar-wrapper,
html:not(.talkesim-alpine-ready) .talkesim-sidebar-panel {
  transition: none;
}

/* Before Alpine runs, a sidebar stored as closed stays closed (no flash). */
@media (min-width: 1280px) {
  html.talkesim-sidebar-closed:not(.talkesim-alpine-ready) .talkesim-sidebar-wrapper {
    width: 64px !important;
  }

  html.talkesim-sidebar-closed:not(.talkesim-alpine-ready) .talkesim-sidebar-panel {
    width: 64px !important;
    transform: none !important;
  }
}

@media (max-width: 1279px) {
  html.talkesim-sidebar-closed:not(.talkesim-alpine-ready) .talkesim-sidebar-wrapper {
    width: 0 !important;
  }

  html.talkesim-sidebar-closed:not(.talkesim-alpine-ready) .talkesim-sidebar-panel {
    transform: translateX(-100%) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .talkesim-sidebar-wrapper,
  .talkesim-sidebar-panel {
    transition: none;
  }
}

/* User links flyout menu when sidebar is collapsed (positioned to the right of the rail) */
.talkesim-user-menu-collapsed {
  position: absolute !important;
  left: 68px !important;
  bottom: 8px !important;
  width: 224px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2) !important;
  z-index: 70 !important;
}

[dir="rtl"] .talkesim-user-menu-collapsed {
  left: auto !important;
  right: 68px !important;
}

/* User links menu when sidebar is open (positioned above the user row) */
.talkesim-user-menu-open {
  position: absolute !important;
  left: 12px !important;
  right: 12px !important;
  bottom: 73px !important;
  z-index: 50 !important;
}

/* Sidebar toggle button positioned on the sidebar border line */
.talkesim-sidebar-toggle-btn {
  position: absolute !important;
  top: 50% !important;
  right: 0 !important;
  transform: translateY(-50%) translateX(50%) !important;
  z-index: 40 !important;
}

[dir="rtl"] .talkesim-sidebar-toggle-btn {
  right: auto !important;
  left: 0 !important;
  transform: translateY(-50%) translateX(-50%) !important;
}

/* Ensure branding text in nav header stays hidden when closed before Alpine runs */
@media (min-width: 1280px) {
  html.talkesim-sidebar-closed:not(.talkesim-alpine-ready) .talkesim-nav-header-text,
  html.talkesim-sidebar-closed:not(.talkesim-alpine-ready) .talkesim-nav-header-dropdown {
    display: none !important;
  }
}

/* Space between logo icon and Talkesim branding text in admin nav header */
.talkesim-nav-header-text {
  margin-inline-start: 0.75rem !important;
}


