*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body{
    background-color: #f4f4f4;
    color: #222;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header{
    background: transparent;
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.toggle-btn{
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.3s;
    cursor: pointer;
    width: auto;
    margin: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.6);
    padding: 5px 10px;
}

.toggle-btn:hover{
    transform: rotate(20deg);
}

.container{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90svh;
    padding: 20px;
}

.calculator{
    background: transparent;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 30px;
    gap: 14px;
    margin: 20px;
    max-width: 340px;
    width: 100%;    
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
    border-radius: 35px;
    transition: background-color 0.3s;
}

input{
    padding: 20px;
    width: 100%;
    grid-column: span 4;
    font-size: 40px;
    height: 80px;
    margin: 30px 0;
    text-align: end;
    border-radius: 40px;
    color: #555;
    border: none;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.16);
}

button{
    height: 60px;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    box-shadow: rgba(6,24,44,0.4) 0px 0px 0px 2px, rgba(6,24,44,0.65) 0px 4px 6px -1px, rgba(255,255,255, 0.08) 0px 1px 0px inset;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    transition: transform 0.2s, background-color 0.2s, color 0.2s;
}

button:active{
    transform: scale(0.95);
}


button:hover{
    transform: scale(1.05);
}

button:focus{
    outline: 2px solid #222;
}

.equal{
     grid-column: span 2;/* spans 2 cells */
}


/* dark mode styling */
body.dark-mode{
    background-color: #121212;
    color: #f9f9f9;
}

body.dark-mode .toggle-btn{
    color: #555;
    background: #222;
}

body.dark-mode .calculator{
    background-color: #1e1e1e;
    box-shadow: inset 6px 6px 12px #111, inset -6px -6px 12px #333;
}

body.dark-mode input{
    color: #555;
    background: #222;
    box-shadow: 0 2px 5px rgba(0,0,0,0.16);
}

body.dark-mode button{
    background: #222;
    color: #555;
}

/* responsiveness on mobile screen */
@media (max-width: 400px) {
    .calculator {
        padding: 20px;
        gap: 10px;
    }

    input {
        font-size: 32px;
        height: 70px;
        margin: 20px 0;
    }

    button {
        min-height: 44px;
        font-size: 1rem;
    }
}
