/*
 * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 * Modified for XR/Spatial Computing theme
 */

/* --- root styles --- */
:root {
    --default-gray: #f0f2f8;
    --default-font-color: #1a1d2e;
    --header-font-color: var(--default-font-color);

    --hover-link-color: #6366f1;
    --xr-primary: #7e78e3;
    --xr-secondary: #06b6d4;
    --xr-accent: #3b82f6;
    --xr-glow: rgba(126, 120, 227, 0.3);

    --color-scrollbar: rgba(99, 102, 241, 0.5);
    --color-scrollbar-track: var(--default-gray);
    --default-white: #ffffff;
    --background-color: #fafbff;
    --dark-mode-and-search-icon-color: var(--default-white);
    --color-dark: #1a1d2e;
    --default-font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, Arial, sans-serif;
    --default-monospace-font-family: JetBrains Mono, SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;
    --default-font-size: 16px;
    --blockquote-background: rgba(126, 120, 227, 0.05);
    --border-color: rgba(99, 102, 241, 0.15);
    --navigation-highlight-color: rgba(126, 120, 227, 0.08);
    --top-navigation-height: 60px;
    --white-10: hsla(0, 0%, 100%, .1);

    --active-tab-border-color: var(--xr-primary);
    --inactive-tab-border-color: rgba(126, 120, 227, 0.3);

    --active-section-color: var(--xr-primary);
    --inactive-section-color: rgba(26, 29, 46, 0.6);

    --sidemenu-section-active-color: var(--xr-primary);

    --color-key-blue: var(--xr-primary);
}

html {
    height: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    scrollbar-color: var(--color-scrollbar) var(--color-scrollbar-track);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    color: var(--default-font-color);
}

html ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html ::-webkit-scrollbar-track {
    background-color: var(--color-scrollbar-track);
}

html ::-webkit-scrollbar-thumb {
    width: 8px;
    border-radius: 6px;
    background: var(--color-scrollbar);
    transition: background 0.3s ease;
}

html ::-webkit-scrollbar-thumb:hover {
    background: var(--xr-primary);
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    background: var(--background-color);
}

/* Ensure consistent background colors */
div.table,
.divergent-group,
.cover,
.main-content,
#main,
.table-row,
.main-subrow {
    background-color: var(--background-color) !important;
}

/* /--- root styles --- */

/* --- global tags styles --- */

h1 {
    font-size: 44px;
    line-height: 52px;
    margin-bottom: 24px;
    margin-top: 48px;
    background: linear-gradient(135deg, var(--xr-primary) 0%, var(--xr-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

h2 {
    font-size: 32px;
    line-height: 32px;
    margin-bottom: 24px;
    margin-top: 48px;
    font-weight: 600;
}

h3 {
    font-size: 24px;
    line-height: 24px;
    margin-bottom: 24px;
    margin-top: 48px;
    font-weight: 600;
}

h4, h5 {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 24px;
    margin-top: 24px;
    font-weight: 600;
}

p, ul, ol, table, pre, dl {
    margin: 0;
}

u {
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

u:hover {
    border-bottom-color: var(--xr-secondary);
}

blockquote {
    border-left: 3px solid var(--xr-primary);
    margin: 0;
    padding-left: 1ch;
    font-style: normal;
    color: var(--color-dark);
    background: var(--blockquote-background);
    border-radius: 0 4px 4px 0;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

blockquote:hover {
    box-shadow: -3px 0 0 0 var(--xr-secondary);
    border-left-color: var(--xr-secondary);
}

.theme-dark blockquote {
    color: var(--default-font-color);
    border-left-color: var(--xr-primary);
}

pre {
    display: block;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

pre:hover {
    box-shadow: 0 0 20px var(--xr-glow);
}

dt {
    color: #444;
}

img {
    max-width: 100%;
}

/* /---  global tags styles --- */

/* ---  utils classes --- */
.w-100 {
    width: 100%;
}

.no-gutters {
    margin: 0;
    padding: 0;
}

.d-flex {
    display: flex;
}

.floating-right {
    float: right;
}

.pull-right {
    float: right;
    margin-left: auto
}

.clearfix::after {
    display: block;
    content: '';
    clear: both;
    height: 0;
}

/* /---  utils classes --- */

/* ---dark theme --- */
.theme-dark {
    --background-color: #0f1117;
    --color-dark: #1e2139;
    --default-font-color: rgba(255, 255, 255, 0.92);
    --border-color: rgba(126, 120, 227, 0.2);
    --blockquote-background: rgba(126, 120, 227, 0.08);
    --copy-icon-color: hsla(0, 0%, 100%, 0.6);
    --copy-icon-hover-color: #fff;

    --active-tab-border-color: var(--xr-primary);
    --inactive-tab-border-color: rgba(126, 120, 227, 0.4);

    --active-section-color: var(--default-font-color);
    --inactive-section-color: rgba(255, 255, 255, 0.5);

    --navigation-highlight-color: rgba(126, 120, 227, 0.12);
    --footer-background: rgba(126, 120, 227, 0.05);
    --footer-font-color: rgba(255, 255, 255, 0.7);
    --footer-go-to-top-color: var(--footer-font-color);

    --sidemenu-section-active-color: var(--xr-primary);
    --default-gray: #1a1d2e;

    --color-scrollbar: rgba(126, 120, 227, 0.6);
    --color-scrollbar-track: var(--default-gray);
}

.theme-dark h1 {
    background: linear-gradient(135deg, #a78bfa 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* /---dark theme --- */

.main-content :is(h1, h2) {
    font-weight: 600;
}

.cover > .platform-hinted {
    margin-bottom: 24px;
}

.cover {
    display: flex;
    flex-direction: column;
}

.cover .sourceset-dependent-content > .block {
    padding: 16px 0;
    font-size: 18px;
    line-height: 28px;
}

.cover .platform-hinted.with-platform-tabs .sourceset-dependent-content > .block {
    padding: 0;
    font-size: var(--default-font-size);
}

.cover ~ .divergent-group {
    margin-top: 24px;
    padding: 24px 8px 8px 8px;
}

.cover ~ .divergent-group .main-subrow .symbol {
    width: 100%;
}

.main-content p.paragraph,
.sample-container, blockquote,
.content > .symbol {
    margin-top: 8px;
}

blockquote,
.content > .symbol:first-of-type,
p.paragraph:first-child,
.brief p.paragraph {
    margin-top: 0;
}

.content .kdoc-tag > p.paragraph {
    margin-top: 0;
}

.divergent-group {
    background-color: transparent;
    padding: 16px 0 8px 0;
    margin-bottom: 2px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.divergent-group:hover {
    background-color: var(--navigation-highlight-color);
}

.divergent-group .table-row, tbody > tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.divergent-group .table-row:hover, tbody > tr:hover {
    background-color: var(--navigation-highlight-color);
}

.divergent-group .table-row:last-of-type, tbody > tr:last-of-type {
    border-bottom: none;
}

.title > .divergent-group:first-of-type {
    padding-top: 0;
}

.strikethrough {
    text-decoration: line-through;
}

@-moz-document url-prefix() {
    .strikethrough {
        position: relative;
        text-decoration: none;
    }

    .strikethrough::after, .strikethrough span:after  {
        content: '';
        position: absolute;
        top: 7px;
        left: 0;
        right: 0;
        height: 1px;
        background-color: currentColor;
        z-index: 1;
    }
}

.symbol:empty {
    padding: 0;
}

.brief {
    white-space: pre-wrap;
    overflow: hidden;
}

h1.cover {
    margin-bottom: 24px;
    display: block;
}

@media (max-width: 899px) {
    h1.cover {
        font-size: 32px;
        line-height: 32px;
        margin-bottom: 24px;
    }
}

.UnderCoverText table {
    margin: 8px 0 8px 0;
    word-break: break-word;
}

@media (max-width: 960px) {
    .UnderCoverText table {
        display: block;
        word-break: normal;
        overflow: auto;
    }
}

p.paragraph img {
    display: block;
}

.deprecation-content {
    margin: 16px 0;
    border: 2px solid var(--xr-primary);
    padding: 16px;
    border-radius: 8px;
    background: var(--blockquote-background);
    transition: all 0.3s ease;
}

.deprecation-content:hover {
    box-shadow: 0 0 20px var(--xr-glow);
}

.deprecation-content > h3 {
    margin-top: 0;
    margin-bottom: 0;
}

.deprecation-content > h4 {
    font-size: 16px;
    margin-top: 16px;
    margin-bottom: 0;
}

.deprecation-content .footnote {
    display: block;
}

.deprecation-content .footnote > p {
    margin: 0;
}

[data-filterable-current=''] {
    display: none !important;
}

.inline-flex {
    display: inline-flex;
}

#content > div:not(.tabbedcontent) .sourceset-dependent-content:not([data-active]) {
    display: block !important;
    visibility: hidden;
    height: 0;
    position: fixed;
    top: 0;
}

.with-platform-tags {
    display: flex;
}

.with-platform-tags ~ .main-subrow {
    padding-top: 8px;
}

.cover .with-platform-tabs {
    font-size: var(--default-font-size);
}

.cover > .block {
    padding-top: 48px;
    padding-bottom: 24px;
    font-size: 18px;
    line-height: 28px;
}

.cover > .block:empty {
    padding-bottom: 0;
}

.parameters.wrapped > .parameter {
    display: block;
}

.platform-dependent-row {
    display: grid;
    padding-top: 8px;
}

@media print, (max-width: 960px) {
    div.wrapper {
        width: auto;
        margin: 0;
    }

    header, section, footer {
        float: none;
        position: static;
        width: auto;
    }

    header {
        padding-right: 320px;
    }

    section {
        border: 1px solid #e5e5e5;
        border-width: 1px 0;
        padding: 20px 0;
        margin: 0 0 20px;
    }

    header a small {
        display: inline;
    }

    header ul {
        position: absolute;
        right: 50px;
        top: 52px;
    }
}

.anchor-highlight {
    border: 2px solid var(--xr-primary) !important;
    box-shadow: 0 0 20px var(--xr-glow);
    margin-top: 0.2em;
    margin-bottom: 0.2em;
    border-radius: 4px;
}

.filtered-message {
    margin: 25px;
    font-size: 20px;
    font-weight: 600;
}

div.runnablesample {
    height: fit-content;
}

/* XR Enhancement Effects */
a {
    transition: color 0.2s ease;
}

a:hover {
    color: var(--xr-primary);
}

table {
    transition: none;
}

button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Sidebar active state with XR theme */
.sidebar a[data-active],
.sidebar .overview > a[data-active] {
    color: var(--xr-primary) !important;
    background-color: var(--navigation-highlight-color);
    border-left: 3px solid var(--xr-primary);
    font-weight: 600;
}

.theme-dark .sidebar a[data-active],
.theme-dark .sidebar .overview > a[data-active] {
    color: #a78bfa !important;
    border-left-color: #a78bfa;
}

/* Footer go-to-top link colors */
#go-to-top-link {
    color: #7e78e3 !important;
}

.theme-dark #go-to-top-link {
    color: #7e78e3 !important;
}

#go-to-top-link:hover {
    color: #06b6d4 !important;
}

.theme-dark #go-to-top-link:hover {
    color: #22d3ee !important;
}

/* Force all code-related elements to be normal font style */
.token, 
.symbol, 
.monospace,
.parameters,
.parameter,
.brief,
.block,
code, 
pre,
i,
em,
span[class*="token"],
.main-content .token,
.main-content .symbol,
.main-content .monospace,
.main-content code,
.main-content pre,
.symbol *,
code *,
pre *,
.parameter *,
.brief * {
    font-style: normal !important;
}

/* Fix parameter table link styling to match constructor/property style */
.table-row a,
.parameters a,
div[data-togglable="Parameters"] a,
.parameters-list a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease;
}

.theme-dark .table-row a,
.theme-dark .parameters a,
.theme-dark div[data-togglable="Parameters"] a {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}