/* ==========================================================================
   Embedl Brand Theme for pydata-sphinx-theme
   Colors extracted from https://www.embedl.com/
   ========================================================================== */

/* ---------- Embedl Color Palette ----------
   Dark Navy Background : #0b1623
   Primary Cyan         : #00ccff
   Teal Accent          : #00E2D5
   Light Cyan           : #2AEBFF
   Bright Cyan          : #12D0FE
   Orange Accent        : #FF8056
   Purple Accent        : #845CF5 / #BDADEF
   Dark Surface         : #1C2536
   Mid Dark Surface     : #121D2A
   ------------------------------------------ */

/* ---- CSS Custom Properties (Light Mode) ---- */
:root {
    --embedl-navy: #0b1623;
    --embedl-cyan: #00ccff;
    --embedl-teal: #00E2D5;
    --embedl-light-cyan: #2AEBFF;
    --embedl-orange: #FF8056;
    --embedl-purple: #845CF5;
    --embedl-dark-surface: #1C2536;
    --embedl-mid-surface: #121D2A;
}

/* pydata-sphinx-theme CSS variable overrides */
html[data-theme="light"] {
    --pst-color-primary: #00ccff;
    --pst-color-secondary: #00E2D5;
    --pst-color-accent: #FF8056;
    --pst-color-link: #00a8d6;
    --pst-color-link-hover: #00ccff;
    --pst-color-headerlink: #00ccff;
    --pst-color-headerlink-hover: #00E2D5;
    --pst-color-info: #12D0FE;
    --pst-color-warning: #FF8056;
    --pst-color-success: #00E2D5;
}

html[data-theme="dark"] {
    --pst-color-primary: #00ccff;
    --pst-color-secondary: #00E2D5;
    --pst-color-accent: #FF8056;
    --pst-color-link: #2AEBFF;
    --pst-color-link-hover: #00ccff;
    --pst-color-headerlink: #00ccff;
    --pst-color-headerlink-hover: #00E2D5;
    --pst-color-info: #12D0FE;
    --pst-color-warning: #FF8056;
    --pst-color-success: #00E2D5;
    --pst-color-background: #0b1623;
    --pst-color-on-background: #f3f3f4;
    --pst-color-surface: #1C2536;
    --pst-color-on-surface: #f3f3f4;
}

/* ---- Navbar ---- */
.bd-header {
    background-color: var(--embedl-navy) !important;
    border-bottom: 2px solid var(--embedl-cyan);
}

.bd-header__inner.bd-page-width {
    padding-left: 0.5rem;
    justify-content: flex-start;
}

/* Ensure the navbar items container is always visible, even on narrow screens */
.bd-header .navbar-header-items {
    display: flex !important;
    flex-grow: 1;
    flex-shrink: 1;
    padding-left: 0.5rem;
}

/* Also show the desktop search, not just mobile */
.navbar-persistent--container {
    display: flex !important;
}

/* Hide the mobile sidebar toggle for primary nav since navbar is always shown */
@media (min-width: 720px) {
    .bd-header .primary-toggle {
        display: none;
    }
}

.bd-header ul.navbar-nav>li.nav-item>.nav-link {
    color: #f3f3f4 !important;
    transition: color 0.2s ease;
}

.bd-header ul.navbar-nav>li.nav-item>.nav-link:hover,
.bd-header ul.navbar-nav>li.nav-item>.nav-link:focus {
    color: var(--embedl-cyan) !important;
}

.bd-header ul.navbar-nav>li.nav-item.current>.nav-link {
    color: var(--embedl-cyan) !important;
    border-bottom: 2px solid var(--embedl-cyan);
}

html[data-theme="light"] .bd-header .version-switcher__button:not(.show),
html[data-theme="light"] .bd-header .version-switcher__button.show {
    color: #f3f3f4;
}

html[data-theme="dark"] .bd-header .version-switcher__button.show+
.version-switcher__menu .dropdown-item:not(.active) {
    color: #212529;
}

/* Navbar brand / logo area */
.navbar-brand.logo {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem 0.5rem 0;
    margin-left: 1rem;
}

.navbar-brand.logo .logo__image {
    max-height: 32px;
    width: auto;
    vertical-align: middle;
    object-fit: contain;
}

/* Align the logo container with the rest of the header items */
.navbar-header-items__start {
    display: flex;
    align-items: center;
}

.navbar-header-items__start .navbar-item {
    display: flex;
    align-items: center;
}

/* ---- Sidebar ---- */
.bd-sidebar-primary {
    border-right: 1px solid rgba(0, 204, 255, 0.15);
}

html[data-theme="dark"] .bd-sidebar-primary {
    background-color: var(--embedl-mid-surface);
}

.bd-sidebar-primary .sidebar-primary-item .nav-link.active,
.bd-sidebar-primary .sidebar-primary-items-end .nav-link.active {
    color: var(--embedl-cyan) !important;
    border-left: 3px solid var(--embedl-cyan);
    font-weight: 600;
}

/* TOC sidebar on the right */
.bd-sidebar-secondary .toc-entry a.active {
    color: var(--embedl-cyan);
    border-left-color: var(--embedl-cyan);
}

/* ---- Links ---- */
a {
    transition: color 0.2s ease;
}

.bd-content a:not(.btn):not(.headerlink) {
    text-decoration-color: rgba(0, 204, 255, 0.3);
}

.bd-content a:not(.btn):not(.headerlink):hover {
    text-decoration-color: var(--embedl-cyan);
}

/* ---- Headings ---- */
.bd-content h1,
.bd-content h2,
.bd-content h3 {
    color: var(--embedl-navy);
}

html[data-theme="dark"] .bd-content h1,
html[data-theme="dark"] .bd-content h2,
html[data-theme="dark"] .bd-content h3 {
    color: #f3f3f4;
}

/* Header anchor links */
.headerlink {
    color: var(--embedl-cyan) !important;
    opacity: 0;
    transition: opacity 0.2s ease;
}

h1:hover .headerlink,
h2:hover .headerlink,
h3:hover .headerlink,
h4:hover .headerlink {
    opacity: 1;
}

/* ---- Buttons & Badges ---- */
.btn-primary,
.bd-content .btn-primary {
    background-color: var(--embedl-cyan);
    border-color: var(--embedl-cyan);
    color: var(--embedl-navy);
}

.btn-primary:hover,
.bd-content .btn-primary:hover {
    background-color: var(--embedl-teal);
    border-color: var(--embedl-teal);
    color: var(--embedl-navy);
}

/* ---- Code Blocks ---- */
html[data-theme="light"] code.literal {
    background-color: rgba(0, 204, 255, 0.08);
    color: #0b1623;
    border: 1px solid rgba(0, 204, 255, 0.15);
    border-radius: 4px;
    padding: 0.1em 0.3em;
}

html[data-theme="dark"] code.literal {
    background-color: rgba(0, 204, 255, 0.1);
    color: #2AEBFF;
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 4px;
    padding: 0.1em 0.3em;
}

/* ---- Admonitions ---- */
.admonition {
    border-radius: 6px;
    border-left-width: 4px;
}

.admonition.note {
    border-left-color: var(--embedl-cyan);
}

.admonition.note>.admonition-title {
    background-color: rgba(0, 204, 255, 0.1);
}

.admonition.warning {
    border-left-color: var(--embedl-orange);
}

.admonition.warning>.admonition-title {
    background-color: rgba(255, 128, 86, 0.1);
}

.admonition.tip {
    border-left-color: var(--embedl-teal);
}

.admonition.tip>.admonition-title {
    background-color: rgba(0, 226, 213, 0.1);
}

.admonition.important {
    border-left-color: var(--embedl-purple);
}

.admonition.important>.admonition-title {
    background-color: rgba(132, 92, 245, 0.1);
}

/* ---- Footer ---- */
.bd-footer {
    background-color: var(--embedl-navy);
    color: #9ca3af;
    border-top: 2px solid var(--embedl-cyan);
}

.bd-footer a {
    color: var(--embedl-cyan) !important;
}

.bd-footer a:hover {
    color: var(--embedl-teal) !important;
}

/* ---- Search ---- */
.bd-search input[type="search"] {
    border-color: rgba(0, 204, 255, 0.3);
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bd-search input[type="search"]:focus {
    border-color: var(--embedl-cyan);
    box-shadow: 0 0 0 3px rgba(0, 204, 255, 0.15);
}

/* ---- Tables ---- */
.bd-content table thead {
    background-color: var(--embedl-navy);
    color: #fff;
}

html[data-theme="dark"] .bd-content table thead {
    background-color: var(--embedl-dark-surface);
}

.bd-content table tbody tr:nth-child(even) {
    background-color: rgba(0, 204, 255, 0.03);
}

/* ---- Scrollbar (Webkit) ---- */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: rgba(0, 204, 255, 0.25);
    border-radius: 4px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background-color: var(--embedl-mid-surface);
}

/* ---- Version Selector / Announcement Bar ---- */
.bd-header-announcement {
    background-color: var(--embedl-cyan);
    color: var(--embedl-navy);
    font-weight: 600;
}

/* ---- Misc ---- */
::selection {
    background-color: rgba(0, 204, 255, 0.25);
    color: inherit;
}
