/* Shared Odontiqo navigation. Intentionally scoped to pages successfully
 * initialised by navigation.js, so other WordPress pages are unaffected.
 */

html.odn-enabled .app #sidebar.sidebar {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

html.odn-enabled .app #sidebar.sidebar > .sidebar-head {
  flex: 0 0 auto !important;
}

html.odn-enabled .app #sidebar.sidebar > nav {
  display: block;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  padding-right: .4rem;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #7ebfb8 transparent;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html.odn-enabled #sidebar > nav::-webkit-scrollbar {
  width: 8px;
}

html.odn-enabled #sidebar > nav::-webkit-scrollbar-track {
  background: transparent;
}

html.odn-enabled #sidebar > nav::-webkit-scrollbar-thumb {
  background: #7ebfb8;
  border: 2px solid #fff;
  border-radius: 99px;
}

html.odn-enabled #sidebar > nav::-webkit-scrollbar-thumb:hover {
  background: #0d9488;
}

html.odn-enabled .app #sidebar.sidebar > .sidebar-foot {
  display: block !important;
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  padding-top: .8rem;
  border-top: 1px solid #f1f5f9;
  background: #fff;
  z-index: 1;
}

html.odn-enabled #sidebar .plan-chip {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  margin: 0 0 .25rem;
  padding: .7rem .85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: .8rem;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}

html.odn-enabled #sidebar .plan-chip:hover,
html.odn-enabled #sidebar .plan-chip:focus-visible {
  background: #f0fdfa;
  border-color: #99f6e4;
}

html.odn-enabled #sidebar .plan-chip-info {
  min-width: 0;
}

html.odn-enabled #sidebar .plan-chip-info small {
  display: block;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

html.odn-enabled #sidebar .plan-chip-info strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: .9rem;
  color: #0f172a;
}

html.odn-enabled #sidebar .plan-chip .badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: .28rem .55rem;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 700;
  white-space: nowrap;
}

html.odn-enabled #sidebar .plan-chip .badge.ok {
  background: #f0fdfa;
  color: #0f766e;
}

html.odn-enabled #sidebar .plan-chip .badge.warn {
  background: #fffbeb;
  color: #92400e;
}

html.odn-enabled #sidebar .plan-chip .badge.bad {
  background: #fff1f2;
  color: #9f1239;
}

html.odn-enabled #sidebar .plan-chip .badge.mute {
  background: #f1f5f9;
  color: #64748b;
}

/* v1.0.2 visual refresh: section headings, hover and active states.
 * Every rule is scoped to html.odn-enabled #sidebar, which is only present
 * on pages where the plugin initialised the shared sidebar.
 */

/* Section headings (NBDE, MFD and any other group heading) */
html.odn-enabled #sidebar .nav-label,
html.odn-enabled #sidebar .nav-label-group {
  margin: 1.25rem 0 .5rem;
  padding: 0 .75rem;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .02em;
  text-transform: none;
  color: #0f172a;
}

html.odn-enabled #sidebar > nav > .nav-label:first-child,
html.odn-enabled #sidebar > nav > .nav-label-group:first-child {
  margin-top: .25rem;
}

/* Navigation buttons: smooth transitions */
html.odn-enabled #sidebar .nav-link {
  transition: background-color .22s ease, color .22s ease,
    box-shadow .22s ease, border-color .22s ease;
}

html.odn-enabled #sidebar .nav-link svg {
  transition: color .22s ease, transform .22s ease;
}

/* Hover (pointer devices) and keyboard focus */
@media (hover: hover) {
  html.odn-enabled #sidebar .nav-link:hover {
    background: #ecfdf5;
    color: #0f766e;
    box-shadow: 0 1px 3px rgba(15, 118, 110, .12);
  }

  html.odn-enabled #sidebar .nav-link:hover svg {
    color: #0f766e;
    transform: scale(1.06);
  }
}

html.odn-enabled #sidebar .nav-link:focus-visible {
  background: #ecfdf5;
  color: #0f766e;
  outline: 2px solid #14b8a6;
  outline-offset: -2px;
}

html.odn-enabled #sidebar .nav-link:focus-visible svg {
  color: #0f766e;
}

/* Active page: declared after hover so it always wins, including on hover */
html.odn-enabled #sidebar .nav-link[aria-current="page"],
html.odn-enabled #sidebar .nav-link[aria-current="page"]:hover,
html.odn-enabled #sidebar .nav-link[aria-current="page"]:focus-visible {
  background: #dff7f0;
  color: #0f766e;
  font-weight: 700;
  box-shadow: none;
}

html.odn-enabled #sidebar .nav-link[aria-current="page"] svg,
html.odn-enabled #sidebar .nav-link[aria-current="page"]:hover svg {
  color: #0f766e;
  transform: none;
}

html.odn-enabled #sidebar .nav-link.od-basic-nav-locked {
  background: linear-gradient(92deg, #f7fafb, #eef8f5);
  border: 1px solid #d8ebe5;
  color: #53657a;
}

html.odn-enabled #sidebar .nav-link.od-basic-nav-locked .od-nav-plan-lock {
  margin-left: auto;
}

html.odn-enabled #sidebar .nav-link svg,
html.odn-enabled .od-account-action svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

html.odn-enabled .od-account-menu {
  position: relative;
  display: flex;
  align-items: center;
}

html.odn-enabled .od-account-popover {
  position: absolute;
  top: calc(100% + 11px);
  right: 0;
  z-index: 90;
  width: min(275px, calc(100vw - 24px));
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 55px -16px rgba(15,23,42,.24);
}

html.odn-enabled .od-account-popover[hidden] {
  display: none !important;
}

html.odn-enabled .od-account-caption {
  padding: 9px 12px 11px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

html.odn-enabled .od-account-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #334155;
  font: 600 13px Inter, system-ui, sans-serif;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s;
}

html.odn-enabled .od-account-action svg {
  width: 19px;
  height: 19px;
  color: #0d9488;
}

html.odn-enabled .od-account-action:hover,
html.odn-enabled .od-account-action:focus-visible {
  background: #f0fdfa;
  color: #0f766e;
}

html.odn-enabled .od-account-divider {
  height: 1px;
  margin: 7px 5px;
  background: #e2e8f0;
}

html.odn-enabled .od-account-logout {
  color: #be123c;
}

html.odn-enabled .od-account-logout:hover,
html.odn-enabled .od-account-logout:focus-visible {
  background: #fff1f2;
  color: #be123c;
}

html.odn-enabled .od-account-logout:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-height: 540px) {
  html.odn-enabled .app #sidebar.sidebar {
    padding-top: .55rem;
    padding-bottom: .55rem;
  }
  html.odn-enabled #sidebar > .sidebar-head {
    padding-bottom: .55rem;
  }
  html.odn-enabled #sidebar > .sidebar-foot {
    padding-top: .5rem;
  }
  html.odn-enabled #sidebar .plan-chip {
    padding: .55rem .7rem;
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.odn-enabled #sidebar > nav {
    scroll-behavior: auto;
  }
  html.odn-enabled #sidebar .nav-link,
  html.odn-enabled #sidebar .nav-link svg {
    transition: none;
  }
  html.odn-enabled #sidebar .nav-link:hover svg {
    transform: none;
  }
}
