* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(45deg, #2c3e50, #3498db);
}

.calculator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 350px;
}

.display {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: right;
}

.history {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    min-height: 20px;
    margin-bottom: 5px;
}

.current {
    font-size: 40px;
    color: white;
    word-wrap: break-word;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

button {
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.operator {
    background: rgba(52, 152, 219, 0.3);
}

.equals {
    background: #2ecc71;
    grid-column: span 2;
}

.clear {
    background: #e74c3c;
}

.memory {
    background: rgba(155, 89, 182, 0.3);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

body.light-mode {
    background: linear-gradient(45deg, #e0e0e0, #ffffff);
}

body.light-mode .calculator {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.light-mode .display {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .current {
    color: #333;
}

body.light-mode .history {
    color: #666;
}

body.light-mode button {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-mode .operator {
    background: rgba(52, 152, 219, 0.2);
}

body.light-mode .equals {
    background: #27ae60;
    color: white;
}

body.light-mode .clear {
    background: #c0392b;
    color: white;
}

body.light-mode .memory {
    background: rgba(155, 89, 182, 0.2);
}


/* Responsive Design */
@media screen and (max-width: 480px) {
    .calculator {
        width: 95%;
        max-width: 320px;
        padding: 15px;
    }

    .display {
        padding: 15px;
        margin-bottom: 15px;
    }

    .current {
        font-size: 32px;
    }

    .history {
        font-size: 12px;
    }

    .buttons {
        gap: 8px;
    }

    button {
        padding: 12px;
        font-size: 16px;
    }
}

@media screen and (max-width: 320px) {
    .calculator {
        padding: 10px;
    }

    .display {
        padding: 10px;
        margin-bottom: 10px;
    }

    .current {
        font-size: 28px;
    }

    .buttons {
        gap: 6px;
    }

    button {
        padding: 10px;
        font-size: 14px;
    }

    .theme-toggle {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media screen and (max-height: 600px) {
    .calculator {
        margin: 10px auto;
    }

    body {
        align-items: flex-start;
        padding-top: 20px;
    }
}