@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}
html {
    --bg: #f5f5f5;
    --sec_bg: #ffffff;
    --color: #333;
    --hover_color: #e0e0e0;
    --operator-bg: #d39248;
    --operator-color: #ffffff;
    --input-text-color: #000;
}
body[data-theme="dark"] {
    --bg: #383737;
    --sec_bg: #292929;
    --color: #e0e0e0;
    --hover_color: #333333;
    --operator-bg: #d39348;
    --operator-color: #000;
    --input-text-color: #302f2f;
}
body {
    background: var(--bg);
}
.main {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.calculator {
    width: 360px;
    border-radius: 16px;
    background: var(--sec_bg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.header {
    width: 100%;
    height: 80px;
    background: var(--operator-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #ddd;
}
.switchBox {
    width: 70px;
    height: 30px;
    background: #b0b0b0;
    border-radius: 15px;
    position: relative;
}
.switchBox input {
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: absolute;
    z-index: 100;
    -webkit-appearance: none;
}
.switchBox .box {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    background: #8c8c8c;
    border-radius: 50%;
    transition: all .3s;
}
.switchBox input:checked ~ .box {
    left: calc(100% - 25px);
    background: var(--operator-bg);
}
.title {
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 700;
    animation: fadeIn 1s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.input {
    width: 100%;
    height: 80px;
    background: var(--sec_bg);
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}
.input #display {
    width: 79%;
    height: 60px;
    border: none;
    outline: none;
    font-size: 2rem;
    padding-left: 12px;
    color: var(--input-text-color);
    background: #cfcfcf;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
.cancel_btn {
    width: 60px;
    height: 60px;
    border: 2px solid var(--operator-bg);
    background: transparent;
    font-size: 1.6rem;
    color: var(--operator-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}
.cancel_btn:hover {
    background: var(--operator-bg);
    color: white;
}
.row {
    display: flex;
    width: 100%;
    margin: 0;
}
.row input {
    flex: 1;
    height: 60px;
    background: var(--sec_bg);
    color: var(--color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1.6rem;
    border-radius: 8px;
    margin: 5px;
    transition: background 0.3s, box-shadow 0.3s;
}
.row input:hover {
    background: var(--hover_color);
}
.operator {
    background: var(--operator-bg);
    color: var(--operator-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}
.operator:hover {
    background: darken(var(--operator-bg), 10%);
}
.active {
    animation: anim .4s;
}
@keyframes anim {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); background: var(--hover_color); }
}