body{
    margin:0;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: 
linear-gradient(135deg, #1e3c72, #2a5298);
}

.calculator{
    background: #ffffff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 35px
    rgba(0,0,0,0.2);
    width: 300px;
    text-align: center;
    border: 1px solid #ddd;
    transition: 0.3s;
    margin: 20px 0;
}

.calculator input{
    width: 100%;
    height: 50px;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: right;
    padding: 10px;
    box-sizing: border-box;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.calculator button{
    width: 60px;
    height: 60px;
    font-size: 20px;
    margin: 5px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background-color: #f1f3f6;
    transition: 0.3s;
    color: #222;
    font-weight: bold;
    outline: none;
}

.calculator button:hover{
    background-color: #2563eb;
    color: white;
    transform: scale(1.05);
}

.buttons{
    display: grid;
    grid-template-columns: 
   repeat(4 , 1fr);
     gap: 10px;
}

.zero{
    grid-column: span 1;
}

.operator{
    background-color: #f59e0b;
    color: white;
}

.operator:hover{
    background-color: #d97706;
}

.clear{
    background-color: #ef4444;
    color: white;
}

.calculator button:active{
    transform: scale(0.95);
}

.calculator:hover{
    box-shadow: 0px 0px 20px
    gray;
}

.delete{
    background-color: #374151;
    color: white;
}

@media (max-width: 500px) {

.calculator {
        width: 90%;
        padding: 15px;
}
    
.calculator button {
        width: 100%;
        height: 55px;
        font-size: 18px;
}   

.calculator input {
        font-size: 18px;
    }

}

.dark{
    background: #1f1f1f !important;
    color: white;
}

.dark input{
    background: #333;
    color: white;
    border: 2px solid #555;
}

.dark button{
    background: #444;
    color: white;
}

.dark .operator{
    background: orange;
}

.dark .clear{
    background: red;
}

.dark .delete{
    background: #666;
}

body.dark{
    background:
linear-gradient(135deg, #000000, #222222)
}

.dark button:hover{
    background: #2563eb;
    color: white;
}

.top-bar{
    display: flex;
    justify-content:
space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.top-bar h1{
    margin: 0;
    font-size: 28px;
    flex: 1;
    text-align: left;
}

#themeBtn{
    width: 45px;
    height: 45px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #222;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

#historyBtn{
    width: 85%;
    height: 42px;
    margin: 8px auto;
    display: block;
    background: #eef3ff !important;
    color: #222 !important;
    border: none;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

#clearHistory{
    width: 85%;
    height: 42px;
    margin: 8px auto 12px;
    padding: 0;
    margin-bottom: 12px;
    font-size: 16px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    background: #ffe9e9;
    color: #e11d48;
    border: none;
    cursor: pointer;
    display: block;
}

#clearHistory:hover{
    background: #2563eb;
    color: white;
}

.equal{
    background:#2563eb !important;
    color:white;
}

.equal:hover{
    background: #1d4ed8;
}

.dark .equal{
    background:#2563eb !important;
}

.top-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.menu-btn {
    width: 45px !important;
    height: 45px !important;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #222;
    font-size: 26px;
    cursor: pointer;
    color: white;
}

.menu {
    display: none;
    position: absolute;
    top: 58px;
    right: -15px;
    width: 230px;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    z-index: 1000;
}

.menu button {
    display: block;
    width: 100%;
    height: 42px;
    margin: 0 0 10px 0;
    padding: 10px 15px;
    border: none;
    background: white;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    border-radius: 10px;
    padding: 0;
}

.menu button:hover {
    background: #f2f2f2;
}

#historyList{
    display: none;
    list-style: none;
    padding: 0;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #eee;
}

#historyList li{
    display: block;
    text-align: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

#historyList li:hover{
    background: #e8f0fe;
    transform: translateX(3px);
}

.dark #historyList li{
    background: #444;
    border-color: #666;
    color: white;
}

.dark #historyList li:hover{
    background: #555;
}

.menu.show{
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dark .menu{
    background: #2d2d2d;
}

.dark #historyBtn{
    background: #444 !important;
    color: white !important;
}

.dark #clearHistory{
    background: #6b1f1f;
    color: white;
}

