* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: rgb(249, 234, 213);
    font-family: cursive;
    font-weight: 550;
}

body.darkmode {
    background-color: black;
}

/* header */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.darkmode .header {
    background-color: #121212;
    color: white;
}

.header h1 {
    margin-left: 30px;
    font-size: 1.5em;
}

label {
    position: relative;
    padding: 6px 8px;
    border-radius: 50px;
    background-color: bisque;
    cursor: pointer;
    margin-right: 30px;
}

body.darkmode label i {
    color: white;
}

label i {
    position: relative;
    z-index: 2;
}

label i:first-child {
    margin-right: 10px;
}

label:after {
    content: "";
    height: 100%;
    width: 33px;
    position: absolute;
    top: 0px;
    left: 0px;
    background: #eee;
    border-radius: 50%;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

input {
    width: 0;
    height: 0;
    visibility: hidden;
}

input:checked+label {
    background: #242424;
}

input:checked+label:after {
    position: absolute;
    left: 62px;
    transform: translateX(-100%);
    background: linear-gradient(180deg, #777, #3a3a3a);
}

label,
label:after {
    transition: 0.3s
}

label:active:after {
    width: 37px;
}

/* calculator */

.calculator {
    height: 700px;
    width: 350px;
    margin: 65px auto;
    background-color: white;
}

body.darkmode .calculator{
    background-color: #1A120D;
}

.display {
    height: 30%;
    width: 100%;
    background-color: beige;
    padding: 10px 15px;
    margin-bottom: 30px;
    border-bottom-left-radius: 5%;
    border-bottom-right-radius: 5%;
    text-align: center;
}

body.darkmode .display{
    background-color: #39281E;
}

.display h1 {
    width: 100%;
    font-size: 80px;
    font-family: "Montserrat", sans-serif;
    font-weight: 550;
    margin-top: 5px;
    padding: 5px 0;
    overflow-x: auto;
    white-space: nowrap;
    text-align: right;
}

body.darkmode .display h1{
    color: #D4C3B8;
}

.btn-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.line {
    display: flex;
    gap: 10px;
}

button {
    border: none;
    text-align: center;
    height: 70px;
    width: 70px;
    background-color: rgb(245, 245, 237);
    border-radius: 50%;
    transition: .5s;
    font-size: 25px;
    font-weight: 550;
    font-family: "Montserrat", sans-serif;
}

body.darkmode button{
    background-color: #241913;
    color: #D4C3B8;
}

button i {
    font-size: 21px;
}

button:active {
    border-radius: 20%;
}

.add,
.sub,
.mul,
.div,
.paren-left,
.paren-right,
.equals {
    background-color: bisque;
}


body.darkmode .add,
body.darkmode .sub,
body.darkmode .mul,
body.darkmode .div,
body.darkmode .paren-left,
body.darkmode .paren-right {
    background-color: #5B4130;
}

body.darkmode .equals {
    background-color: #703700;
}

.ac {
    background-color: rgb(244, 244, 190);
}

body.darkmode .ac{
    background-color: #474921;
}

.show {
    display: block;
}

/* footer */

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background-color: #f4f4f4;
    font-size: 14px;
    color: #666;
}

body.darkmode .footer {
    background-color: #121212;
    color: #666;
}

.footer a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    color: #333;
}

::-webkit-scrollbar {
    height: 8px;
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width:450px) {
    .calculator {
        width: 100%;
        margin: 0;
    }

    .line {
        gap: 20px;
    }
}

@media (max-width:350px) {
    .header h1 {
        margin-left: 15px;
    }

    label {
        margin-right: 15px;
    }
}
