/**
 * Ember documentation overrides
 * Modern styling for the right-hand page TOC (#page-nav) and theme consistency.
 */

/* Hide breadcrumb bar and left-panel sync icon (<>) */
#nav-path,
#nav-sync {
    display: none !important;
}

/* Hide project tagline */
#projectbrief {
    display: none !important;
}

/* ========== Sidebar header: ensure search bar is visible ========== */
/* doxygen-awesome-sidebar-only uses --top-height: 120px; logo + title + search need more room */
html {
    --top-height: 200px !important;
}

#top {
    height: var(--top-height) !important;
    min-height: var(--top-height) !important;
}

/* Search bar must stay visible; ensure it isn't clipped */
#MSearchBox {
    visibility: visible !important;
    min-height: 32px !important;
}

/* Logo and title sized so logo + title + search fit in --top-height without clipping */
#projectlogo img {
    max-height: 56px !important;
    width: auto !important;
}

#projectname {
    font-size: 22px !important;
}

/* Project name and logo link styling */
#projectname a.projectname-link,
#projectlogo a {
    color: inherit !important;
    text-decoration: none !important;
}

#projectname a.projectname-link:hover,
#projectlogo a:hover {
    opacity: 0.85;
}

/* ========== Panel container ========== */
#page-nav {
    background: var(--side-nav-background) !important;
    border-left: 1px solid var(--separator-color) !important;
    padding: var(--spacing-medium) 0 !important;
}

#page-nav-resize-handle {
    background-color: var(--separator-color) !important;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

#page-nav-resize-handle.dragging,
#page-nav-resize-handle:hover {
    background-color: var(--primary-color) !important;
    opacity: 0.6 !important;
}

/* ========== Scrollable contents ========== */
#page-nav-contents {
    color: var(--side-nav-foreground);
    padding: 0 var(--spacing-medium) !important;
    /* Themed scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--separator-color) transparent;
}

#page-nav-contents::-webkit-scrollbar {
    width: 6px;
}

#page-nav-contents::-webkit-scrollbar-track {
    background: transparent;
}

#page-nav-contents::-webkit-scrollbar-thumb {
    background: var(--separator-color);
    border-radius: 3px;
}

#page-nav-contents::-webkit-scrollbar-thumb:hover {
    background: var(--page-secondary-foreground-color);
}

/* ========== Typography & spacing ========== */
ul.page-outline,
ul.page-outline ul {
    padding-left: var(--spacing-small) !important;
}

ul.page-outline {
    margin: 0 !important;
}

ul.page-outline div.item {
    font-family: var(--font-family) !important;
    font-size: var(--toc-font-size) !important;
    line-height: 1.5 !important;
    color: var(--page-foreground-color) !important;
    padding: 4px 8px !important;
    margin: 2px 0 !important;
    border-radius: var(--border-radius-small) !important;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

ul.page-outline a {
    color: var(--page-foreground-color) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

/* ========== Hover state ========== */
ul.page-outline li:hover div.item,
ul.page-outline li:hover a {
    color: var(--primary-color) !important;
}

ul.page-outline li:hover div.item {
    background-color: var(--odd-color) !important;
}

/* ========== Active/visible section - strong highlight ========== */
ul.page-outline li.vis div.item {
    background-color: var(--menu-selected-background) !important;
    border-left: 3px solid var(--primary-color) !important;
    padding-left: 5px !important; /* 5 + 3px border = 8px, aligns with normal items */
}

ul.page-outline li.vis a {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* Hide decorative arrows in page-outline - they suggest expand/collapse but Doxygen
   does not implement that for the right-hand TOC; sub-items are always visible */
#page-nav .arrowhead {
    display: none !important;
}

/* Section headers (items that had arrows - e.g. Public Member Functions, Private Attributes) */
ul.page-outline li:has(.arrowhead) div.item {
    font-weight: 600 !important;
    color: var(--page-secondary-foreground-color) !important;
    margin-top: var(--spacing-medium) !important;
    padding-top: 6px !important;
}

ul.page-outline li:has(.arrowhead):first-child div.item {
    margin-top: 0 !important;
    padding-top: 4px !important;
}

ul.page-outline li:has(.arrowhead) a {
    color: var(--page-secondary-foreground-color) !important;
}

ul.page-outline li:has(.arrowhead):hover a {
    color: var(--primary-color) !important;
}

/* Dark mode: brighter text for active section (better contrast on dark background) */
@media (prefers-color-scheme: dark) {
    ul.page-outline li.vis a {
        color: #e8eef2 !important;
    }
}

html.dark-mode ul.page-outline li.vis a {
    color: #e8eef2 !important;
}
