@font-face {
    font-family: "nyala";
    src: url("../assets/nyala.ttf")
}

/* mobile resolution */
@media (max-width: 991.98px) {
    html {
        font-size: 3rem;
    }

    #navbar-top ul,
    #navbar-subtop {
        width: 100%;
        li {
            width: 100%;
        }
    }

    .main-content {
        margin-top: 3%;
    }

    .content-list {
        padding-left: 0.4rem;
        padding: 1.25rem 0.4rem 2.5rem 0.4rem;
    }
}

/* desktop resolution */
@media (min-width: 992px) {
    html {
        line-height: 2.4rem;
    }

    #navbar-top ul,
    #navbar-subtop ul {
        width: 100%;
        li {
            flex: 1;
        }
    }

    p {
        margin-bottom: 0;
    }

    .content-list {
        padding: 1.25rem 1.25rem 2.5rem 1.25rem;
    }
}

/* FHD */
@media (max-width: 1920px) {
    #spell-view {
        height: 66vh;
    }
    
    #spell-scrolllist {
        max-height: 66vh;
        height: 92%;
    }

    #spell-display,
    #race-display {
        max-height: 66vh;
    }

    #spell-search {
        height: 8%;
    }

    #race-img {
        height: 26vh;
    }
}

/* QHD */
@media (min-width: 1921px) {
    #spell-view {
        height: 75vh;
    }

    #spell-scrolllist {
        max-height: 75vh;
        height: 93%;
    }

    #spell-display,
    #race-display {
        max-height: 75vh;
    }

    #spell-search {
        height: 7%;
    }

    #race-img {
        height: 30vh;
    }
}

/* variables */
:root {
    --color: 255 0 0;

    --pink: 255 170 221;
    --lavender: 221 170 255;
    --blue: 189 214 255;
    --black: 32 32 32;
    --white: 239 239 239;

    --fontsize: 1vw;

    --bg-opac: 0.4;
}

.pink {--color: var(--pink)}
.lavender {--color: var(--lavender)}
.blue {--color: var(--blue)}
.white {--color: var(--white)}
.black {--color: var(--black)}

.low-opac {--bg-opac: 0.25}
.mid-opac {--bg-opac: 0.4}
.high-opac {--bg-opac: 0.5}

/* site defaults */

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    background: #222428;
    font-family: "nyala";
}

body::before,
body::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 40rem;
    pointer-events: none;
    z-index: -1;
}

body::before {
    top: 0;
    background: linear-gradient(to bottom, #533447, transparent);
}

body::after {
    bottom: 0;
    background: linear-gradient(to top, #3C4451, transparent);
}

h2 {
    font-size: 2rem;
}

ul {
    list-style-type: "–  ";
}

a {
    text-decoration: none;
    color: inherit;
}

.xlg, h1 {
    font-size: clamp(1.75rem, calc(1.4rem + 1vw), 3rem);
}

.lg, button.accordion-button {
    font-size: clamp(1.35rem, calc(1.1rem + 0.6vw), 2rem);
}

.md {
    font-size: clamp(1rem, calc(0.9rem + 0.35vw), 1.5rem);
}

.sm {
    font-size: clamp(0.9rem, calc(0.8rem + 0.2vw), 1.2rem);
}

.title {
    text-align: center;
}

.main-content {
    padding-top: 1vw;
    color: rgb(var(--white));
}

.hide {
    display: none;
}

.top {
    z-index: 1000;
}

/* navbars for top and bottom of screen */

#navbar-top { 
    background-color: rgb(var(--pink) / 0.2);
    padding: 0.5rem 3%;
    border-bottom: 1px solid rgb(var(--pink));

    .navbar-brand {
        color: rgb(var(--pink));
        width: 60%;
    }
    
    .navbar-nav {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        
        display: flex;
    }
}

#navbar-subtop { /* dnd pages */
    background-color: rgb(var(--lavender) / 0.2);
    padding: 0.5rem 3%;
    border-bottom: 1px solid rgb(var(--lavender));
    
    .navbar-brand {
        color: rgb(var(--lavender));
        width: 60%;
    }

    .button {
        padding: 0;
    }
}

.navbar-toggler-icon {
    filter: invert(1);
}

#navbar-bottom { /* general footer bar */
    background-color: #FFAADD30;
    padding: 1vh 1rem;
    border-top: 1px solid #FFAADDFF;
}

/* general button */

.button {
    margin: 0.1vw 0.6vw;
    padding: 0.3vw 0.6vw;
    cursor: pointer;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.5s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
    text-align: center;
}

.button-toggle,
.button-toggle-2 {
    padding: 0.3vw 0.6vw;
    cursor: pointer;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.1s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
    text-align: center;
}

.button-toggle.active,
.button-toggle-2.pos,
.button-toggle.click,
.button-toggle-2.click {
    background-color: rgb(var(--color)) !important;
    color: rgb(var(--black));
}

.button-toggle-2.neg {
    background-color: rgb(var(--black)) !important;
    color: rgb(var(--color));
}
.button-toggle-2.neg:hover {
    color: rgb(var(--white));
}

.button-toggle.hover,
.button-toggle-2.hover {
    background-color: rgb(var(--color) / 0.7);
    color: rgb(var(--black));
}

.button-toggle.spell-toggle,
.button-toggle-2.spell-toggle {
    display: flex;
    margin: 2px;
    padding: 5px 0;

    align-items: center;
    justify-content: center;
}

.button-switch {
    padding: 0vw 0.6vw;
    cursor: pointer;
    height: 2rem;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.1s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
    text-align: center;
}

.button-switch:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
}

.button-switch:last-of-type {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
}

.button-switch.hover {
    background-color: rgb(var(--color) / 0.7);
    color: rgb(var(--black));
}

.button-switch.active {
    background-color: rgb(var(--color)) !important;
    color: rgb(var(--black));
}

.button:hover,
.button.checked {
    --bg-opac: 1;
    color: rgb(var(--black));
    transition: 0.2s ease-in-out;
}

.button-pin {
    display: flex;
    justify-content: center;
    align-items: center;

    cursor: pointer;
    height: 3rem;
    width: 3rem;
    margin-top: 0.5rem;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.1s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
}

.button-pin:hover {
    background-color: rgb(var(--color) / 0.7);
    color: rgb(var(--black));
}

.button-pin.active {
    background-color: rgb(var(--color)) !important;
    color: rgb(var(--black));
}

.button-pin #pin {
    height: 2rem;
    width: 2rem;
    filter: invert(1);
    transition: 0.1s ease-in-out;
}

.button-pin:hover #pin,
.button-pin.active #pin {
    filter: invert(0);
    transition: 0.1s ease-in-out;
}

.link {
    color: rgb(var(--color) / 0.7);
    font-size: 0.5vw;
    text-decoration: underline;
}

.link:hover {
    color: rgb(var(--color));
}

.scroll {
    height: 100%;
    overflow-y: auto;
}

div.accordion {
    margin: 0.8rem auto 2rem auto;
    width: 97%;
}

.accordion-button {
    background-color: transparent;
    border: none;
    transition: 0.5s ease-in-out;
    border-radius: 0;
    font-size: --fontsize;
    color: rgb(var(--color));
    text-decoration: none;
}

.accordion-button:hover {
    background: rgb(var(--color));
    color: rgb(var(--black));
    transition: 0.2s ease-in-out;
}

.subclass-accordion::after {
    margin-left: 5%;
}

.accordion-item { 
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: transparent;
    --bs-accordion-active-bg: rgb(var(--color));
    --bs-accordion-active-color: rgb(var(--black));
    background: rgb(var(--color) / 0.2);
    border: 1px solid rgb(var(--color));
    border-radius: 0;

    color: rgb(var(--white));
}

.accordion-item:first-of-type,
.accordion-item:first-of-type > .accordion-header > .accordion-button {
    border-top-right-radius: 0.8rem !important;
    border-top-left-radius: 0.8rem !important;
}

.accordion-item:last-of-type,
.accordion-item:last-of-type > .accordion-header > .accordion-button {
    border-bottom-right-radius: 0.8rem !important;
    border-bottom-left-radius: 0.8rem !important;
}

.content-list {
    background: rgb(var(--blue) / 0.2);
    border: 1px solid rgb(var(--blue));
    border-radius: 0.8rem;
    margin: 1vw 0 5vw 0;
}

/* spell slot table */
table.spells {
    border: 2px solid rgb(var(--blue));
    margin: 0.5vw 2vw;

    tr:nth-child(n+2) {
        border-top: 1px solid rgb(var(--blue));
    }

    td, th {
        padding-left: 1vw;
        padding-right: 1vw;
        font-size: 0.9vw;
    }

    td:nth-child(n+2),
    th:nth-child(n+2) {
        border-left: 1px solid rgb(var(--blue));
        background-color: rgb(var(--blue) / 0.25);
        transition: 0.1s ease-in-out;
    }

    td:first-child,
    th:first-child {
        border-right: 2px solid rgb(var(--blue));
    }

    th:nth-child(11),
    td:nth-child(11) {
        border-left: 2px solid rgb(var(--blue));
        text-align: center;
    }

    tr.hover > td:not([rowspan])  {
        background-color: rgb(var(--blue) / 0.6);
        color: rgb(var(--black)) !important;
        transition: 0.1s ease-in-out;
    }

    td:first-child {
        width: 7vw;
        background-color: rgb(var(--blue) / 0.3);
        transition: 0.1s ease-in-out;
    }

    th {
        border-bottom: 2px solid rgb(var(--blue));
        background-color: rgb(var(--blue) / 0.4) !important;
    }

    td:nth-child(n+2):nth-child(-n+10),
    th:nth-child(n+2):nth-child(-n+10) {
        width: 5.7vw;
    }
}

table.spells.half {
    td:nth-child(n+7):nth-child(-n+10),
    th:nth-child(n+7):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.1) !important;
    }

    tr.hover > td:nth-child(n+7):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.3) !important;
    }
}

table.spells.third {
    td:nth-child(n+6):nth-child(-n+10),
    th:nth-child(n+6):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.1) !important;
    }

    tr.hover > td:nth-child(n+6):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.3) !important;
    }
}

/* ability tables */
table.ability {
    width: 100%;
    border: 1px solid rgb(var(--blue));
    margin-top: 0.4vw;
    margin-bottom: 0.4vw;

    tr {
        border-top: 1px solid rgb(var(--blue));
    }

    td, th {
        padding: 0 0.5rem;
    }

    th {
        background-color: rgb(var(--blue) / 0.3);
    }

    td:not(:first-child),
    th:not(:first-child) {
        border-left: 1px solid rgb(var(--blue));
    }
}


#spell-list {
    padding: 0 1.25rem 1.25rem 1.25rem; 
    margin: 0;
    height: 100%;

    .button-list {
        margin: 0vw 0.6vw;
        padding: 0.2vw 0.6vw;

        background-color: rgb(var(--color) / var(--bg-opac));
        border: 1px solid rgb(var(--color));
        transition: 0.5s ease-in-out;

        color: rgb(var(--white));
    }

    .button-list:not(:first-of-type) {
        border-top: none;
    }

    .button-list:hover {
        --bg-opac: 0.8;
        color: rgb(var(--black));
        transition: 0.05s ease-in-out;
    }

    .button-list.active {
        --bg-opac: 1;
        color: rgb(var(--black));
        transition: 0.02s ease-in-out;
    }

    .list-group-item {
        margin: 0 0 0 0;
        border-radius: 0 !important;
        --bs-border-radius: 0 !important;
    }
}

#spellbox {
    height: 100%;
}

#spell-display {
    background: linear-gradient(to bottom, #706B83 0%, #5A6575 50%, #67758A 100%);

    height: 100%;

    h1 {
        margin: 0;
    }

    hr {
        margin: 0.5rem;
    }

    .spell-list {
        max-width: 100%;
    }

    .margin {
        padding: 1.5rem;
    }

    .button-lvl {
        padding: 0.5rem 1rem;
        margin: 0;
        flex: 1;

        background-color: rgb(var(--color) / var(--bg-opac));
        border: 1px solid rgb(var(--color));
        transition: 0.5s ease-in-out;

        color: rgb(var(--color));
        text-decoration: none;
        text-align: center;
    }

    .button-lvl:first-of-type {
        border-top-left-radius: 0.8rem;
        border-bottom-left-radius: 0.8rem;
    }
    .button-lvl:last-of-type {
        border-top-right-radius: 0.8rem;
        border-bottom-right-radius: 0.8rem;
    }
    
    .button-lvl:hover {
        background-color: rgb(var(--blue) / 0.8);
        color: rgb(var(--black));
        transition: 0.05s ease-in-out;
    }
    .button-lvl.click,
    .button-lvl.active {
        background-color: rgb(var(--blue) / 1);
        color: rgb(var(--black));
        transition: 0.05s ease-in-out;
    }

    ul {
        margin-left: 5%;
        width: 95%;
    }

    #spell-desc {
        padding-top: 0;
    }

    #spell-desc > p {
        margin-top: 1rem;
    }
}

#spell-preview {
    transform: scale(0.8);
    transform-origin: top left;
    position: fixed;

    max-height: 60%;
    max-width: 60%;

    padding: 0;
    margin: 0;
    position: fixed;
    z-index: 1100;

    color: rgb(var(--white));
    overflow-y: auto;
}

#spell-preview,
.statblock-preview > div {
    border: 3px solid rgb(var(--pink));
    border-radius: 0.8rem;
}

#spell-preview-content > div {
    border: none;
}

.spell-link:hover {
    color: rgb(var(--pink));
}

#spell-search {
    width: 85%;
    padding: 0.5rem 0;

    input {
        color: rgb(var(--blue));
        background: rgb(var(--black) / 0.5);
        border: 1px solid rgb(var(--blue));
        border-radius: 1rem;
    }
    
    #spell-searchbar {
        max-height: 2rem;
    }

    #clear-button {
        position: absolute;
        padding: 0;
        width: 7%;
        margin-left: -8%;
        background: none;
        border: none;
    }
}

#spell-scrolllist {
    border: 1px solid rgb(var(--blue));
    border-radius: 0.8rem;
    margin: 0 0 1.25rem 0;
}

#pinned {
    flex: 0 0 auto;
}

#unpinned {
    flex: 1 1 auto;
    height: 100%;
}

#filter-menu {
    background: #956881;
    border: 1px solid rgb(var(--pink));
    border-top-right-radius: 0;

    margin: 0 1.25rem 0 0;
    padding: 1.25rem;
    z-index: 10;

    max-height: 80%;
    overflow-y: auto;
}

.horizontal-menu.show {
    display: flex;
    flex-direction: row;
    min-width: unset;
}

.indent-li {
    ul {
        width: 95%;
        margin-left: 5%;
    }
}

#race-display {
    height: 100%;
}

.subrace > p:not(:first-of-type) {
    margin-top: 1rem;
}

/* ----- */

/* damage colors */

.fire-dmg {color: #FF3300;}
.cold-dmg {color: #9BC2E6;}
.acid-dmg {color: #DDEE55;}
.poison-dmg {color: #22AA22;}
.lightning-dmg {color: #2222AA;}
.thunder-dmg {color: #FFD966;}
.necrotic-dmg {color: #AE6E52;}
.radiant-dmg {color: #FF9933;}
.psychic-dmg {color: #9777ff;}
.force-dmg {color: #FFAADD;}
.bludgeoning-dmg,
.piercing-dmg,
.slashing-dmg {color: #A0A0A0;}

#race-img {
    width: auto;
    height: auto;
    max-width: 50%;
}

#race-img:hover {
    transform: scale(1.75);
    transform-origin: top right;

    background: rgb(var(--black) / 0.3);

    z-index: 1000;
}