/* Google Font import*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Lexend:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Variables */
:root {
    --site-background-color: #051923;
    --block-backgorund-color: #1E293BFF;
    --border-color: rgba(229, 71, 234, 0.44);
    --selected-link-color: #00ceff;
    --button-color: #01689e;
    --button-hover-color: #00A6FB;
    --text-color: #C0C0C0;
    --hilight-text-color: #fafaf8;
    --site-horizontal-gradient: linear-gradient(90deg, rgba(109, 199, 255, 1) 0%, rgba(230, 171, 255, 1) 0%, rgba(91, 129, 255, 1) 33%, rgba(26, 109, 255, 1) 66%, rgba(200, 34, 255, 1) 100%);
    --site-vertical-gradient: linear-gradient(0deg, rgba(109, 199, 255, 1) 0%, rgba(230, 171, 255, 1) 0%, rgba(91, 129, 255, 1) 33%, rgba(26, 109, 255, 1) 66%, rgba(200, 34, 255, 1) 100%);
    --icon-color: #e8ebee;
    --header-height: 3.5rem;
    --blure-bakcground-color: rgba(3, 11, 31, 0.6);
    --main-link-color: #ff00f1;
    --nav-bar-laptop-width: 300px;
    --scrollbar-width: 5px;
    --footer-backgorund-color: #09072782
}

/* Asterisk wildcard selector to override default styles added by the browser */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    transition: all 0.1s linear; 
}
a:hover, .font-aw-icon:hover { 
    color: var(--hilight-text-color);   
}

body {
    background-color: var(--site-background-color);
    color: var(--text-color);
    font-family: "Inter", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: "Lexend", sans-serif;
    color: var(--hilight-text-color);
}

input,
textarea {
    background-color: #030620;
    color: var(--text-color);
    padding: 10px 10px;
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    position: relative;
    border: 1px solid var(--button-hover-color);
    border-radius: 5px;
    margin-top: 7px;
    resize: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.font-aw-icon {
    font-size: 1.6rem;
    color: #b3b3b6;
}

li {
    list-style: none;
}

.selected-page {
    color: var(--selected-link-color);
}

.bold-text {
    font-weight: 600;
}

/* Header */
header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    background-color: var(--blure-bakcground-color);
    border-bottom: transparent solid 2px;
    border-image: var(--site-horizontal-gradient) 1;
    position: fixed;
    width: 100vw;
    backdrop-filter: blur(3px);
    padding: 0 5vw;
    z-index: 50;
}

#nav-topics-show,
#nav-topics-hide {
    display: none;
}

label[for="nav-topics-show"] {
    flex-grow: 2;
}

#feedback-icon {
    flex-grow: 1;
}

header>h1 {
    font-size: 0;
    order: 1;
    text-align: center;
    margin: auto;
    flex-grow: 10;
}

#logo {
    height: 2.3rem;
    width: 2.3rem;
}

#nav-site {
    display: none;
}

#outer-sites {
    display: flex;
    justify-content: space-evenly;
    order: 2;
    flex-grow: 4;

}

/* Navigation by topics */
#nav-topics-container {
    background-color: var(--blure-bakcground-color);
    position: fixed;
    height: 100%;
    width: 100vw;
    overflow-x: hidden;
    backdrop-filter: blur(3px);
    z-index: 51;
    border-right: 2px solid transparent;
    border-image: var(--site-vertical-gradient) 1;
    transition: width 0.3s;
}

#nav-bar-topics {
    display: flex;
    flex-direction: column;
    width: 90vw;
    background-color: var(--site-background-color);
    padding: 20px 0 30px 15px;
}

#nav-bar-topics>label {
    margin-bottom: 30px;
    width: min-content;
}

#nav-topics h2,
#nav-topics h3 {
    font-size: 1rem;
    line-height: 2rem;
}

#nav-topics>ul ul {
    padding-left: 15px;
    border-left: 1px solid rgba(55, 67, 99, 0.6);
    margin-bottom: 25px;
    margin-top: 10px;
}

#nav-topics h2 {
    font-weight: 500;
}

#nav-topics h3 {
    color: var(--text-color);
    font-family: "Inter", sans-serif;
    font-weight: 400;
}

#nav-topics-hide:checked+#nav-topics-container {
    width: 0;
    border-width: 0;
}


/* Main */
.highlight-text {
    color: var(--hilight-text-color);
    font-weight: bolder;
}

.highlight-block {
    background-color: var(--block-backgorund-color);
    color: #bfcbe2;
    padding: 20px;
    border-radius: 20px;
}

/* Topics pages */
.topic-section {
    padding: 0;
    margin: 40px 20px;
}

.topic-section>section {
    margin: 0;
}

.topic-section :is(h1, h2, h3, h4) {
    margin: 35px 0 20px;
}

.topic-section p {
    line-height: 1.3rem;

}

/* Code style*/
.topic-section pre {
    margin-top: 30px;
    min-width: 250px;
    max-width: fit-content;
}

.lang-name {
    display: block;
    border-radius: 5px 5px 0 0;
    padding-left: 10px;
    background-color: var(--block-backgorund-color);
}

.topic-section code {
    background-color: black;
    border-radius: 0 0 5px 5px;
}

/* Method block */
.method {
    margin-bottom: 45px;
}

.method:last-of-type {
    margin-bottom: 0;
}

.method p {
    margin-top: 10px !important;
}

.method pre {
    margin-top: 10px;
}

.typewriter>* {
    color: #fff;
    font-family: monospace;
    overflow: hidden;
    border-right: .15em solid orange;
    white-space: nowrap;
    margin: 0 auto;
    animation:
        typing 2s steps(25, end),
        blink-caret .5s step-end infinite;
}

/* The typing effect */
@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

/* The typewriter cursor effect */
@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: orange
    }
}

main {
    padding: var(--header-height) 0 10px 0;
    line-height: 1.75rem;
    flex-grow: 1;
}

main a {
    color: var(--main-link-color);
}

main h2 {
    font-size: 1.3rem;
}

main h2,
main h3 {
    margin: 10px 0px 20px;
}

main section {
    padding: 20px 0 40px;
    margin: 0 20px;
}

main p:not(p:first-child),
main li:not(li:first-child) {
    margin-top: 20px;
}

#greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: black;
    padding: 40px 0;
    margin: 0;
}

#operator-precedence > ul {
    margin-top: 20px;
}

/* Feedback*/
#feedback-main {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

#feedback {
    margin: 0;
    padding: 0;
}

#feedback h2 {
    margin: 20px auto 0 auto;
    width: fit-content;

}

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

.feedback-container {
    background-color: var(--block-backgorund-color);
    margin: 30px;
    padding: 20px;
    border-radius: 10px;
}

#feedback-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

fieldset {
    border: none;
}

#rating-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 10px;
    font-size: 1.5rem;
}

.rate-button-container {
    position: relative;
}

.rate-button-container input {
    opacity: 0;
}

.rate-button-container label {
    position: absolute;
    top: 0;
    left: 0;
}

.required::after {
    content: "*";
    color: red;
    margin-left: 10px;
}
#rating-container label {
    transition: color 0.7s;
}

#rating-container input:checked+label {
    color: var(--button-hover-color);
}

#feedback-email {
    max-width: 320px;
}

#feedback-form textarea {
    height: 150px;
}

#feedback-form button {
    background-color: var(--button-color);
    color: var(--hilight-text-color);
    width: 60%;
    height: 40px;
    border-radius: 10px;
    border: none;
    align-self: center;
    font-size: 1rem;
    transition: all 0.5s; 
}

#feedback-form button:active {
    height: 45px;
    width: 65%;
    background-color: var(--button-hover-color);
}

#feedback-form button:hover {
    background-color: var(--button-hover-color);
}

/* Footer */
#useful-links {
    position: relative;
    height: calc(1.5 * var(--header-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    color: var(--main-link-color);
    text-align: left;
    font-weight: 600;
    background-color: #140909;
    border-top: 2px solid transparent;
    border-image: var(--site-horizontal-gradient) 1;
}



/* Media query:     tablets and larger (768 and up) */
@media screen and (min-width: 768px) {

    /* Header */
    header {
        padding-right: 3vw;
    }

    #outer-sites {
        justify-content: flex-end;
        gap: 25px
    }

    /* Navigation by topics */
    #nav-bar-topics {
        width: 40vw;
    }

    /*Feedback*/
    .feedback-container {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    #feedback-form button {
        max-width: 200px;
    }

    #rating-container {
        justify-content: space-evenly;
    }

    /*Footer*/
    #useful-links {
        flex-direction: row;
        justify-content: space-around;
        height: var(--header-height);
    }
}

/* Media query: laptops and larger (992 and up) */
@media screen and (min-width: 992px) {

    /* Custom scrollbar*/
    *::-webkit-scrollbar {
        width: var(--scrollbar-width);
    }

    *::-webkit-scrollbar-track {
        background: var(--block-backgorund-color);
    }

    *::-webkit-scrollbar-thumb {
        background: var(--text-color);
        border-radius: 2px;
    }

    /* Header */
    header {
        padding: 0 20px;
    }

    header>h1 {
        flex: 1 200px;
        order: initial;
        text-align: left;
    }

    #feedback-icon,
    label[for="nav-topics-show"] {
        display: none;
    }

    #nav-site {
        display: flex;
        justify-content: center;
        flex-grow: 1;
    }

    #nav-site>ul {
        display: flex;
        justify-content: center;
        flex-grow: 1;
        gap: 50px;
        font-size: 1.2rem;
    }

    #outer-sites {
        flex: 1 200px;
    }

    /* Navigation by topics */
    #nav-topics-hide:checked+#nav-topics-container {
        width: inherit;
        border-right: 2px solid transparent;
        border-image: var(--site-vertical-gradient) 1;
    }

    #nav-topics-container {
        top: var(--header-height);
        width: fit-content;
    }

    #nav-topics-container::-webkit-scrollbar-track {
        background: var(--site-background-color);
    }

    #nav-bar-topics {
        width: var(--nav-bar-laptop-width);
        padding-bottom: 70px;
    }

    #nav-bar-topics>label {
        display: none;
    }

    /* Main */
    main,
    footer {
        margin-left: auto;
        /* The last parameter for width calculation is border width of nav-topics bar*/
        width: calc(100% - var(--nav-bar-laptop-width) - var(--scrollbar-width) - 2px);
    }

    #rating-container label:hover {
        color: var(--button-hover-color);
    }

}

/* Media query: PC (1440 and up) */
@media screen and (min-width: 1440px) {
    main>section {
        margin-left: 50px;
        margin-right: 50px;
    }
}