/* ===============================
   GeoPulse Theme Overrides
   =============================== */

/* Light theme (default) */
:root {
    /* Primary brand colors */
    --ifm-color-primary: #1a56db;
    --ifm-color-primary-dark: #1e40af;
    --ifm-color-primary-darker: #1c4ed8;
    --ifm-color-primary-darkest: #1d4ed8;
    --ifm-color-primary-light: #3b82f6;
    --ifm-color-primary-lighter: #60a5fa;
    --ifm-color-primary-lightest: #93c5fd;

    /* Code styling */
    --ifm-code-font-size: 95%;
    --docusaurus-highlighted-code-line-bg: rgba(26, 86, 219, 0.08);

    --gp-home-bg: #eef4fb;
    --gp-home-border: #d8e4f0;
    --gp-home-text-primary: #0f172a;
    --gp-home-text-secondary: #52627a;
    --gp-page-bg: #eef4fb;
    --gp-page-gradient:
        radial-gradient(circle at 8% 10%, #dbeafe 0%, rgba(219, 234, 254, 0) 34%),
        radial-gradient(circle at 90% 75%, #dcfce7 0%, rgba(220, 252, 231, 0) 30%),
        var(--gp-page-bg);
    --gp-doc-surface: rgba(255, 255, 255, 0.76);
    --gp-doc-surface-strong: rgba(255, 255, 255, 0.9);
    --gp-doc-border: rgba(203, 213, 225, 0.72);
    --gp-doc-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --gp-doc-sidebar-bg: rgba(238, 244, 251, 0.86);
    --gp-navbar-bg: rgba(244, 248, 255, 0.78);
    --gp-navbar-pill-bg: rgba(255, 255, 255, 0.7);
    --gp-navbar-pill-hover: rgba(255, 255, 255, 0.95);

    --ifm-background-color: var(--gp-page-bg);
    --ifm-background-surface-color: var(--gp-doc-surface-strong);
    --ifm-font-color-base: var(--gp-home-text-primary);
    --ifm-heading-color: var(--gp-home-text-primary);
    --ifm-menu-color-background-active: rgba(37, 99, 235, 0.08);
    --ifm-menu-color-background-hover: rgba(15, 23, 42, 0.05);
    --ifm-toc-border-color: var(--gp-doc-border);
}

html {
    font-size: 14px;
}

body,
#__docusaurus {
    background: var(--gp-page-bg);
    color: var(--gp-home-text-primary);
}

#__docusaurus,
.main-wrapper {
    background: var(--gp-page-gradient);
}

.main-wrapper {
    min-height: calc(100vh - var(--ifm-navbar-height));
}

.theme-doc-markdown {
    border: 1px solid var(--gp-doc-border);
    border-radius: 16px;
    padding: 2rem;
    background: var(--gp-doc-surface);
    box-shadow: var(--gp-doc-shadow);
}

.theme-doc-markdown > :first-child {
    margin-top: 0;
}

.theme-doc-markdown h1,
.theme-doc-markdown h2,
.theme-doc-markdown h3,
.theme-doc-markdown h4 {
    letter-spacing: 0;
}

.theme-doc-sidebar-container {
    border-right-color: var(--gp-doc-border) !important;
    background: var(--gp-doc-sidebar-bg);
}

.table-of-contents {
    border-left-color: var(--gp-doc-border);
}

.table-of-contents__link {
    color: var(--gp-home-text-secondary);
}

.table-of-contents__link:hover,
.table-of-contents__link--active {
    color: var(--ifm-color-primary);
}

.breadcrumbs__link,
.pagination-nav__link,
.card {
    border-color: var(--gp-doc-border);
    background: var(--gp-doc-surface);
}

.pagination-nav__link,
.card {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.breadcrumbs__link:hover,
.pagination-nav__link:hover,
.card:hover {
    background: var(--gp-doc-surface-strong);
}

.theme-doc-footer {
    margin-top: 2rem;
}

.navbar {
    min-height: 3.75rem;
    border-bottom: 1px solid var(--gp-home-border);
    background: var(--gp-navbar-bg);
    background-color: var(--gp-navbar-bg);
    backdrop-filter: blur(10px);
    box-shadow: none;
    padding: 0.75rem 0;
}

.navbar__inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

.navbar__items {
    min-width: 0;
}

.navbar__items--right {
    margin-left: auto;
    gap: 0.35rem;
    justify-content: flex-end;
}

.navbar__brand {
    color: var(--gp-home-text-primary);
    font-weight: 700;
}

.navbar__logo {
    height: 32px;
    margin-right: 0.75rem;
}

.navbar__title {
    font-size: 1.1rem;
    letter-spacing: 0;
}

.navbar__items--right > .navbar__item.navbar__link {
    display: inline-flex;
    align-items: center;
    margin: 0;
    border: 1px solid rgba(203, 213, 225, 0.85);
    border-radius: 999px;
    padding: 0.36rem 0.66rem;
    background: var(--gp-navbar-pill-bg);
    color: var(--gp-home-text-secondary);
    font-size: 0.79rem;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.18s ease;
}

.navbar__items--right > .navbar__item.navbar__link:hover,
.navbar__items--right > .navbar__item.navbar__link--active {
    border-color: rgba(148, 163, 184, 0.95);
    background: var(--gp-navbar-pill-hover);
    color: var(--gp-home-text-primary);
    text-decoration: none;
}

.navbar-version-link {
    background: rgba(255, 255, 255, 0.96) !important;
    color: #7c3aed !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em;
}

.navbar__items--right button.clean-btn[aria-label*="dark and light mode"] {
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    border-radius: 0.65rem !important;
    background: rgba(255, 255, 255, 0.75) !important;
    color: #475569 !important;
}

.DocSearch.DocSearch-Button {
    border: 1px solid rgba(203, 213, 225, 0.85) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: var(--gp-home-text-secondary) !important;
}

.DocSearch.DocSearch-Button:hover {
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: none !important;
}

.navbar.navbar-sidebar--show {
    z-index: calc(var(--ifm-z-index-overlay) + 1);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.navbar-sidebar__backdrop {
    z-index: 0;
}

.navbar-sidebar {
    z-index: 1;
}

/* Dark theme */
[data-theme='dark'] {
    /* Primary brand colors for dark mode */
    --ifm-color-primary: #3b82f6;
    --ifm-color-primary-dark: #1d4ed8;
    --ifm-color-primary-darker: #1e40af;
    --ifm-color-primary-darkest: #1e3a8a;
    --ifm-color-primary-light: #60a5fa;
    --ifm-color-primary-lighter: #93c5fd;
    --ifm-color-primary-lightest: #bfdbfe;

    /* Highlighted code background */
    --docusaurus-highlighted-code-line-bg: rgba(255, 255, 255, 0.05);

    /* Optional: integrate your GeoPulse dark palette */
    --gp-text-primary: #f1f5f9;
    --gp-text-secondary: #cbd5e1;
    --gp-text-muted: #94a3b8;
    --gp-surface-white: #1e293b;
    --gp-surface-light: #334155;
    --gp-surface-gray: #475569;
    --gp-surface-dark: #1e293b;
    --gp-surface-darker: #0f172a;
    --gp-border-light: rgba(255, 255, 255, 0.1);
    --gp-border-medium: rgba(255, 255, 255, 0.2);
    --gp-border-subtle: #334155;
    --gp-border-dark: rgba(255, 255, 255, 0.1);

    --gp-home-bg: #020617;
    --gp-home-border: #1e293b;
    --gp-home-text-primary: #f8fafc;
    --gp-home-text-secondary: #94a3b8;
    --gp-page-bg: #020617;
    --gp-page-gradient:
        radial-gradient(circle at 8% 10%, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0) 34%),
        radial-gradient(circle at 90% 75%, rgba(14, 165, 233, 0.05) 0%, rgba(14, 165, 233, 0) 30%),
        var(--gp-page-bg);
    --gp-doc-surface: rgba(15, 23, 42, 0.76);
    --gp-doc-surface-strong: rgba(15, 23, 42, 0.9);
    --gp-doc-border: rgba(148, 163, 184, 0.24);
    --gp-doc-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    --gp-doc-sidebar-bg: rgba(2, 6, 23, 0.9);
    --gp-navbar-bg: rgba(2, 6, 23, 0.85);
    --gp-navbar-pill-bg: rgba(15, 23, 42, 0.7);
    --gp-navbar-pill-hover: rgba(30, 41, 59, 0.82);
    --ifm-background-color: var(--gp-page-bg);
    --ifm-background-surface-color: var(--gp-doc-surface-strong);
    --ifm-font-color-base: var(--gp-home-text-primary);
    --ifm-heading-color: var(--gp-home-text-primary);
    --ifm-menu-color-background-active: rgba(37, 99, 235, 0.18);
    --ifm-menu-color-background-hover: rgba(30, 41, 59, 0.74);
    --ifm-toc-border-color: var(--gp-doc-border);
    --ifm-navbar-background-color: rgba(2, 6, 23, 0.92);
    --ifm-navbar-link-color: #cbd5e1;
    --ifm-navbar-link-hover-color: #f8fafc;
}

[data-theme='dark'] .pagination-nav__link,
[data-theme='dark'] .card {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

[data-theme='dark'] .breadcrumbs__link:hover,
[data-theme='dark'] .pagination-nav__link:hover,
[data-theme='dark'] .card:hover {
    background: rgba(30, 41, 59, 0.86);
}

html[data-theme='dark'] .theme-layout-navbar.navbar,
html[data-theme='dark'] .navbar,
[data-theme='dark'] .navbar {
    background: rgba(2, 6, 23, 0.92) !important;
    background-color: rgba(2, 6, 23, 0.92) !important;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .navbar__brand,
[data-theme='dark'] .navbar__title {
    color: #f8fafc !important;
}

html[data-theme='dark'] .navbar__toggle,
[data-theme='dark'] .navbar__toggle {
    color: #cbd5e1 !important;
}

html[data-theme='dark'] .navbar__items--right > .navbar__item.navbar__link,
[data-theme='dark'] .navbar__items--right > .navbar__item.navbar__link {
    border-color: rgba(148, 163, 184, 0.35) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    color: #cbd5e1 !important;
}

html[data-theme='dark'] .navbar__items--right > .navbar__item.navbar__link:hover,
html[data-theme='dark'] .navbar__items--right > .navbar__item.navbar__link--active,
[data-theme='dark'] .navbar__items--right > .navbar__item.navbar__link:hover,
[data-theme='dark'] .navbar__items--right > .navbar__item.navbar__link--active {
    border-color: rgba(148, 163, 184, 0.55) !important;
    background: rgba(30, 41, 59, 0.82) !important;
    color: #e2e8f0 !important;
}

[data-theme='dark'] .navbar-version-link {
    border-color: rgba(255, 255, 255, 0.45) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #6d28d9 !important;
}

[data-theme='dark'] .navbar__items--right button.clean-btn[aria-label*="dark and light mode"] {
    border-color: rgba(148, 163, 184, 0.55) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    color: #e2e8f0 !important;
}

html[data-theme='dark'] .DocSearch.DocSearch-Button,
[data-theme='dark'] .DocSearch.DocSearch-Button {
    border-color: rgba(148, 163, 184, 0.35) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    color: #cbd5e1 !important;
}

html[data-theme='dark'] .DocSearch-Container,
html[data-theme='dark'] .DocSearch-Modal {
    --docsearch-text-color: #f8fafc;
    --docsearch-hit-color: #e2e8f0;
    --docsearch-secondary-text-color: #cbd5e1;
    --docsearch-muted-color: #94a3b8;
    --docsearch-icon-color: #cbd5e1;
    --docsearch-modal-background: #0f172a;
    --docsearch-searchbox-background: rgba(15, 23, 42, 0.96);
    --docsearch-searchbox-focus-background: rgba(15, 23, 42, 0.96);
    --docsearch-hit-background: rgba(30, 41, 59, 0.92);
    --docsearch-hit-highlight-color: rgba(37, 99, 235, 0.26);
    --docsearch-footer-background: rgba(15, 23, 42, 0.96);
}

html[data-theme='dark'] .DocSearch-Input,
html[data-theme='dark'] .DocSearch-Modal-heading,
html[data-theme='dark'] .DocSearch-Hit-Container,
html[data-theme='dark'] .DocSearch-Hit-title,
html[data-theme='dark'] .DocSearch-Hit-text,
html[data-theme='dark'] .DocSearch-Hit-path,
html[data-theme='dark'] .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Tree,
html[data-theme='dark'] .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-text,
html[data-theme='dark'] .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-title {
    color: var(--docsearch-text-color) !important;
}

html[data-theme='dark'] .DocSearch-Hit-path {
    color: var(--docsearch-secondary-text-color) !important;
}

html[data-theme='dark'] .DocSearch-Input::placeholder {
    color: var(--docsearch-muted-color) !important;
    opacity: 1;
}

html.docs-wrapper body,
html.docs-wrapper #__docusaurus,
html.docs-wrapper .main-wrapper {
    background:
        radial-gradient(circle at 8% 6%, rgba(219, 234, 254, 0.74) 0%, rgba(219, 234, 254, 0) 30%),
        radial-gradient(circle at 92% 70%, rgba(191, 219, 254, 0.55) 0%, rgba(191, 219, 254, 0) 32%),
        #eef4fb !important;
}

html.docs-wrapper .theme-doc-markdown {
    background: rgba(248, 250, 252, 0.86) !important;
    border-color: rgba(203, 213, 225, 0.72) !important;
    color: #0f172a;
}

html.docs-wrapper .theme-doc-sidebar-container {
    background: rgba(238, 244, 251, 0.9) !important;
}

html.docs-wrapper .menu__link {
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
}

html.docs-wrapper .menu__link:hover {
    background: rgba(37, 99, 235, 0.07);
    color: #1e293b;
}

html.docs-wrapper .menu__link--active {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #2563eb !important;
}

html.docs-wrapper .table-of-contents__link {
    color: #64748b;
}

html.docs-wrapper .table-of-contents__link:hover,
html.docs-wrapper .table-of-contents__link--active {
    color: #2563eb;
}

html.docs-wrapper[data-theme='dark'] body,
html.docs-wrapper[data-theme='dark'] #__docusaurus,
html.docs-wrapper[data-theme='dark'] .main-wrapper {
    background:
        radial-gradient(circle at 8% 6%, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0) 32%),
        radial-gradient(circle at 90% 72%, rgba(14, 165, 233, 0.06) 0%, rgba(14, 165, 233, 0) 34%),
        #020617 !important;
}

html.docs-wrapper[data-theme='dark'] .theme-doc-markdown {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #cbd5e1 !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

html.docs-wrapper[data-theme='dark'] .theme-doc-markdown h1,
html.docs-wrapper[data-theme='dark'] .theme-doc-markdown h2,
html.docs-wrapper[data-theme='dark'] .theme-doc-markdown h3,
html.docs-wrapper[data-theme='dark'] .theme-doc-markdown h4 {
    color: #f8fafc !important;
}

html.docs-wrapper[data-theme='dark'] [class*='generatedIndexPage'] {
    --ifm-heading-color: #f8fafc;
    --ifm-link-color: #e2e8f0;
}

html.docs-wrapper[data-theme='dark'] [class*='generatedIndexPage'] header h1,
html.docs-wrapper[data-theme='dark'] [class*='generatedIndexPage'] [class*='cardTitle'] {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

html.docs-wrapper[data-theme='dark'] .theme-doc-markdown p,
html.docs-wrapper[data-theme='dark'] .theme-doc-markdown li,
html.docs-wrapper[data-theme='dark'] .theme-doc-markdown td {
    color: #cbd5e1;
}

html.docs-wrapper[data-theme='dark'] .theme-api-markdown,
html.docs-wrapper[data-theme='dark'] .theme-api-markdown .openapi-markdown__details,
html.docs-wrapper[data-theme='dark'] .theme-api-markdown .openapi-security__details {
    --ifm-heading-color: #f8fafc;
    --ifm-font-color-base: #cbd5e1;
    --docusaurus-details-decoration-color: #cbd5e1;
    color: #cbd5e1 !important;
}

html.docs-wrapper[data-theme='dark'] .theme-api-markdown .openapi-schema__property {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

html.docs-wrapper[data-theme='dark'] .theme-api-markdown .openapi-schema__name,
html.docs-wrapper[data-theme='dark'] .theme-api-markdown .openapi-schema__type {
    color: #cbd5e1 !important;
    opacity: 0.85 !important;
}

html.docs-wrapper[data-theme='dark'] .theme-doc-sidebar-container {
    background: rgba(2, 6, 23, 0.92) !important;
    border-right-color: rgba(148, 163, 184, 0.18) !important;
}

html.docs-wrapper[data-theme='dark'] .menu__link {
    color: #94a3b8;
}

html.docs-wrapper[data-theme='dark'] .menu__link:hover {
    background: rgba(30, 41, 59, 0.74);
    color: #e2e8f0;
}

html.docs-wrapper[data-theme='dark'] .menu__link--active {
    background: rgba(37, 99, 235, 0.18) !important;
    color: #60a5fa !important;
}

html.docs-wrapper[data-theme='dark'] .breadcrumbs__link,
html.docs-wrapper[data-theme='dark'] .pagination-nav__link,
html.docs-wrapper[data-theme='dark'] .card {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #cbd5e1;
}

html.docs-wrapper[data-theme='dark'] .table-of-contents {
    border-left-color: rgba(148, 163, 184, 0.18);
}

html.docs-wrapper[data-theme='dark'] .table-of-contents__link {
    color: #94a3b8;
}

html.docs-wrapper[data-theme='dark'] .table-of-contents__link:hover,
html.docs-wrapper[data-theme='dark'] .table-of-contents__link--active {
    color: #60a5fa;
}

html.docs-wrapper[data-theme='dark'] .theme-code-block,
html.docs-wrapper[data-theme='dark'] .theme-code-block pre,
html.docs-wrapper[data-theme='dark'] .theme-code-block code {
    background: #111827 !important;
    color: #e5e7eb !important;
}

html.docs-wrapper[data-theme='dark'] .theme-code-block span {
    color: inherit !important;
}

@media (max-width: 996px) {
    .navbar {
        min-height: 3.75rem;
        padding: 0.45rem 0;
    }

    .navbar__inner {
        gap: 0.45rem;
        padding: 0 0.8rem;
        flex-wrap: nowrap;
    }

    .navbar__toggle {
        flex: 0 0 auto;
        margin-right: 0.15rem;
    }

    .navbar__brand {
        flex: 0 0 auto;
        min-width: 0;
        margin-right: 0.2rem;
    }

    .navbar__logo {
        height: 28px;
        margin-right: 0;
    }

    .navbar__title {
        display: none;
    }

    .navbar__items--right {
        --gp-mobile-navbar-control-height: 2.35rem;
        flex: 1 1 auto;
        margin-left: auto;
        min-width: 0;
        align-items: center;
        justify-content: flex-end;
        gap: 0.35rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .navbar__items--right::-webkit-scrollbar {
        display: none;
    }

    .navbar__items--right > .navbar__item.navbar__link {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        height: var(--gp-mobile-navbar-control-height);
        min-height: var(--gp-mobile-navbar-control-height);
        line-height: 1;
        margin: 0;
        white-space: nowrap;
    }

    .navbar-version-link {
        display: none !important;
    }

    .navbar__items--right [class*='colorModeToggle'] {
        display: flex !important;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: var(--gp-mobile-navbar-control-height);
        height: var(--gp-mobile-navbar-control-height);
    }

    .navbar__items--right button.clean-btn[aria-label*="dark and light mode"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: var(--gp-mobile-navbar-control-height) !important;
        min-width: var(--gp-mobile-navbar-control-height) !important;
        height: var(--gp-mobile-navbar-control-height) !important;
        min-height: var(--gp-mobile-navbar-control-height) !important;
        padding: 0 !important;
    }

    [class*='navbarSearchContainer'] {
        position: static !important;
        right: auto;
        display: block !important;
        flex: 0 0 auto;
        width: var(--gp-mobile-navbar-control-height);
        height: var(--gp-mobile-navbar-control-height);
    }

    .DocSearch.DocSearch-Button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box;
        width: var(--gp-mobile-navbar-control-height) !important;
        min-width: var(--gp-mobile-navbar-control-height) !important;
        height: var(--gp-mobile-navbar-control-height) !important;
        min-height: var(--gp-mobile-navbar-control-height) !important;
        padding: 0 !important;
    }

    .DocSearch-Button-Container {
        align-items: center !important;
        justify-content: center !important;
        height: 100%;
        width: 100%;
    }

    .DocSearch-Search-Icon {
        flex: 0 0 auto;
        margin: 0 !important;
    }

    .DocSearch-Button-Placeholder,
    .DocSearch-Button-Keys {
        display: none !important;
    }

    .DocSearch-Input {
        font-size: 16px !important;
        line-height: 1.4 !important;
    }

    .main-wrapper,
    .container,
    .theme-doc-markdown {
        min-width: 0;
    }

    .theme-doc-markdown h1,
    .theme-doc-markdown h2,
    .theme-doc-markdown h3,
    .theme-doc-markdown h4 {
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    .theme-doc-markdown {
        border-radius: 12px;
        padding: 1.35rem;
    }

    .theme-doc-sidebar-container {
        background: var(--gp-doc-surface-strong);
        backdrop-filter: none;
    }
}

@media (max-width: 640px) {
    [class*='navbarSearchContainer'] {
        position: static !important;
        right: auto;
        display: block !important;
    }

    .navbar__items--right {
        justify-content: flex-end;
        gap: 0.25rem;
    }

    .navbar__items--right > .navbar__item.navbar__link {
        display: inline-flex;
        padding: 0.34rem 0.5rem;
        font-size: 0.75rem;
    }

    .navbar__items--right > .navbar__item.navbar__link[href$='/docs/api/intro'] {
        display: none;
    }

    .theme-doc-markdown {
        margin-right: -0.25rem;
        margin-left: -0.25rem;
        padding: 1.1rem;
    }
}
