/* Based on: https://github.com/MrDogeBro/sphinx_rtd_dark_mode */
/* Modified for Cilium theme, includes custom dark mode overrides */

:root {
  --dark-text-color: #c1c1c1;
  --dark-link-color: #249ee8;
  --dark-bg-color: #101010;
}

html[data-theme="dark"] body {
  color: #bfbfbf;
}
html[data-theme="dark"] {
    background-color: var(--dark-bg-color);
}

/* Navbar */
html[data-theme="dark"] .wy-body-for-nav, html[data-theme="dark"] .wy-main-nav .wy-main-nav-menu {
    background: var(--dark-bg-color);
}
html[data-theme="dark"] .w3-card-4, 
html[data-theme="dark"] .w3-hover-shadow:hover {
    box-shadow: 0 4px 10px 0 rgba(255,255,255,0.1), 0 4px 20px 0 rgba(255,255,255,0.05);
}

/* Cilium Logo for Dark Bg */
html[data-theme="dark"] .logo {
    content: url("/asset?u=https%3A%2F%2Fdocs.cilium.io%2Fen%2Fstable%2F_static%2Flogo-dark.svg");
}

/* Header background, border, and all text inside */
html[data-theme="dark"] .wy-header {
    background-color: var(--dark-bg-color);
    border-bottom: 1px solid #2a2a2a;
}

html[data-theme="dark"] .wy-header {
    background-color: var(--dark-bg-color);
    border-bottom: 1px solid #2a2a2a;
    color: var(--dark-text-color);
}

/* All text elements within header */
html[data-theme="dark"] .wy-header *,
html[data-theme="dark"] .wy-header a,
html[data-theme="dark"] .wy-header span,
html[data-theme="dark"] .wy-header div,
html[data-theme="dark"] .wy-header p,
html[data-theme="dark"] .wy-header h1,
html[data-theme="dark"] .wy-header h2,
html[data-theme="dark"] .wy-header h3 {
    color: var(--dark-text-color) !important;
}
html[data-theme="dark"] .w3-button {
  background-color: var(--dark-bg-color) !important;
}

/* GitHub and Slack buttons */
html[data-theme="dark"] a.gh-btn, html[data-theme="dark"] a.gh-count {
    background-image: linear-gradient(to bottom, #404040 0, #2d2d2d 100%);
    border: 1px solid #1a1a1a;
    color: var(--dark-text-color);
}
html[data-theme="dark"] .gh-ico {
  filter: invert(1);
}

/* Fix nav wrapper background */
html[data-theme="dark"] .wy-nav-wrapper {
    background: #0d0d0d;
}

/* Menu vertical headers/captions text color */
html[data-theme="dark"] .wy-menu-vertical header,
html[data-theme="dark"] .wy-menu-vertical p.caption {
    color: var(--dark-text-color);
}

/* Unsetting background and colors as it'll be handled by pygments_dark_style */
html[data-theme="dark"] .rst-content .highlight, html[data-theme="dark"]  pre.literal-block {
  background-color: unset;
  color: unset;
}

html[data-theme="dark"] .wy-nav-content-wrap {
  background-color: #101010;
}

html[data-theme="dark"] .wy-nav-content {
  background-color: #141414;
}

html[data-theme="dark"] .section {
  color: var(--dark-text-color);
}

html[data-theme="dark"] .wy-nav-content a,
html[data-theme="dark"] .wy-nav-content a:visited {
  color: var(--dark-link-color) !important;
}

html[data-theme="dark"] .btn-neutral {
  background-color: #17181c !important;
}

html[data-theme="dark"] .btn-neutral:hover {
  background-color: #101114 !important;
}

html[data-theme="dark"] .btn-neutral:visited {
  color: #c1c1c1 !important;
}

html[data-theme="dark"] .btn {
  box-shadow: none;
}

html[data-theme="dark"] footer {
  color: #bdbdbd;
}

html[data-theme="dark"] .wy-nav-side {
  background-color: #0d0d0d;
}

html[data-theme="dark"] .wy-menu-vertical li.current {
  background-color: #141414;
}

html[data-theme="dark"] .wy-menu-vertical li.current > a,
html[data-theme="dark"] .wy-menu-vertical li.on a {
  background-color: #141415;
  color: var(--dark-text-color);
}

html[data-theme="dark"] .wy-menu-vertical li.toctree-l1.current > a,
html[data-theme="dark"] .wy-menu-vertical li.current a {
  border-color: #0b0c0d;
}

html[data-theme="dark"] .wy-menu-vertical li.current a {
  color: #bbb;
}

html[data-theme="dark"] .wy-menu-vertical li.current a:hover {
  background-color: #222;
}

html[data-theme="dark"] .wy-menu-vertical a:hover,
html[data-theme="dark"] .wy-menu-vertical li.current > a:hover,
html[data-theme="dark"] .wy-menu-vertical li.on a:hover {
  background-color: #1e1e1e;
}

html[data-theme="dark"] .wy-menu-vertical li.toctree-l2.current > a,
html[data-theme="dark"]
  .wy-menu-vertical
  li.toctree-l2.current
  li.toctree-l3
  > a {
  background-color: #18181a;
}

html[data-theme="dark"] .wy-side-nav-search,
html[data-theme="dark"] .rst-versions,
html[data-theme="dark"] .rst-current-version-label,
html[data-theme="dark"] .rst-other-versions {
  background-color: #0b152d;
  color: var(--dark-text-color);
}

html[data-theme="dark"] .rst-versions .rst-other-versions dd a {
  color: var(--dark-text-color);
}

html[data-theme="dark"] .rst-versions .rst-current-version span {
  color: var(--dark-text-color);
}

html[data-theme="dark"] .wy-side-nav-search .wy-dropdown > a,
html[data-theme="dark"] .wy-side-nav-search > a {
  color: #ddd;
}

html[data-theme="dark"] .wy-side-nav-search input[type="text"] {
  border-color: #111;
  background-color: #141414;
  color: var(--dark-text-color);
}

html[data-theme="dark"] .theme-switcher {
  background-color: #0b0c0d;
  color: var(--dark-text-color);
}

html[data-theme="dark"].writer-html4 .rst-content dl:not(.docutils) > dt,
html[data-theme="dark"].writer-html5
  .rst-content
  dl[class]:not(.option-list):not(.field-list):not(.footnote):not(
    .glossary
  ):not(.simple)
  > dt {
  background-color: #0b0b0b;
  color: #007dce;
  border-color: #282828;
}

html[data-theme="dark"] .rst-content code,
html[data-theme="dark"] .rst-content tt {
  color: var(--dark-text-color);
}

html[data-theme="dark"].writer-html4
  .rst-content
  dl:not(.docutils)
  dl:not(.field-list)
  > dt,
html[data-theme="dark"].writer-html5
  .rst-content
  dl[class]:not(.option-list):not(.field-list):not(.footnote):not(
    .glossary
  ):not(.simple)
  dl:not(.field-list)
  > dt {
  background-color: #0f0f0f;
  color: #959595;
  border-color: #2b2b2b;
}

html[data-theme="dark"] .rst-content code,
html[data-theme="dark"] .rst-content tt,
html[data-theme="dark"] code {
  background-color: #2d2d2d;
  border-color: #1c1c1c;
}

html[data-theme="dark"] .rst-content code.xref,
html[data-theme="dark"] .rst-content tt.xref,
html[data-theme="dark"] a .rst-content code,
html[data-theme="dark"] a .rst-content tt {
  color: #cecece;
}

html[data-theme="dark"] .rst-content .hint,
html[data-theme="dark"] .rst-content .important,
html[data-theme="dark"] .rst-content .tip,
html[data-theme="dark"] .rst-content .wy-alert-success.admonition,
html[data-theme="dark"] .rst-content .wy-alert-success.admonition-todo,
html[data-theme="dark"] .rst-content .wy-alert-success.attention,
html[data-theme="dark"] .rst-content .wy-alert-success.caution,
html[data-theme="dark"] .rst-content .wy-alert-success.danger,
html[data-theme="dark"] .rst-content .wy-alert-success.error,
html[data-theme="dark"] .rst-content .wy-alert-success.note,
html[data-theme="dark"] .rst-content .wy-alert-success.seealso,
html[data-theme="dark"] .rst-content .wy-alert-success.warning,
html[data-theme="dark"] .wy-alert.wy-alert-success {
  background-color: #00392e;
}

html[data-theme="dark"] .rst-content .hint .admonition-title,
html[data-theme="dark"] .rst-content .hint .wy-alert-title,
html[data-theme="dark"] .rst-content .important .admonition-title,
html[data-theme="dark"] .rst-content .important .wy-alert-title,
html[data-theme="dark"] .rst-content .tip .admonition-title,
html[data-theme="dark"] .rst-content .tip .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.admonition-todo
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.admonition-todo
  .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.admonition
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.admonition
  .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.attention
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.attention
  .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.caution
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-success.caution .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-success.danger .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-success.danger .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-success.error .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-success.error .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-success.note .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-success.note .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.seealso
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-success.seealso .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-success.warning
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-success.warning .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert.wy-alert-success
  .admonition-title,
html[data-theme="dark"]
  .wy-alert.wy-alert-success
  .rst-content
  .admonition-title,
html[data-theme="dark"] .wy-alert.wy-alert-success .wy-alert-title {
  background-color: #006a56;
}

html[data-theme="dark"] .rst-content .admonition,
html[data-theme="dark"] .rst-content .note,
html[data-theme="dark"] .rst-content .seealso,
html[data-theme="dark"] .rst-content .wy-alert-info.admonition,
html[data-theme="dark"] .rst-content .wy-alert-info.admonition-todo,
html[data-theme="dark"] .rst-content .wy-alert-info.attention,
html[data-theme="dark"] .rst-content .wy-alert-info.caution,
html[data-theme="dark"] .rst-content .wy-alert-info.danger,
html[data-theme="dark"] .rst-content .wy-alert-info.error,
html[data-theme="dark"] .rst-content .wy-alert-info.hint,
html[data-theme="dark"] .rst-content .wy-alert-info.important,
html[data-theme="dark"] .rst-content .wy-alert-info.tip,
html[data-theme="dark"] .rst-content .wy-alert-info.warning,
html[data-theme="dark"] .wy-alert.wy-alert-info {
  background-color: #002c4d;
}

html[data-theme="dark"] .rst-content .admonition .admonition-title,
html[data-theme="dark"] .rst-content .note .admonition-title,
html[data-theme="dark"] .rst-content .note .wy-alert-title,
html[data-theme="dark"] .rst-content .seealso .admonition-title,
html[data-theme="dark"] .rst-content .seealso .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-info.admonition-todo
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-info.admonition-todo
  .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-info.admonition
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.admonition .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.attention .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.attention .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.caution .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.caution .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.danger .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.danger .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.error .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.error .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.hint .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.hint .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.important .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.important .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.tip .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.tip .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-info.warning .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-info.warning .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert.wy-alert-info .admonition-title,
html[data-theme="dark"] .wy-alert.wy-alert-info .rst-content .admonition-title,
html[data-theme="dark"] .wy-alert.wy-alert-info .wy-alert-title {
  background-color: #004a7b;
}

html[data-theme="dark"] .rst-content .admonition-todo,
html[data-theme="dark"] .rst-content .attention,
html[data-theme="dark"] .rst-content .caution,
html[data-theme="dark"] .rst-content .warning,
html[data-theme="dark"] .rst-content .wy-alert-warning.admonition,
html[data-theme="dark"] .rst-content .wy-alert-warning.danger,
html[data-theme="dark"] .rst-content .wy-alert-warning.error,
html[data-theme="dark"] .rst-content .wy-alert-warning.hint,
html[data-theme="dark"] .rst-content .wy-alert-warning.important,
html[data-theme="dark"] .rst-content .wy-alert-warning.note,
html[data-theme="dark"] .rst-content .wy-alert-warning.seealso,
html[data-theme="dark"] .rst-content .wy-alert-warning.tip,
html[data-theme="dark"] .wy-alert.wy-alert-warning {
  background-color: #533500;
}

html[data-theme="dark"] .rst-content .admonition-todo .admonition-title,
html[data-theme="dark"] .rst-content .admonition-todo .wy-alert-title,
html[data-theme="dark"] .rst-content .attention .admonition-title,
html[data-theme="dark"] .rst-content .attention .wy-alert-title,
html[data-theme="dark"] .rst-content .caution .admonition-title,
html[data-theme="dark"] .rst-content .caution .wy-alert-title,
html[data-theme="dark"] .rst-content .warning .admonition-title,
html[data-theme="dark"] .rst-content .warning .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-warning.admonition
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-warning.admonition
  .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.danger .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.danger .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.error .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.error .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.hint .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.hint .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-warning.important
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-warning.important
  .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.note .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.note .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-warning.seealso
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.seealso .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.tip .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-warning.tip .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert.wy-alert-warning
  .admonition-title,
html[data-theme="dark"]
  .wy-alert.wy-alert-warning
  .rst-content
  .admonition-title,
html[data-theme="dark"] .wy-alert.wy-alert-warning .wy-alert-title {
  background-color: #803b00;
}

html[data-theme="dark"] .rst-content .danger,
html[data-theme="dark"] .rst-content .error,
html[data-theme="dark"] .rst-content .wy-alert-danger.admonition,
html[data-theme="dark"] .rst-content .wy-alert-danger.admonition-todo,
html[data-theme="dark"] .rst-content .wy-alert-danger.attention,
html[data-theme="dark"] .rst-content .wy-alert-danger.caution,
html[data-theme="dark"] .rst-content .wy-alert-danger.hint,
html[data-theme="dark"] .rst-content .wy-alert-danger.important,
html[data-theme="dark"] .rst-content .wy-alert-danger.note,
html[data-theme="dark"] .rst-content .wy-alert-danger.seealso,
html[data-theme="dark"] .rst-content .wy-alert-danger.tip,
html[data-theme="dark"] .rst-content .wy-alert-danger.warning,
html[data-theme="dark"] .wy-alert.wy-alert-danger {
  background-color: #82231a;
}

html[data-theme="dark"] .rst-content .danger .admonition-title,
html[data-theme="dark"] .rst-content .danger .wy-alert-title,
html[data-theme="dark"] .rst-content .error .admonition-title,
html[data-theme="dark"] .rst-content .error .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-danger.admonition-todo
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-danger.admonition-todo
  .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-danger.admonition
  .admonition-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-danger.admonition
  .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-danger.attention
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.attention .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.caution .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.caution .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.hint .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.hint .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert-danger.important
  .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.important .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.note .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.note .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.seealso .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.seealso .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.tip .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.tip .wy-alert-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.warning .admonition-title,
html[data-theme="dark"] .rst-content .wy-alert-danger.warning .wy-alert-title,
html[data-theme="dark"]
  .rst-content
  .wy-alert.wy-alert-danger
  .admonition-title,
html[data-theme="dark"]
  .wy-alert.wy-alert-danger
  .rst-content
  .admonition-title,
html[data-theme="dark"] .wy-alert.wy-alert-danger .wy-alert-title {
  background-color: #b9372b;
}

html[data-theme="dark"] .wy-nav-top {
  background-color: #0b152d;
}

html[data-theme="dark"] .rst-content table.docutils thead,
html[data-theme="dark"] .rst-content table.field-list thead,
html[data-theme="dark"] .wy-table thead {
  color: var(--dark-text-color);
}

html[data-theme="dark"]
  .rst-content
  table.docutils:not(.field-list)
  tr:nth-child(2n-1)
  td,
html[data-theme="dark"] .wy-table-backed,
html[data-theme="dark"] html[data-theme="dark"] .wy-table-odd td,
html[data-theme="dark"] .wy-table-striped tr:nth-child(2n-1) td {
  background-color: #181818;
}

html[data-theme="dark"] .rst-content table.docutils td,
html[data-theme="dark"] .wy-table-bordered-all td,
html[data-theme="dark"].writer-html5 .rst-content table.docutils th,
html[data-theme="dark"] .rst-content table.docutils,
html[data-theme="dark"] .wy-table-bordered-all {
  border-color: #262626;
}

html[data-theme="dark"] .rst-content table.docutils caption,
html[data-theme="dark"] .rst-content table.field-list caption,
html[data-theme="dark"] .wy-table caption {
  color: var(--dark-text-color);
}

html[data-theme="dark"] .wy-menu-vertical li.toctree-l3.current > a,
html[data-theme="dark"]
  .wy-menu-vertical
  li.toctree-l3.current
  li.toctree-l4
  > a {
  background-color: #18181a;
}

html[data-theme="dark"] .guilabel {
  background-color: #343434;
  border-color: #4d4d4d;
}
