$ddpurple: #632ca6;
$ddgray: #d6d6d6;
$studioViolet: #7847a6;
$lightGreyGrey: #d6d6d6;
$darkGreyGrey: #a1a1a1;
$dimGreyGrey: #707070;

:root {
    --bs-link-hover-color: #{$ddpurple};
}

html {
    font-size: 18px;
    opacity: 1 !important;
    transition: opacity 0.3s ease-in;
}

body {
    font-family: $font-family-sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: 'kern' 1;

    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-kerning: normal;
    -moz-font-feature-settings: 'lnum' 1, 'frac' 0, 'liga' 1, 'clig' 1;
    -moz-font-feature-settings: 'lnum=1, frac=0, liga=1, clig=1';
    -ms-font-feature-settings: 'lnum' 1, 'frac' 0, 'liga' 1, 'clig' 1;
    -o-font-feature-settings: 'lnum' 1, 'frac' 0, 'liga' 1, 'clig' 1;
    -webkit-font-feature-settings: 'lnum' 1, 'frac' 0, 'liga' 1, 'clig' 1;
    font-feature-settings: 'lnum' 1, 'frac' 0, 'liga' 1, 'clig' 1;
    /** "ss01" 1 is for the alternate 'a' character */
    /** "ss05" 1 is for alternate 'y' character */
    font-weight: 200;
    word-wrap: break-word;
}

iframe {
    border: none;
}

.banner body {
    //padding-top: 159px;

    @include media-breakpoint-between(md, lg) {
        padding-top: 130px;
    }
}

body {
    padding-top: 129px;

    @media (max-width: 991px) {
        padding-top: 65px;
    }
    // Restores previous positioning setting for bootstrap columns from bootstrap 4
    div[class*='col-'] {
        position: relative;
    }
}
.chroma {
    max-height: 350px;
    overflow-wrap: break-word;
    white-space: inherit;
}
.greyside {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    .grey {
        &:before,
        &:after {
            content: '';
            position: absolute;
            margin-left: -2000px;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            background: #f8f8f8;
            z-index: -1;
            height: 100%;
        }
        &:after {
            background: #f2f2f2;
            height: 50px;
        }
    }
}

strong {
    font-weight: 600;
}

a {
    color: #000;
}

button:focus,
a:focus {
    outline: none !important;
}

.custom-select {
    width: 100%;
    background-color: #fff;
    color: $ddpurple;
    /*border-color: $ddpurple;*/
    border-color: $ddpurple;
    font-weight: 600;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-align: center;
    height: 50px;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
    text-align-last: center;
    &:focus {
        border-color: $ddpurple;
        outline: none;
    }
}

// standard code highlighting
// todo: do we want all code blocks like this or just ones on api, move this
pre {
    display: block;
    padding: 10px;
    margin: 0;
    position: relative;
    font-size: 14px;
    line-height: 1.428571429;
    color: #000000;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
    border-top: 3px solid rgba(119, 0, 255, 0.3);
    font-family: $font-family-monospace;
    word-break: normal;
    word-wrap: normal;
    overflow: auto;

    // .api &{
    //   border: 1px solid transparent;
    // }
    code {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        padding: 0;
        font-size: 14px;
        line-height: 27px;
        color: #555555;
        white-space: pre;
        background-color: transparent;
        border-radius: 0;
        border: none;
        font-family: $font-family-monospace;
    }
}

tbody {
    code {
        word-wrap: normal;
        word-break: break-word;
    }
}

code {
    color: #555555;
    padding: 0 5px;
    font-size: 14px;
    background-color: #f2f2f2;
    border-radius: 4px;
    display: inline;
    white-space: normal;
    /*font-family: 'Source Code Pro', monospace;*/
    font-family: $font-family-monospace;
  &.language-shell {
    .line {
      &:before {
        content: '$ ';
        display: inline;
      }
    }
    .line ~ .line {
      &:before {
        content: '  ';
      }
    }
  }
}

h2 code {
    @include font-size($h3-font-size);
}

code + code.region-param {
    padding: 0 5px 0 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

details {
    margin-bottom: 1.5rem;

    summary {
        h1,
        h2,
        h3,
        h4,
        h5 {
            display: inline-block;
        }

        &:focus {
            outline: none;
        }
    }
}

.programming-lang-wrapper {
    .code-snippet-wrapper.tab-pane {
        display: none;
    }
    .code-snippet-wrapper.tab-pane.active.show {
        display: block;
    }
}

.code-snippet-wrapper {
    padding-right: 0 !important;
    position: relative;
    margin-bottom: 24px;

    .code-snippet {
        position: relative;
        padding-right: 0 !important;
        pre {
            padding: 10px;
        }
        code {
            white-space: pre;
        }
        &.wrap {
            code {
                white-space: normal !important;
            }
        }
        &:hover {
            .code-button-wrapper {
                opacity: 1;
            }
        }
        .code-button-wrapper {
            opacity: 0;
            right: 0;
            top: 0;
            padding: .5rem .5rem 0 0;
            transition: opacity 0.2s ease-in-out;
            z-index: 1;
            button {
                background-color: $white;
                box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.25);
                border-radius: 4px;
                padding: 2px 12px 3px 12px;
                transition: box-shadow 0.2s ease-in-out;
                &:hover {
                    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.45);
                }
                &:active,
                &:focus {
                    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.45) !important;
                }
            }
        }
    }
}

.code-snippet.js-appended-copy-btn {
    position: relative;
    padding-right: 0 !important;
    pre {
        padding: 10px;
    }
    code {
        white-space: pre;
    }
    &.wrap {
        code {
            white-space: normal !important;
        }
    }
    &:hover {
        .code-button-wrapper {
            opacity: 1;
        }
    }
    .code-button-wrapper {
        opacity: 0;
        right: 0;
        top: 0;
        padding: .5rem .5rem 0 0;
        transition: opacity 0.2s ease-in-out;
        z-index: 1;
        button {
            background-color: $white;
            box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.25);
            border-radius: 4px;
            padding: 2px 12px 3px 12px;
            transition: box-shadow 0.2s ease-in-out;
            &:hover {
                box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.45);
            }
            &:active,
            &:focus {
                box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.45) !important;
            }
        }
    }
}


.code-filename-wrapper {
    background-color: $codesnippet-filename-bg;
    min-height: 5px;

    &.collapsible {
        height: 39px;
    }

    .code-filename {
        padding: 6px 10px;
        font-size: 14px;
        font-family: RobotoMono-Regular, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New,
            monospace;
        border-top-right-radius: 4px;
        border-top-left-radius: 4px;
    }
    & + div.code-snippet {
        pre {
            margin-top: 0 !important;
            border-top: none;
            border-radius: 0;
        }
    }

    .js-code-block-visibility-toggle {
        &:hover {
            cursor: pointer;
        }
    }

    .chevron {
        height: 12px;
        width: 12px;
    }

    .chevron-up {
        margin-right: 15px;
        margin-top: 17px;
    }

    .chevron-down {
        margin-right: 14px;
        margin-top: 11px;
    }
}

p {
    // todo: can i set this with a bootstrap variable?
    font-size: 18px;
    color: #4a4a4a;
    line-height: 27px;
}

h1 {
    line-height: 42px;
    padding-bottom: 15.5px;
    &#pagetitle {
      margin-top: 30px;
    }
}

h2 {
    padding-bottom: 3px;
    line-height: 36px;
}
h4 {
    margin-top: 14px;
}

h5 {
    color: $ddpurple;
    > a {
        color: $ddpurple !important;
    }
    margin-top: 14px;
}

.announcement {
    .main {
        h2,
        h3,
        h4,
        h5 {
            pointer-events: none;
            &:before {
                margin-top: -110px;
                height: 110px;
            }
        }
    }
}

.main {
    &:lang(ja) {
        padding-left: 15px;
        padding-right: 0;
    }
    z-index: 1;
    padding-left: 29px;
    padding-bottom: 100px;
    h2 > a,
    h3 > a,
    h4 > a,
    h5 > a {
        color: #000;
        border-bottom: 1px solid transparent;
        pointer-events: initial;
        &:hover {
            border-bottom: 1px solid #000;
        }
    }

    h2,
    h3,
    h4,
    h5 {
        &:before {
            display: block;
            content: '';
            position: relative;
            margin-top: -80px;
            height: 80px;
            visibility: hidden;
            pointer-events: none;
        }
    }

    .tab-content a,
    & > a,
    & p a,
    & ol li a,
    & ul li a,
    & .alert a {
        color: #4a4a4a;
        border-bottom: 1px solid $gray-600;
        &:hover {
            color: $ddpurple;
            border-bottom: 1px solid $ddpurple;
        }
    }

    ul {
        list-style-type: none;
        -webkit-padding-start: 22px;
        ul {
            -webkit-padding-start: 20px;
        }
        li {
            &:before {
                content: '–';
                position: relative;
                margin-right: 10px;
                margin-left: -20px;
                float: left;
            }
            ol {
                li {
                    &:before {
                        content: '';
                    }
                }
            }
            p {
                margin-bottom: 0;
                & + .highlight {
                    margin-top: 10px;
                }
            }
        }
    }

    pre {
        margin: 0 0 24px 0;
    }
    p + .highlight {
        position: relative;
    }

    // h1 spacing
    p + h1,
    ol + h1,
    ul + h1,
    span + h1,
    table + h1 {
        margin-top: 14px;
    }

    // h2 spacing
    p + h2,
    ol + h2,
    ul + h2,
    span + h2,
    table + h2 {
        margin-top: 30px;
    }

    // h3 spacing
    p + h3,
    ol + h3,
    ul + h3,
    span + h3,
    table + h3 {
        margin-top: 30px;
    }

    // h4 spacing
    p + h4,
    ol + h4,
    ul + h4,
    span + h4,
    table + h4 {
        margin-top: 30px;
    }

    h2 + h3 {
        margin-top: 14px;
    }

    ul,
    ol {
        &:lang(ja) {
            padding-left: 22px;
        }
    }

    ol ol {
        list-style-type: lower-alpha;
        ol {
            list-style-type: lower-roman;
            ol {
                list-style-type: decimal;
                ol {
                    list-style-type: upper-alpha;
                    ol {
                        list-style-type: upper-roman;
                    }
                }
            }
        }
    }

    ul,
    ol,
    dl,
    p {
        &:lang(ja) {
            font-size: 14px;
            line-height: 24px;
        }
        font-size: 18px;
        color: #4a4a4a;
        line-height: 27px;
        -webkit-font-smoothing: subpixel-antialiased;
        -moz-osx-font-smoothing: auto;
    }
    p + ul,
    div + ul {
        margin-bottom: 1rem;
    }
}

.mainContent-wrapper {
    h1 {
        @media (min-width: 992px) {
            width: 85%;
        }
    }
}

/* codetabs inside content */
// Tab styling has been moved to _tab-toggle.scss

.sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
}

#dropdownMenuLink {
    text-decoration: none !important;
}

.dropdown-item {
    text-decoration: none !important;
}

// datadog cards
.cards-dd {
    margin-top: 14px;
    .card {
        text-decoration: none;
        img {
        }
        &:hover {
            border-color: transparent;
            box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.4);
            .hover {
                display: inline;
            }
            .static {
                display: none;
            }
            .card-title {
                color: $ddpurple;
            }
        }
        .hover {
            display: none;
        }
        .card-title {
            color: #000;
            padding-top: 6px;
        }
        .card-text {
            display: block;
            padding: 0 20px;
        }
    }
}

//content images
.shortcode-img img,
video {
    border: 1px solid $ddgray;
}

// popup images
.pop {
    cursor: zoom-in;
}

#popupImageModal {
    .modal-dialog {
        max-width: none;
        -webkit-transform: translate(0, -50%);
        -o-transform: translate(0, -50%);
        transform: translate(0, -50%);
        top: 50%;
        margin: 0 auto;
    }
}

// expand images
.wide-parent {
    width: 130%;
    display: block;
    figure {
        position: relative;
        &:before {
            height: 26px;
            top: -26px;
            background-image: linear-gradient(-179deg, hsla(0, 0%, 100%, 0), #fff 77%);
            content: '';
            display: inline-block;
            width: 300px;
            position: absolute;
            right: 0;
            opacity: 0.85;
        }
        &:after {
            height: 26px;
            bottom: -26px;
            background-image: linear-gradient(1turn, hsla(0, 0%, 100%, 0), #fff 77%);
            content: '';
            display: inline-block;
            width: 300px;
            position: absolute;
            right: 0;
            opacity: 0.85;
        }
    }
}

// Tables
.table-wrapper {
    overflow-x: auto;
}

table,
.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border: 1px solid $ddgray;
    font-size: 16px;
    &:lang(ja) {
        font-size: 15px;
        line-height: 24px;
    }
    a {
        border-bottom: 1px solid $gray-600;
        &:hover {
            border-bottom: 1px solid $ddpurple;
        }
    }
    &:before {
        height: 26px;
        top: -26px;
        background-image: linear-gradient(-179deg, hsla(0, 0%, 100%, 0), #fff 77%);
        content: '';
        display: none;
        width: 300px;
        position: absolute;
        right: 0;
        opacity: 0.85;
    }
    &:after {
        height: 26px;
        bottom: -26px;
        background-image: linear-gradient(1turn, hsla(0, 0%, 100%, 0), #fff 77%);
        content: '';
        display: none;
        width: 300px;
        position: absolute;
        right: 0;
        opacity: 0.85;
    }

    & > thead > tr > th {
        vertical-align: bottom;
        background: #e8e8e8;
        border: none;
        font-size: 14px;
        text-transform: uppercase;
        color: #000000;
        &:lang(ja) {
            font-size: 12px;
            line-height: 20px;
        }
    }
    & > thead > tr > th,
    & > tbody > tr > td {
        padding: 0.65rem;
        border-left: 1px solid $ddgray !important;
    }
    tr:first-child td {
        border: none;
    }
    & > tbody tr:nth-child(2n) {
        background: #fafafa;
    }
}

// expand tables
.table-wide {
    width: 130%;
    background: #fff;
    position: relative;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    table {
        display: table;
    }
}

// tables for integration metrics
.table-metrics {
    tr td {
        &:nth-child(1) {
            word-break: normal;
        }
        &:nth-child(1),
        &:nth-child(2) {
            width: 50%;
        }
    }

    @include media-breakpoint-up(xl) {
            table-layout: fixed;
    }
}

.table-fixed {
    @include media-breakpoint-up(xl) {
        table-layout: fixed;
    }
}

.break-word {
    table {
        td {
            word-break: break-word;
        }
    }
}

dl {
    border: 1px solid $ddgray;
    font-size: 18px;

    a {
        border-bottom: 1px solid;
    }

    dt {
        padding: 0.75rem 0.75rem 0.25rem;
    }

    dd {
        padding: 0 0.75rem 0rem 1.75rem;

        &:last-of-type {
            padding-bottom: 0.5rem;
        }
    }
}

// external link logos
.link-logo {
    transform: translateY(-1px);
    margin-right: -1px;
}

// responsive tables
.table-responsive-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    &:after {
        position: absolute;
        top: 0;
        left: 100%;
        width: 50px;
        height: 100%;
        border-radius: 10px 0 0 10px/50% 0 0 50%;
        box-shadow: -5px 0 10px rgba(0, 0, 0, 0.25);
        content: '';
        display: none;
    }
    .table-scroll {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: -ms-autohiding-scrollbar;
        margin-bottom: 31px;
    }
    table {
        display: table;
        margin-bottom: 0;
    }
}

// loader
.loader,
.loader:after {
    border-radius: 50%;
    width: 10em;
    height: 10em;
}

.loader {
    //margin: 60px auto;
    font-size: 10px;
    position: relative;
    text-indent: -9999em;
    border-top: 1.1em solid rgba(234, 234, 234, 0.5);
    border-right: 1.1em solid rgba(234, 234, 234, 0.5);
    border-bottom: 1.1em solid rgba(234, 234, 234, 0.5);
    border-left: 1.1em solid #ffffff;
    -webkit-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-animation: load8 1.1s infinite linear;
    animation: load8 1.1s infinite linear;
}

@-webkit-keyframes load8 {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes load8 {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

// modal background
.modal-backdrop.show {
    opacity: 0.3;
}

// hotjar feedback button
._hj_feedback_container {
    display: none;

    @include media-breakpoint-up(lg) {
        display: block;
    }
}

// all external links show an icon
/*a {
  &:not([href*='localhost']):not([href*='datadoghq.com']):not([href*='datadog.com']):not( [href^='#'] ):not( [href^='/'] ):after {
    content: " (external)";
  }
}*/

.alert {
    &:lang(ja) {
        font-size: 15px;
    }
}

// Breakpoint styles go here...

@media (min-width: 1200px) {
    .container {
        max-width: 1170px !important;
    }
    .container__content {
        max-width: 1440px !important;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1336px !important;
    }
}

//@include media-breakpoint-up(xs) { ... }
@media (max-width: 575px) {
    html {
        overflow-x: hidden;
    }
    .table-responsive-container {
        &:after {
            display: block;
        }
    }
    .navbar-brand {
        margin-right: 0;
    }
}

//@include media-breakpoint-up(sm) { ... }
@media (max-width: 767px) {
    table.table-vertical-mobile {
        td {
            display: block !important;
            width: 100% !important;
        }
    }
}

//@include media-breakpoint-up(md) { ... }
@media (max-width: 991px) {
    .banner body {
        padding-top: 60px;
    }

    .main {
        padding-left: 15px;
    }

    .wide-parent {
        width: 100%;
    }

    .kind-page .container__content {
        padding-top: 24px !important;
    }
}
