/* ========== Общие стили ========== */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono&family=Lexend:wght@400;500;600&family=Inter:wght@300;500;600&display=swap');

.theme-light, .theme-dark {
  /* ========== Текст ========== */
  #app, .navbar, .vp-sidebar {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
  }

  .content, div.page-nav {
    margin: 0 auto 0 140px;
  }

  /* ========== Заголовки ========== */
  h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    color: inherit;
    word-break: break-word;
    font-weight: 500 !important;
  }

  h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    font-weight: inherit;
  }

  h1 {
    font-size: 48px;
    letter-spacing: -0.08em;
  }

  h2 {
    margin-top: 40px;
    font-size: 32px;
    border-bottom: none;
  }

  #project-workflow h4,
  .workflow h4 {
    padding-bottom: 26px;
    border-bottom: 1px solid #646464;
  }

  /* ========== Текст ========== */
  p {
    font-family: 'Inter', sans-serif;
  }

  .site-name {
    font-weight: 300 !important;
  }

  /* ========== Навигация ========== */
  .vp-sidebar {
    margin-top: 32px;
  }

  .vp-sidebar .searchbox {
    border-bottom: none;
  }

  .navbar img {
    width: 100px;
  }

  .navbar .home-link {
    display: flex;
  }

  .navbar-handler {
    display: flex;
    align-items: center;
    width: 1248px;
    padding: 0 24px;
    border-radius: 62px;
  }

  .navbar .links {
    position: static;
    margin-left: 330px;
  }

  .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 48px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.21;
    border-radius: 40px;
    transition: 0.2s;
    border-bottom: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-link.router-link-active {
    font-weight: 400;
    color: #0c0c0c !important;
    background-color: #fff844;
  }

  .nav-item__disabled {
    pointer-events: none;
    opacity: 0.3;
  }

  /* ========== Ссылки ========== */
  .vp-sidebar .toctree-l1 {
    margin-left: 15px;
  }

  .vp-sidebar .toctree-l1.current a {
    border: none;
  }

  .vp-sidebar .toctree-l2 > .reference {
    padding-left: 40px !important;
  }

  .reference, .internal {
    color: #B57BFF;
  }

  /* ========== Списки ========== */
  ul:not(.vp-sidebar *):not(ul ul):not(.page-nav) {
    margin-left: 32px;
  }

  #project-workflow, .workflow {
    padding: 16px 32px;
    border-radius: 16px;
    background-color: #303030;
  }

  #project-workflow ol,
  .workflow ol {
    counter-reset: list-counter;
  }

  #project-workflow ol > li,
  .workflow ol > li {
    list-style: none;
    position: relative;
    padding-left: 32px;
  }

  #project-workflow ol > li::before,
  .workflow ol > li::before {
    content: counter(list-counter);
    counter-increment: list-counter;
    color: #B57BFF;
    font-weight: bold;
    border: 1px solid #B57BFF;
    border-radius: 50%;
    background-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
    position: absolute;
    left: 0;
    top: 5px;
  }

  /* ========== Кодовые блоки ========== */
  .content .highlight pre {
    background-color: #1A1A1A;
  }

  .content pre, .content .highlight {
    border-radius: 16px;
  }

  .highlight, .code-toolbar {
    position: relative;
  }

  .code-toolbar .toolbar {
    position: absolute;
    right: 0px;
    display: flex;
    justify-content: end;
  }

  .code-toolbar .toolbar button {
    display: inline-flex;
    align-items: center;
    margin: 8px;
    padding: 4px;
    background: #0C0C0C;
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }

  /* ========== Поиск ========== */
  .searchformwrapper {
    margin-top: 10px;
    position: relative;
    max-width: 215px;
  }

  input[name="q"] {
    width: 100%;
    max-width: 350px;
    padding: 10px 40px 10px 15px;
    border-radius: 8px;
    font-size: 16px;
  }

  input[type="text"]::placeholder {
    color: #888;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
  }

  input[value="Search"], input[value="search"] {
    display: none;
  }

  /* ========== Переключатель темы ========== */
  .darkmode-switch .item .icon {
    fill: #B57BFF !important;
  }

  .darkmode-switch .item.active .icon {
    fill: #fff!important;
  }

  .darkmode-switch .active {
    background-color: #B57BFF !important;
  }

  .darkmode-switch .item {
    border-color: #B57BFF !important;
  }

  .darkmode-switch .item:first-child {
    border-left: 1px solid #B57BFF !important;
  }

  /* ========== Разное ========== */
  img {
    max-width: 100%;
  }

  img.horizontal {
    width: 750px;
  }
  
  img.vertical {
    width: 531px;
  }

  img:not(.home-link *) {
    margin-top: 24px;
    border-radius: 16px;
  }

  .home-link img {
    margin-top: 0;
  }

  .body-header .page-nav {
    display: none;
  }

  .page-edit, .page-nav {
    max-width: 850px !important;
    padding: 0;
  }

  .toctree-wrapper .caption {
    margin: 40px 0 0 0;
    border-bottom: none;
    font-weight: 500;
  }

  .admonition {
    padding: 16px !important;
    background-color: #1A1A1A !important;
    border-radius: 4px !important;
    border-left-width: 4px !important;
  }

  .admonition p {
    color: white !important;
  }

  .admonition > :last-child {
    margin-bottom: 0 !important;
  }

  .admonition .admonition-title + * {
    margin-top: 0 !important;
  }

  a + p em {
    color: #A9A7A7;
  }

  .admonition .admonition-title {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  .admonition.warning {
    border-color: #FD3F40 !important;
  }

  .admonition.attention {
    border-color: #FF885A !important;
  }

  .admonition.note {
    border-color: #5E9CFB !important;
  }

  .admonition.warning .admonition-title {
    color: #FD3F40 !important;
  }

  .admonition.note .admonition-title {
    color: #5E9CFB !important;
  }

  .attention.attention .admonition-title {
    color: #FF885A !important;
  }

  /* Сигнатура функции */
  .py.function .sig,
  .py.class .sig,
  .py.class .py.method .sig {
    padding: 16px 20px;
    border-radius: 4px;
    border-left: 4px solid #B57BFF;
    border-top: none;
    margin: 16px 0;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    line-height: 24px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    /* Висячий отступ для переносов строк */
    text-indent: -80px;
    padding-left: 100px;
  }

  .py.class .py.method .sig,
  .py.function .sig {
    text-indent: 2px;
    padding-left: 16px;
  }

  .py.class .sig {
    border-left: none;
    border-top: 4px solid #B57BFF;
  }

  .py.function .sig .sig-prename,
  .py.function .sig .sig-name,
  .py.function .sig .sig-paren,
  .py.function .sig .sig-param,
  .py.function .sig-name.descname,
  .py.class .sig .sig-prename,
  .py.class .sig .sig-name,
  .py.class .sig .sig-paren,
  .py.class .sig .sig-param,
  .py.class .sig-name.descname {
    font-weight: 400;
    font-size: 14px;
    font-family: 'DM Mono', monospace;
  }

  .py.class .sig .property {
    display: block;
    height: 0 !important;
    text-transform: uppercase;
    font-style: normal;
    font-weight: 400;
  }

  .py.function dt,
  .py.class dt {
    width: 100px;
  }

  .py.function .field-odd .simple,
  .py.class .field-odd .simple {
    margin-left: 0 !important;
  }

  .py.function dd,
  .py.class dd {
    margin-left: 72px;
  }

  .py.function dd.field-odd,
  .py.class dd.field-odd,
  .py.function dd.field-even,
  .py.class dd.field-even {
    margin: 24px 0 0 0 !important;
  }

  dl.method, dl.function {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
  }

  /* Цветные типы в сигнатуре */
  .py.function .sig .sig-param em {
    color: #B57BFF !important;
    font-style: normal;
  }

  .py.function .reference.internal,
  .py.class .reference.internal {
    font-weight: 500;
  }

  .field-list.simple {
    margin-top: 16px;
  }

  /* Заголовки секций документации */
  .field-list .field-odd .field-name,
  .field-list .field-even .field-name {
    font-weight: 600 !important;
    font-size: 16px;
    margin-bottom: 8px;
  }

  /* Альтернативный селектор для заголовков секций */
  .field-list dt {
    font-weight: 600 !important;
    font-size: 16px;
    margin-bottom: 8px;
    padding-left: 0px !important;
  }

  .field-list dt::after {
    content: none !important;
  }

  /* Список параметров */
  .field-list .field-body ul li {
    margin-bottom: 8px;
  }

  .field-list .field-body ul li strong {
    font-weight: 600;
  }

  /* Ссылки в типах возврата */
  .field-list .field-body .reference {
    text-decoration: none;
    color: #B57BFF !important;
  }

  .field-list .field-body .reference:hover {
    color: #9966CC !important;
  }
}

.theme-light {
  #app, .navbar, .vp-sidebar {
    color: #0C0C0C;
  }

  /* ========== Ссылки ========== */
  a {
    color: #B57BFF;
    font-weight: 300;
  }

  h2 a, h3 a, h4 a, h5 a {
    color: #0C0C0C;
  }

  .vp-sidebar a {
    color: #0C0C0C;
  }

  .sidebar-group a {
    font-weight: 500;
  }

  .vp-sidebar .toctree-l1 a, .vp-sidebar .toctree-l2 a {
    color: #646464;
  }

  .vp-sidebar .toctree-l1 a.current, .vp-sidebar .toctree-l2 a.current {
    color: #929292;
  }

  .toctree-l1 a:visited, .toctree-l2 a:visited {
    color: #646464;
  }

  .sidebar-links .toctree-l1 a:visited, .sidebar-links .toctree-l2 a:visited {
    color: #9F9F9F;
  }

  .vp-sidebar .toctree-l1 a:hover, .vp-sidebar .toctree-l2 a:hover {
    color: #0C0C0C;
  }

  .reference:hover, .internal:hover, .next a:hover, .prev a:hover {
    color: #7C19FB;
    transition: 0.3s;
  }

  /* ========== Навигация ========== */
  .navbar {
    height: 58px;
    padding: 6px 0;
    border-bottom: none;
  }

  .nav-link {
    color: #0C0C0C !important;
  }

  /* ========== Поиск ========== */
  input[name="q"] {
    border: none;
    background-color: #F3F3F3;
    color: #222;
  }

   /* ========== Списки ========== */
  #project-workflow, .workflow {
    background-color: #e5e5e5;
  }

  /* ========== Разное ========== */
  .breadcrumbs li a {
    color: #1A1A1A;
  }

  .breadcrumbs li:last-of-type {
    color: #9F9F9F;
  }

  .admonition {
    background-color: #E5E5E5 !important;
  }

  .admonition p {
    color: #151515 !important;
  }

  .content .highlight pre,
  .content pre,
  .content .highlight {
    background-color: #e5e5e5 !important;
    color: #222 !important;
    border-radius: 16px;
  }

  .copy-btn {
    height: 32px;
    width: 32px;
    background-color: #fff !important;
    border-radius: 8px !important;
  }

  .copy-btn:has(.check-icon) {
    color: #0c0c0c !important;
    background-color: #fff !important;
  }

  .copy-icon path {
    stroke: #0c0c0c !important;
  }

  /* ========== Функции ========== */
  .py.function .sig,
  .py.class .sig,
  .py.class .py.method .sig {
    background-color: #E5E5E5 !important;
    color: #303030 !important;
  }

  .py.function .sig .sig-prename,
  .py.function .sig .sig-name,
  .py.function .sig .sig-paren,
  .py.function .sig .sig-param,
  .py.function .sig-name.descname,
  .py.class .sig .sig-prename,
  .py.class .sig .sig-name,
  .py.class .sig .sig-paren,
  .py.class .sig .sig-param,
  .py.class .sig-name.descname {
    color: #0C0C0C !important;
  }

  .py.class .sig .property {
    color: #0C0C0C !important;
  }

  /* Альтернативный селектор для заголовков секций */
  .field-list dt {
    color: #0C0C0C !important;
  }

  .field-list .field-body ul li strong {
    color: #0C0C0C !important;
  }

  blockquote ul.simple,
  blockquote ul.simple li,
  blockquote ul.simple li p {
    color: #303030 !important;
  }
}

.theme-dark {
  background-color: #151515;

  #app, .navbar, .vp-sidebar {
    color: white;
    background-color: #151515;
  }

  /* ========== Заголовки ========== */
  h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
  }

  /* ========== Ссылки ========== */
  a {
    color: white;
    font-weight: 300;
  }

  .vp-sidebar a {
    color: white;
  }

  .vp-sidebar .searchbox {
    font-weight: 300;
  }

  .vp-sidebar .caption a {
    font-weight: 500;
  }

  .vp-sidebar .toctree-l1 a, .vp-sidebar .toctree-l2 a {
    color: #A9A7A7;
    font-weight: 300;
  }

  .vp-sidebar .toctree-l1 a:hover, .vp-sidebar .toctree-l2 a:hover {
    color: #FFFFFF;
  }

  .vp-sidebar .toctree-l1 a.current, .vp-sidebar .toctree-l2 a.current {
    color: white;
    font-weight: 500 !important;
  }

  .toctree-l1 a:visited, .toctree-l2 a:visited {
    color: #646464;
  }

  /* ========== Навигация ========== */
  .navbar {
    height: 96px;
    padding: 16px 0;
    border-bottom: 1px solid #151515;
  }

  .navbar-handler {
    height: 64px;
    margin: 0 auto;
    background-color: #1A1A1A;
  }

  .nav-link {
    color: #ffffff !important;
  }

  .nav-link:not(.router-link-active):hover {
    background-color: #575757;
  }

  /* ========== Поиск ========== */
  input[name="q"] {
    border: 1px solid #444;
    background-color: #222;
    color: #ddd;
  }

   /* ========== Кодовые блоки ========== */
  .content code {
    color: #5e9cfb;
    background-color: #0c0c0c;
  }

  /* ========== Разное ========== */
  .page {
    margin-top: 16px;
  }

  .breadcrumbs li:last-of-type {
    color: #646464;
  }

  /* ========== Функции ========== */
  .py.function .sig,
  .py.class .sig,
  .py.class .py.method .sig {
    background-color: #1A1A1A !important;
    color: #ffffff !important;
  }

  .py.function .sig .sig-prename,
  .py.function .sig .sig-name,
  .py.function .sig .sig-paren,
  .py.function .sig .sig-param,
  .py.function .sig-name.descname,
  .py.class .sig .sig-prename,
  .py.class .sig .sig-name,
  .py.class .sig .sig-paren,
  .py.class .sig .sig-param,
  .py.class .sig-name.descname {
    color: #D9D9D9 !important;
  }

  .py.class .sig .property {
    color: #D9D9D9 !important;
  }

  /* Альтернативный селектор для заголовков секций */
  .field-list dt {
    color: white !important;
  }

  .field-list .field-body ul li strong {
    color: #ffffff !important;
  }
}

body::-webkit-scrollbar, .theme-dark *::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background-color: #303030 !important;
  border-radius: 8px;
}

body::-webkit-scrollbar-thumb, .theme-dark *::-webkit-scrollbar-thumb {
  background-color: white !important;
  border-radius: 8px;
}

.theme-container {
  padding-top: 16px;
}

@media screen and (max-width: 767px) {
  .search div {
    max-width: 95% !important; 
  }
  
  input[name="q"] {
    max-width: 82%;
    padding-right: 16px !important;
  }

  /* ========== Навигация ========== */
  .content, div.page-nav {
    margin: 0 auto 0 0 !important;
  }

  .navbar-handler {
    position: relative !important;
    width: auto !important;
    height: 100% !important;
  }

  .sidebar-button {
    right: 16px;
    top: auto;
    left: auto;
  }

  .theme-dark .navbar {
    padding: 8px !important;
    height: 72px !important;
  }

  .home-link {
    flex-shrink: 0;
  }

  /* ========== Списки ========== */
  #project-workflow, .workflow {
    padding: 16px !important;
  }
}
