body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    font-family: 'Segoe UI', sans-serif;
}

#calculator {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    width: 240px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

#display {
    margin-bottom: 15px;
    width: 100%;
    height: 50px;
    font-size: 22px;
    text-align: right;
    padding: 8px;
    border: none;
    outline: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: #f1eeee;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.button-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.button {
    height: 50px;
    font-size: 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.button:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.button:active {
    transform: scale(0.9);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.operator {
    background: rgba(255, 140, 0, 0.229);
}

.equal {
    background: #00c9a1;
}

.clear {
    background: #ff4d4d;
}

.delete {
    background: #ff9f43;
}

.button:first-child {
    font-size: 14px;
    background: rgba(255,255,255,0.15);
}

.footer {
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #ddd;
}

.footer a {
    display: inline-block;
    margin: 5px;
    color: #00c9a7;
    text-decoration: none;
    transition: 0.2s;
}

.footer a:hover {
    color: #00ffcc;
    transform: scale(1.1);
}

.footer img {
    transition: 0.3s;
}

.footer img:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px #00ffcc);
}

.history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.history-content {
    background: rgba(30, 30, 47, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 15px;
    width: 280px;
    max-height: 400px;
    overflow-y: auto;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-header button {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 14px;
}

.history-header button:hover {
    color: #ff3b3b;
}

.history-item {
    padding: 6px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #ddd;
}

.history-content::-webkit-scrollbar {
    width: 5px;
}

.history-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 500px) {
    #calculator {
        width: 90%;
        padding: 15px;
    }

    .button {
        height: 45px;
        font-size: 16px;
    }

    #display {
        height: 45px;
        font-size: 18px;
    }

    .history-content {
        width: 90%;
    }
}