/* General setup */
* {
    box-sizing: border-box;
    scroll-margin-top: 100px;
}

html{
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: hsl(0, 0%, 100%);
}

p{
    line-height: 1.5;
}

.norli{
    margin: 1em;
    padding-left: 40px;
    list-style-position: outside;
    list-style-type: circle;
    line-height: 1.5;
}


main{
    width: 85%;
    justify-self: center;
    z-index: 10px;
    /* background-color: #ffffff; */
    padding: 19px;
    box-shadow: 0 0 4px black;
}
main span{
    color: black;
}




/* Header and nav bar */

header{
    background-color: black;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    height: 56px;
    z-index: 1000;
    box-shadow: 0 0 8px black;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}


#logo{
    cursor: pointer;
}
#name{
    padding-left: 8px;
    font-family: "Times New Roman";
    cursor: pointer;
}

#lona{
    display: flex;
    align-items: center;
    margin-right: 80px;
    padding: 6px;
}
/* #lona:hover{
    background-color: rgba(164, 163, 163, 0.477);
} */

nav{
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
    width: 60%;
    max-width: 600px;
    right: 0;
    z-index: 3;
}
.nav-item{
    padding: 18px;
}
#navchap{
    z-index: 1000;
    position: relative;
}
#chapterlist{
    display: none;
    width: 180px;
    position: absolute;
    font-size: small;
    /* border: 3px solid hsl(170, 100%, 50%); */
    border-radius: 15px;
    right: -40%;
    /* margin-top: 1px; */
    overflow: hidden;
}
#chapterlist div{
    padding: 15px;
    /* border-bottom: 1px solid black; */
}
#chapterlist a:not(:last-child) {
    display: block;
    border-bottom: 1px solid black;
}
#navchap:hover div{
    display: block;
}

nav a{
    text-decoration: none;
    color: white;
}
nav div:hover{
    background-color: rgba(153, 152, 152, 0.477);
    color: hsl(170, 100%, 50%);
}
nav a.active {
    background-color: rgba(224, 216, 216, 0.477);
}

#navbar{
    display: none;
    cursor: pointer;
}
#navclo{
    display: none;
    cursor: pointer;
}
.navdiv{
    height: 3px;
    width: 25px;
    background-color: white;
    margin: 3px;
}





/* Mode toggle button */

/* #fixedmodediv{
    position: fixed;
    top: 65px;
    right: 20px;
    z-index: 20;
    cursor: pointer;
}
#modediv{
    background-color: black;
    width: 45px;
    height: 25px;
    z-index: 20px;
    border: 2px solid white;
    border-radius: 15px;
    padding: 0;
} */
#modebut{
    display: flex;
    justify-content:center;
    align-items: center;
    margin-left: 10px;
    cursor: pointer;
    background-color: white;
    width: 25px;
    height: 25px;
    border: 3px solid black;
    border-radius: 25px;
    /* position: absolute; */
    left: 0;
    top: 0;
    /* margin: 0; */
    box-shadow: 0 0px 5px grey;
    text-align: center;
    font-size: 12px;
}
#sun{
    justify-self: center;
    /* margin-top: 4px ; */
    color: orange;
}
#moon{
    justify-self: center;
    /* margin-top: 4px;  */
    color: #ffffff;
}




/* Light theme styles */
[data-theme="light"] {
    background-color: #fafafa;
    color: black;
}

/* Dark theme styles */
[data-theme="dark"] {
    background-color: hsl(200, 2%, 30%);
    color: white;
}






/* Main Content */

#downloadBtn{
    font-size: 15px;
    background-color: hsl(195, 79%, 52%);
    border-radius: 20px;
    border: none;
    padding: 10px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 0 8px hsl(195, 79%, 32%);
}
#downloadBtn a{
    color: white;
}
#downloadBtn:hover{
    background-color: hsl(195, 79%, 42%);
}
#downloadBtn:active{
    background-color: hsl(195, 79%, 32%);
}


/* Image Div */
.imgdiv{
    float: left;
}



/* #mainfnav:hover>ol{
    display: block;
} */
#mainfnav{
    display: inline-block;
    position: fixed;
    top: 60px;
    left: 2%;
    z-index: 2;
    font-size: 0.8em;
}

#bfnav div{
    width: 30px;
    height: 4px;
    background-color: black;
    margin: 3px;
}
#bfnav{
    border: 1px solid black;
    display: inline-block;
    padding: 2px;
    background-color: white;
    cursor:pointer;
}
#bfnav:hover{
    background-color: hsl(0, 0%, 95%);
    box-shadow: 0 0 2px black;
}
#bfnav:active{
    background-color: hsl(0, 0%, 85%);
    box-shadow: 0 0 2px black;
}


#bfnavi{
    display: none;
    background-color: white;
    border: 2px solid black;
    box-shadow: 0 0 2px black;
    padding: 4px;
}
#bfnavi li{
    list-style-type: none;
}
#bfnavi li{
    padding: 2px;
    margin: 2px;
}
#bfnavi>li{
    border: 2px solid black;
}
#bfnavi a{
    color: black;
}
#bfnavi li li:hover{
    background-color: hsl(0, 0%, 95%);
    text-decoration: underline;
}
#bfnavi li li:hover a{
    color:hsl(230, 77%, 48%);
}


main a:visited{
    color: hsl(263, 93%, 66%);
}


main{
    margin: 8px;
}


@keyframes welcome{
    65%{opacity:1}
}
#welh4{
    opacity: 0;
    animation-name: welcome;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}





#divgrid{
    display: grid;
    grid-template-rows: repeat(auto-fit, 1fr);
    grid-template-columns: repeat(auto-fit, minmax(317px,1fr));
    align-items: stretch;
    gap: 20px;
}
.chbox{
    /* border: 2px solid black;
    box-shadow: 0px 0px 3px black; */
    padding: 8px;
    text-align: center;
}
.chbox img{
    width: 150px;
    margin-bottom: 6px;
}
.chbox:hover{
    scale: 1.02;
    /* background-color: hsl(180, 100%, 98%); */
}

#divgrid a{
    text-decoration: none;
    color: black;
}
#divgrid a:hover{
    text-decoration: underline;
    color: hsl(214, 100%, 50%);
}



/* Previous Next Button */

.preNextBut{
    padding: 5px;
    font-size: 0.9em;
    background-color: hsl(207, 100%, 50%);
    /* font-weight: bold; */
    /* font-style: italic; */
    border-radius: 10px;
    box-shadow: 0 0 5px black;
}



/* Footer */

footer{
    background-color: black;
    height: auto;
    color: white;
    padding: 8px;
    box-shadow: 0 0 8px black;
}
footer a{
    color: hsl(170, 100%, 50%);
    text-decoration: none;
}
footer a:hover{
    text-decoration: underline;
}
/* footer p{
    align-self: center;
    padding-left: 10px;
    text-shadow: 0 0 1px white;
} */

#footdiv{
    display: flex;
    justify-content: space-around;
}














/* Page specific styling */

ul,ol{
    margin: 0;
    padding: 0;
    list-style-position: inside;
}
main a:link{
    text-decoration: none;
    color: hsl(920, 100%, 50%);
}

ol a:hover{
    text-decoration: underline;
}
p a:hover{
    text-decoration: underline;
}
ul a:hover{
    text-decoration: underline;
}
ul.c1ul>li::marker{
    content:"➝ ";
    font-size: 20px;
}
ul.mainlist>li::marker{
    content: "✶ ";
    font-size: 20px;
}

.clrb{
    clear: both;
}
table {
    margin: auto;
    width: 100%;
    max-width: 700px;
    border-collapse: collapse;
}
th, td {
    border: 2px solid black;
    padding: 8px;
}
th {
    white-space: nowrap;
}

mjx-container[display="true"] {
    font-size: 110% !important;
    text-align: left !important;
    width: 100% !important;
    margin-left: 6% !important;
    padding: 20px;
}


mjx-mtable {
    text-align: left !important;
    margin-left: 10px;
}

.imgdiv{
    overflow: auto;
}

.mathbox,.imgdiv {
  scrollbar-width: thin;
  scrollbar-color: darkgray transparent;

}

.mathbox::-webkit-scrollbar {
  height: 8px;
}

.mathbox::-webkit-scrollbar-thumb {
  background-color: darkgray;
  border-radius: 4px;
}



@media screen and (max-width: 645px) {
    .imgdiv{
        float: none !important;
        display: block;
        text-align: center;
        margin-top: 30px !important;
        margin-bottom: 30px !important;
    }
    mjx-mtable {
    margin-left: 0;
    }
}




/* Loading Bar */

body.loading {
  overflow: hidden;
}

#loader{
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* background: rgba(255, 255, 255, 0.8); */
    z-index: 2000;
}

#mloader{
    width: 260px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* box-shadow: 0 0 8px black; */
    border-radius: 5px;
    /* background: white; */
}

.spinner {
    position: relative;
    width: 80px;
    height: 80px;
    border: 10px solid #f3f3f3;
    border-top: 10px solid hsl(199, 70%, 53%);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loaderLogo{
    position: absolute;
}

#loaderLogo {
    position: absolute;
    animation: spin 1s linear reverse infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}







/* Animations for nav and header and download-Heading*/

@keyframes anime{
    from{transform: translateX(-100%)}
    0%{opacity: 0}
}



@keyframes clo1{
    from{transform: rotateZ(0deg)}
}
@keyframes clo2{
    0%{opacity: 1}
}
@keyframes clo3{
    from{transform: rotateZ(0deg)}
}



@keyframes bar1{
    from{transform: rotateZ(45deg) translateY(8.5px)}
}
@keyframes bar2{
    0%{opacity: 0}
}
@keyframes bar3{
    from{transform: rotateZ(-45deg) translateY(-8.5px)}
}



@media screen and (max-width: 726px){

    /* General setup */

    h1, h2, h3, .infobox, .navbox {
        font-family: Arial, "Helvetica Neue", sans-serif;
    }
    /* body {
        font-family: "Linux Libertine", Georgia, "Times New Roman", Times, serif;
    } */
    
    main{
        width: 95%;
    }

    /* Header and nav reponsiveness */
    header{
        display: block;
    }

    #logo{
        display: none;
    }
    #name{
        padding: 12px;
    }
    #name:hover{
        background-color:  rgba(153, 152, 152, 0.477);

    }
    #lona{
        /* justify-content: ; */
        margin: 0;
    }
    #lona:hover{
        background-color: initial;
    }

    nav{
        display: none;
        height: 1900px;
        width: 250px;
        position: fixed;
        left: 0;
        z-index: 10px;
        color: white;
        text-align: center;
        animation-name: anime;
        animation-duration: 1s;
    }
    #navchap:hover #chapterlist{
        display: none;
    }
    #navbar{
        display: block;
        padding: 11px;
    }
    #navbar:active .navdiv{
        background-color:  hsl(170, 100%, 50%);
    }
    #navclo{
        display: none;
        padding: 11px;
    }
    #navclo:active .navdiv{
        background-color:  hsl(170, 100%, 50%);
    }
    #navclo1{
        transform: rotateZ(45deg) translateY(8.5px);
        animation-name: clo1;
        animation-duration: 1s;
    }
    #navclo2{
        opacity:0;
        animation-name: clo2;
        animation-duration: 1s;
    }
    #navclo3{
        transform: rotateZ(-45deg) translateY(-8.5px);
        animation-name: clo3;
        animation-duration: 1s;
    }
    #navbar1{
        animation-name: bar1;
        animation-duration: 1s;
    }
    #navbar2{
        opacity: 1;
        animation-name: bar2;
        animation-duration: 1s;
    }
    #navbar3{
        animation-name: bar3;
        animation-duration: 1s;
    }
    #footdiv{
        flex-direction: column;
        align-items: center;
    }
    .c1fdiv{
        width: 100%;
        display: flex;
        flex-direction: column;
        /* justify-content: ; */
        /* align-items: center; */
    }
    .c1fdiv p{
        margin-left: 25px;
        margin-top: 0;
        margin-bottom: 0;
    }
    .c1fdiv > p{
        margin-top: 20px;
        margin-bottom: 5px;
    }
    .c2fdiv{
        display: flex;
        align-items: center;
        margin: 0;
    }
}

