* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

html {
    height: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
    min-height: 100%;
}

main {
    min-height: 50%;
    margin-bottom: 130px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #ffffff;
    border-bottom: 2px solid #e1e1e1;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100000;
}

header .logo h1 {
    font-size: 2rem;
    color: #2c3e50;
    font-weight: 600;
    margin-right: 5px;
}

header nav ul {
    list-style: none;
    display: flex;
    column-gap: min(calc(0.5rem + 1.6vw), 2rem);
    justify-content: space-around;
}

header nav div {
    display: flex;
    flex-direction: row;
    column-gap: min(calc(0.5rem + 1.6vw), 2rem);
}

header nav ul li {
    text-wrap: nowrap;
}

.banner {
    background: linear-gradient(135deg, #3498db, #6dd5fa);
    color: white;
    text-align: center;
    padding: 1rem 1rem;
    margin-top: 80px;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e1e1e1;
    transition: background 0.5s ease-in-out;
}

.banner h2 {
    font-size: calc(1.8rem + 2vw);
    font-weight: 700;
}

.banner p {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.banner.content img {
    width: 70px;
    height: 70px;
}

.banner.content h2 {
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 20px;
}

.note {
    background-color: #f9f9f9;
    border-left: 4px solid #3498db;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 70px;
}

.resources {
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 25px;
}

.resources h1 {
    margin-bottom: 20px;
    flex: 1 1 100%;
    font-size: 28px;
}

main h1.title {
    padding-left: 20px;
    padding-right: 20px;
    width: 80%;
    transform: translateX(5%);
    font-size: 36px;
    margin-bottom: 40px;
    text-decoration: underline;
    color: #2c3e50;
}

main h2.subtitle {
    padding-left: 20px;
    padding-right: 20px;
    width: 80%;
    transform: translateX(5%);
    font-size: 32px;
    margin-bottom: 30px;
    text-decoration: underline;
    color: #717172;
}

.resources.content {
    width: 80%;
    transform: translateX(5%);
    flex-direction: column;
}

.resources.content p {
    text-align: justify;
}

.resources.spacing p {
    margin-bottom: 25px;
}

.item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 35px;
}

.item p {
    margin-bottom: 5px;
}

.item li, .item img, .item ul ul {
    margin-left: 30px;
    margin-bottom: 4px;
}

.item img {
    margin-right: 35px;
    border-radius: 10px;
}

.item h3 {
    margin-bottom: 6px;
}

.resources.content a {
    width: fit-content;
}

.banner .tabs {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.banner.content a, .banner .tabs .dropdown .dropbtn {
    width: fit-content;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #3498db;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #e1f5fe;
    transition: background-color 0.3s ease, color 0.3s ease;

    &:hover {
        background-color: #b3e5fc;
        color: #0277bd;
        cursor: pointer;
    }
}

.banner .tabs .dropdown {
    float: left;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    position: relative;
}

.banner .tabs .dropdown .dropbtn {
    margin: 0;
    border: none;
    font-family: inherit;
    line-height: 1.6;
}

.banner .tabs .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    width: 100%;
    background-color: #f9f9f9;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    gap: 10px;
    border: solid 1px black;
    border-radius: 10px;
    overflow: hidden;
    padding: 8px;
}

.banner .tabs .dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 15px;
    width: 100%;
}

.banner .tabs .dropdown:hover .dropdown-content {
    display: flex;
    flex-direction: column;
    align-content: stretch;
    justify-content: flex-start;
    align-items: stretch;
}

.banner .tabs .dropdown:hover .dropbtn {
    background-color: #b3e5fc;
    color: #0277bd;
    cursor: pointer;
}

.resources:not(.content) a {
    position: relative;
    color: rgb(255, 255, 255);
    text-decoration: none;
    width: 180px;
    height: 190px;
    background-color: #5d667a;
    border: 0.5px solid #929292;
    box-shadow: 0 0 7px #89a0f0;
    border-radius: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: all 0.2s;
    
    img {
        margin: 0;
        padding: 0;
        width: 100px;
        height: 100px;
        margin-top: 17px;
        filter: drop-shadow(0 0 1rem rgba(255, 255, 255, 0.3));
    }

    h2 {
        margin-top: 12px;
    }

    &:hover {
        box-shadow: 0 0 12px #89a0f0;
        scale: 1.015;
    }
}

main hr {
    margin-top: 35px;
    margin-bottom: 35px;
    width: 96%;
    transform: translateX(2%);
}

footer {
    text-align: center;
    background-color: #ffffff;
    color: #7f8c8d;
    padding: 1.5rem;
    font-size: 1rem;
    border-top: 2px solid #e1e1e1;
    position: absolute;
    bottom: 0px;
    width: 100%;
}

/* For physics */
.formula {
    background-color: #dddddd73;
    border: 1px solid #b8b8b8;
    padding: 0.2rem;
    margin: 1rem 0;
    color: #333;
    border-radius: 5px;
    font-family: Georgia, 'Times New Roman', Times, serif;
    letter-spacing: 1.2px;
}

.math-list li {
    margin-top: 10px;
    margin-bottom: 10px;
}

.math-list :not(span) > .mjx-chtml {
    margin-left: 15px;
}

.math-table {
    width: 80%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    margin-bottom: 50px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);

    img {
        margin: 20px;
        width: 150px;
        height: 150px;
    }

    td {
        min-width: 15vw;
    }
}

.img-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: left;
    margin-left: 20px;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-left: 20px;
}

table, th, td {
    border: 1px solid #c4c4c4;
    font-size: 15px;
}

th, td {
    padding: 8px;
    text-align: left;
}

nav .dropbtn, nav ul li a {
    width: fit-content;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #1a73e8;
    font-weight: 700;
    font-size: 1.08rem;
    padding: 9px 18px;
    border-radius: 7px;
    background-color: #e3f0fc;
    transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
    border: 1.5px solid #90caf9;
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.07);

    &:hover {
        background-color: #bbdefb;
        color: #0d47a1;
        box-shadow: 0 2px 8px rgba(26, 115, 232, 0.13);
        cursor: pointer;
    }
}

nav .dropdown, nav ul li {
    float: left;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    position: relative;
}

nav .dropdown .dropbtn, nav ul li a {
    margin: 0;
    font-family: inherit;
    line-height: 1.7;
    letter-spacing: 0.02em;
    text-wrap-mode: nowrap;
}

nav .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    width: 100%;
    background-color: #f4faff;
    box-shadow: 0px 8px 20px 0px rgba(26,115,232,0.13);
    z-index: 2;
    gap: 12px;
    border: solid 1.5px #90caf9;
    border-radius: 12px;
    overflow: hidden;
    padding: 10px;
}

nav .dropdown-content a {
    float: none;
    color: #222;
    padding: 13px 18px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 15px;
    width: 100%;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;

    &:hover {
        background: #e3f2fd;
        color: #1565c0;
    }
}

nav .dropdown:hover .dropdown-content {
    display: flex;
    flex-direction: column;
    align-content: stretch;
    justify-content: flex-start;
    align-items: stretch;
}

nav .dropdown:hover .dropbtn {
    background-color: #bbdefb;
    color: #0d47a1;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.13);
    cursor: pointer;
}

@media only screen and (max-width: 750px) {
    header {
        position: static;
        flex-direction: column;
    }

    header .logo h1 {
        margin-bottom: 15px;
    }

    header nav ul {
        /* flex-wrap: wrap; */
        column-gap: calc(0.3rem + 1.4vw);
    }

    header nav ul div {
        /* flex-wrap: wrap; */
        column-gap: calc(0.3rem + 1.4vw);
    }

    .banner {
        margin-top: 0;
    }
}