body {
    background-color: rgb(23, 23, 26);
    font-family: 'Consolas', 'monaco', monospace;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    gap: clamp(1rem, 5vh, 3rem);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #242428;
    font-size: clamp(20px, 3vw, 30px);
    min-height: 60px;
    padding-right: 15px;
    position: sticky;
    top: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 7px;
}

#logo-icon {
    width: 2rem;
    height: 2rem;
}

#logo-text {
    color: white;
    font-size: 1.3rem;
}

.links {
    display: flex;
    margin: 0px;
    gap: 1.5rem;
}

.links a:not(.selected):hover, #side-menu a:not(.selected):hover {
    background-color: #2a2a2f;
}

.links .selected, #side-menu .selected {
    background-color: #323237;
}

.header .links a, .header .logo {
    text-align: center;
    margin: 0px;
    color: white;
    text-decoration: none;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 14px;
    padding-right: 14px;
    font-weight: 400;
    transition: 0.15s;
    font-size: 1.1rem;
    border-radius: 10px;
}

#menu-button {
    display: none;
    color: white;
    font-size: 1.1rem;
    margin-left: auto;
    padding: 10px;
}

#side-menu {
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    padding-right: 30px;
    font-size: 1rem;
    position: fixed;
    top: 80px;
    right: 10px;
    display: none;
    flex-direction: column;
    gap: 7px;
    z-index: 2;
    background-color: #242428;
    border-radius: 10px;

}

#side-menu a {
    color: white;
    text-decoration: none;
    padding: 0;
    display: block;
    width: fit-content;
    transition: 0.15s;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 14px;
    padding-right: 14px;
    border-radius: 10px;
}

#side-menu.open {
    display: flex;
}

@media screen and (max-width: 800px) {
    #logo-text {
        display: none;
    }
}

@media screen and (max-width: 700px) {
    .links {
        display: none;
    }
    #menu-button {
        display: block;
    }
}

#app {
    color: white
}

.not-found {
    display: flex;
    justify-content: center;
}

.not-found-text {
    background-color: rgb(31, 31, 34);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(200px, 50%, 50%);
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 25px;
}
/* Multiple pages */

p, h4, h1, h3 {
    margin: 0px;
}

.hidden {
    display: none !important;
}

input:focus {
    outline: none;
}

input {
    font-family: 'Consolas', 'monaco', monospace;
    font-weight: bold;
}

input[type = "text"] {
    background-color: #2c2c31;
    color: white;
    text-align: center;
    border: 0px;
    border-radius: 10px;
}

.submit-button {
    width: 25%;
    min-width: min-content;
    max-width: 350px;
    height: 45px;
    background-color: #4b4b64;
    border: 0px;
    color: white;
    transition-duration: 0.4s;
    border-radius: 8px; 
}

.submit-button:hover {
    cursor: pointer;
    background-color: #646486;
}

.clear-button {
    width: clamp(55px, 10%, 200px);
    height: 30px;
    border: 2px solid rgb(185, 0, 0);
    border-radius: 5px;
    color: rgb(185, 0, 0);
    background: rgba(0,0,0,0);
    transition-duration: 0.2s;
}

.clear-button:hover {
    cursor: pointer;
    color: white;
    background-color: rgb(185, 0, 0);
}

.equation-maker {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

 .equation-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
 }

 .equation-part-container {
    display: flex;
    align-items: center;
    gap: 10px;
 }

 .reactant-input , .product-input {
    background-color: #2c2c31;
    border: 0px;
    border-radius: 7px;
    width: 75px;
    height: 35px;
    color: white;
    text-align: center;
 }

 .add-button {
    height: 28px;
    border: 0px;
    border-radius: 6px;
    background-color: #646486;
    font-size: 0.75rem;
    color: white;
    transition-duration: 0.4s;
 }

 .add-button:hover {
    cursor: pointer;
    background-color: #71719b;
 }

 .error {
    display: flex;
    flex-direction: column;
    background-color:rgb(31, 31, 34);
    align-items: center;
    padding-top: 30px;
    padding-bottom: 30px;
    gap: 20px;
    border-radius: 10px;
    width: clamp(350px, 40vw, 40vw);
 }

/* Home */

#home {
    width: 95vw;;
    background-color: rgb(31, 31, 34);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: center;
    padding-top: 50px;
    padding-bottom: 50px;
    border-radius: 20px;
    gap: 40px;
}

#home .features {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 20px;
    padding-bottom: 30px;
}

#home .features .list {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
}

#home .info {
    display: flex;
}

#home-ciaaw-link {
    background-color: transparent;
    color: white;
    border: 0px;
    font-size: 1rem;
}

/* Analyze */

#analyze {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    flex-wrap: wrap;
}

#analyze .enter {
    background-color: rgb(31, 31, 34);;
    display:flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    width: clamp(225px, 35vw, 35vw);
    padding-top: 20px;
    padding-bottom: 20px;
    gap: 20px;
}

#analyze .enter form {
    width: 100%;
}

#analyze .enter .write {
    margin: 0;
    padding: 0;
    width: 100%;
    display:flex;
    flex-direction:column;
    align-items: center;
    
}

#analyze .enter .write input {
    height: clamp(45px, 10vh, 75px);
    width: 90%;
    margin-top: 5px;
    box-sizing: border-box;
    padding-top: 20px;
    padding-bottom: 20px;
    border: 0px;
    border-radius: 10px;
    color: white;
    background-color: #2c2c31;
    text-align: center;
    font-size: 1.1rem;
    
}

#analyze .enter .buttons {
    margin: 0;
    padding: 0;
    width: 100%;
    display:flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    
}

#analyze .data{
    width: clamp(450px, 60vw, 60vw);
    background-color: rgb(31, 31, 34);
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 10px;
}

#analyze .data > div {
    width: clamp(270px, 87%, 87%);
    align-items: center;
}

#analyze .data .formula {
    display: flex;
    font-size: 1.1rem;
    font-weight: bold;
    justify-content: space-evenly;
    padding: 20px;
    border-radius: 10px;
    background-color: #2c2c31;
}

#analyze .data .formula .molar_mass {
    font-size: 1rem;
    font-weight: normal; 
}

#analyze .data .desktop {
    display: grid;
    grid-template-columns:repeat(5, 1fr);
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background-color: #2c2c31;
}

#analyze-card-container {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
}

#analyze .data .element-card {
    display: grid;
    font-weight: bold;
    font-size: 1.1rem;
    grid-template-columns:repeat(5, 1fr);
    text-align: center;
    width: 100%;
    border-radius: 10px;
    padding: 20px;
    background-color: #2c2c31;
}

#analyze .data .mobile {
    display: none;
}

@media screen and (max-width: 700px) {
    #analyze {
        gap: 20px;
    }

    #analyze .enter {
        width: clamp(300px, 90vw, 90vw);
    }

    #analyze .data {
        width: clamp(300px, 90vw, 90vw);
    }

    #analyze .data .mobile {
        display: revert;
        font-weight: normal;
        font-size: 1rem;
    }

    #analyze .data .element-card {
        display: Grid;
        grid-template-columns: 1fr auto;
        text-align: left;
        row-gap: 5px;
    }

    #analyze .data .desktop {
        display: none;
    }

    #analyze .error {
        width: clamp(300px, 90vw, 90vw);
    }
}


/* Convert */

#convert {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    flex-wrap: wrap;
}

#convert .enter {
    background-color: rgb(31, 31, 34);;
    border-radius: 10px;
    width: clamp(200px, 40vw, 40vw);
    padding-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
}

#convert-formula {
    height: clamp(45px, 7vh, 75px);
    width: 90%;
    margin-top: 5px;
    box-sizing: border-box;
    padding-top: 20px;
    padding-bottom: 20px;
    border: 0px;
    border-radius: 10px;
    color: white;
    background-color: #2c2c31;
    text-align: center;
    font-size: 1.1rem;
    
}

#convert .enter .unit input[type = "radio"] {
    display: none;
}

#convert .enter .unit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

#convert .enter .unit .toggle-unit {
    position: relative;
    background-color: #33333d;
    height: 40px;
    width: clamp(150px, 15vw, 15vw);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-radius: 10px;
}

#convert .enter .unit .toggle-unit label {
    flex: 1;
    text-align: center;
}

#convert .enter .unit .toggle-unit .slider {
    position: absolute;
    width: 45%;
    height: 30px;
    background-color: #646486;
    right: 2.5%;
    transition: 0.3s;
    border-radius: 10px;
}

#convert .enter .unit .toggle-unit label {
    z-index: 1;
}

#convert .enter .unit .toggle-unit label:hover {
    cursor: pointer;
}

#convert .enter .unit .toggle-unit #convert-radio-mol:checked ~ .slider {
    transform: translateX(-111%);
}

#convert-unit-count {
    height: 50px;
    border: 0px;
    border-radius: 10px;
    color: white;
    background-color: #2c2c31;
    text-align: center;
    width: clamp(100px, 11vw, 11vw);
}

#convert .enter .buttons {
    margin: 0;
    padding: 0;
    width: 100%;
    display:flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    
}

#convert .data {
    background-color: rgb(31, 31, 34);
    width: clamp(200px, 30vw, 30vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 10px;
    gap: 20px;
    box-sizing: border-box;

}

#convert .data .formula {
    display: flex;
    background-color: #2c2c31;
    border-radius: 0.8vw;
    width: 100%;
    height: 60px;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
}

#convert .data .count-data {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

#convert .data .count-data div {
    display:flex;
    flex-direction:column;
    flex: 1;
    text-align: center;
    background-color: #2c2c31;
    border-radius: 10px;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
}

@media screen and (max-width: 585px) {
    #convert:has(.error:not(.hidden)) {
        gap: 20px;
    }

    #convert:has(.error:not(.hidden)) .enter {
        width: clamp(300px, 90vw, 90vw)
    }

    #convert:has(.error:not(.hidden)) .error {
        width: clamp(300px, 90vw, 90vw)
    }
    
}

@media screen and (max-width: 460px) {
    #convert {
        gap: 20px;
    }

    #convert .enter {
        width: clamp(200px, 90vw, 90vw)
    }

    #convert .data {
        margin-top: 20px;
        width: clamp(200px, 90vw, 90vw)
    }
}

/* Balance */

#balance {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    flex-wrap: wrap;
}

#balance .enter {
    background-color: #1f1f22;
    border-radius: 10px;
    width: clamp(200px, 50vw, 50vw);
    padding-bottom: 20px;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
}

#balance .enter .buttons {
    margin: 0;
    padding: 0;
    width: 100%;
    display:flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

#balance .data {
    background-color: #1f1f22;
    width: clamp(400px, 45vw, 45vw);
    height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    box-sizing: border-box;
}

#balance .data .balanced, #balance .data .entered {
    background-color: #2c2c31;
    margin: 0px;
    height: 35%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    border-radius: 10px;
    width: 90%;
    flex-direction: column;
    gap: 0px;

}

#balance .data .balanced p, #balance .data .entered p {
    margin: 0px;
}

@media screen and (max-width: 825px) {
    #balance {
        gap: 20px;
    }

    #balance .enter {
        width: 90vw;
    }

    #balance .data {
        width: 90vw;
    }

    #balance .error {
        width: clamp(300px, 90vw, 90vw)
    }
}

/* Empirical */

#empirical {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
}

#empirical .enter {
    background-color: #1f1f22;
    width: clamp(200px, 50vw, 50vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 10px;
}

#empirical .composition-maker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
}

#empirical-part-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, max-content)); 
    gap: 25px;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

#empirical .empirical-part {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
}

#empirical .enter .empirical-part {
    opacity: 0;
    transition: 0.25s;
    transform: translateY(-7px);
}

#empirical .enter .empirical-part.show {
    opacity: 1;
    transform: translateY(0)
}

#empirical .empirical-part input {
    height: 35px;
    width: 80px;

}

#empirical .empirical-optional {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#empirical .hydrate-container {
    display: flex;
    align-items:center;
    width: 130px;;
    cursor: pointer;
    justify-content: space-between;
}

#empirical-hydrate-check {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

#empirical .hydrate-container .checkmark {
    display: inline-block;
    height: 20px;
    width: 20px;
    background-color: #2c2c31;
    border-radius: 5px;
    position: relative;
    transition: 0.2s;
}

#empirical .hydrate-container:hover #empirical-hydrate-check ~ .checkmark {
    background-color: #38383e;
}

#empirical .hydrate-container #empirical-hydrate-check:checked ~ .checkmark {
    background-color: #646486;
}

#empirical .hydrate-container .checkmark::after {
    content: "";
    position: absolute; 
    left: 7px;
    top: 4px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(1);
    opacity: 0;
    transition: 0.2s;
}

#empirical-hydrate-check:checked ~ .checkmark::after {
    opacity: 1;
}

.optional-hydrate-data {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;

}

#empirical .optional-hydrate:has(#empirical-hydrate-check:checked) .optional-hydrate-data {
    max-height: 200px;
    opacity: 1;
}

#empirical .optional-molar-mass {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;
}

#empirical .empirical-optional input {
    height: 35px;
}

#empirical .optional-hydrate {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.optional-hydrate-data {
    padding-top: 20px;
    width: 100%
}

#empirical .hydrate-mass, #empirical .anhydrous-mass {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;
}

#empirical .enter .buttons {
    margin: 0;
    padding: 0;
    width: 100%;
    display:flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

#empirical .data {
    width: clamp(200px, 40vw, 40vw);
    background-color: #1f1f22;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    gap: 20px;
}

#empirical .data .empirical-part, #empirical .data .molecular-part, #empirical-warning {
    background-color: #2c2c31;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 10px;
}

#empirical .data .empirical-data, #empirical .data .molecular-data {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

#empirical .data p {
    margin: 0px;
}

@media screen and (max-width: 420px) {
    #empirical {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #empirical .enter {
        width: 90vw;
    }

    #empirical .data {
        width: 90vw;
    }

    #empirical .error {
        width: clamp(300px, 90vw, 90vw)
    }
}

/* Limiting */

#limiting {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    flex-wrap: wrap;
    
}

#limiting .enter {
    background-color: #1f1f22;
    width: clamp(220px, 45vw, 45vw);
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 10px;;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;

}

#limiting .enter .reactants-mol-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, max-content));
    justify-content: center;
    width: 100%;
    max-width: 420px;
    row-gap: 10px;
}

#limiting .enter .reactant-mol {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#limiting .enter .reactant-mol .reactant {
    width: 90px;
    text-align: end;
}

#limiting .enter .reactant-mol input {
    height: 35px;
    width: 80px;
    margin-right: 10px;
}

#limiting .enter .buttons {
    margin: 0;
    padding: 0;
    width: 100%;
    display:flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

#limiting .data {
    background-color: #1f1f22;
    width: clamp(350px, 45vw, 45vw);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    padding-bottom: 20px;
}

#limiting .data > div {
    width: 90%;
    background-color: #2c2c31;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 10px;
    gap: 10px;
}

#limiting .theo-yields-list, #limiting .excess-remnants-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, max-content));
    width: 100%;
    max-width: 420px;
    justify-content: center;
    row-gap: 5px;
}

#limiting .data .theo-yield, #limiting .data .excess-remnant {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    align-items: center;
}

#limiting .data .theo-yield .product, #limiting .data .excess-remnant .reactant {
    width: 90px;
    text-align: end;
}

#limiting .data .theo-yield .count, #limiting .data .excess-remnant .count {
    width: 90px;
    text-align: start;
}


@media screen and (max-width: 660px) {
    #limiting {
        gap: 20px;
    }

    #limiting .enter {
        width: clamp(220px, 90vw, 90vw);
    }

    #limiting .data {
        width: clamp(200px, 90vw, 90vw);
    }

    #limiting .error {
        width: clamp(300px, 90vw, 90vw);
    }
}