*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg-color: #d1e3f0;
    --calc-bg-color: #e6edf3;
    --text-primary: #333333;
    --text-secondary: #7a7a7a;
    --orange-color: #fca311;
    --op-bg-color: #b9b9bb;
    --sw-bg-color: #86858a;
    --line-color: rgba(0, 0, 0, 0.2);
}

.dark-mode {
    --bg-color: #b0c4d9;
    --calc-bg-color: #4a4d53;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --orange-color: #2ec4b6;
    --sw-bg-color: #d1d8e0;
    --line-color: rgba(255, 255, 255, 0.2);
}

body{
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease;
}

.calculator{
    background-color: var(--calc-bg-color);
    width: 320px;
    padding: 30px 20px;
    border-radius: 30px;
}

.display{
    width: 100%;
    text-align: right;
    margin-top: 20px;
    margin-bottom: 30px;
    padding: 10px;
}

.display .back{
    font-size: 1.2rem;
    color: var(--text-secondary);
    min-height: 24px;
    margin-bottom: 5px;
}

.display .front{
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-all;
    min-height: 64px;
}

.buttons{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    border-top: 1px solid var(--line-color);
    margin-left: -20px; 
    margin-right: -20px;

    padding-left: 20px;
    padding-right: 20px;
    
    padding-top: 20px;
    margin-top: 20px;
}

.btn{
    background-color: transparent;
    border: none;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn.clear{
    color: var(--orange-color);
}

.btn.equal{
    background-color: var(--orange-color);
    color: #fff;
}

.theme-switch-checkbox{
    display: none;
}


.theme-toggler {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.theme-switch-label {
    background-color: var(--sw-bg-color);
    width: 70px;
    height: 30px;
    border-radius: 50px;
    position: relative; 
    display: flex; 
    cursor: pointer;
    overflow: hidden; 
}


.theme-switch-label i {
    font-size: 14px;
    color: #555; 
    position: absolute; 
    top: 50%;
    transform: translateY(-50%); 
    z-index: 10;              
    transition: color 0.3s ease; 
}


.theme-switch-label i.sun {
    left: 5px; 
}

.theme-switch-label i.moon {
    right: 5px; 
}


.theme-switch-label::after {
    content: '';
    width: 24px;
    height: 24px;
    background-color: #ffffff; 
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    z-index: 5; 
}


.theme-switch-checkbox:checked + .theme-switch-label::after {
    transform: translateX(40px);
}
