* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
            background-size: 400% 400%;
            animation: gradientShift 15s ease infinite;
            padding: 20px;
        }

        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .calculator {
            background: rgba(20, 20, 30, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 30px;
            padding: 30px;
            box-shadow: 
                0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 100px rgba(147, 51, 234, 0.2),
                inset 0 0 20px rgba(255, 255, 255, 0.05);
            max-width: 400px;
            width: 100%;
            animation: slideUp 0.5s ease-out;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .display {
            background: linear-gradient(135deg, rgba(30, 30, 40, 0.9), rgba(40, 40, 50, 0.9));
            border-radius: 20px;
            padding: 25px;
            margin-bottom: 25px;
            text-align: right;
            box-shadow: 
                inset 0 5px 15px rgba(0, 0, 0, 0.5),
                0 2px 5px rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.05);
            position: relative;
            overflow: hidden;
        }

        .display::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            animation: shine 3s ease-in-out infinite;
        }

        @keyframes shine {
            0% { left: -100%; }
            100% { left: 200%; }
        }

        .previous-operand {
            color: rgba(255, 255, 255, 0.5);
            font-size: 18px;
            min-height: 25px;
            word-wrap: break-word;
            word-break: break-all;
            transition: all 0.3s ease;
        }

        .current-operand {
            color: #fff;
            font-size: 36px;
            font-weight: 300;
            min-height: 45px;
            word-wrap: break-word;
            word-break: break-all;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0.7; }
            to { opacity: 1; }
        }

        .buttons {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
        }

        button {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            color: #fff;
            cursor: pointer;
            font-size: 20px;
            padding: 22px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            font-weight: 400;
        }

        button::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        button:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 
                0 10px 25px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(147, 51, 234, 0.3);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
        }

        button:active {
            transform: translateY(-1px) scale(0.98);
            transition: all 0.1s;
        }

        button:active::before {
            width: 300px;
            height: 300px;
        }

        .span-two {
            grid-column: span 2;
        }

        .operator {
            background: linear-gradient(135deg, #667eea, #764ba2);
            font-weight: 500;
            position: relative;
            z-index: 1;
        }

        .operator:hover {
            background: linear-gradient(135deg, #764ba2, #667eea);
            box-shadow: 
                0 10px 30px rgba(102, 126, 234, 0.4),
                0 0 40px rgba(118, 75, 162, 0.3);
        }

        .equals {
            background: linear-gradient(135deg, #f093fb, #f5576c);
            font-weight: 600;
        }

        .equals:hover {
            background: linear-gradient(135deg, #f5576c, #f093fb);
            box-shadow: 
                0 10px 30px rgba(240, 147, 251, 0.4),
                0 0 40px rgba(245, 87, 108, 0.3);
        }

        .clear, .delete {
            background: linear-gradient(135deg, rgba(245, 87, 108, 0.7), rgba(240, 147, 251, 0.7));
        }

        .clear:hover, .delete:hover {
            background: linear-gradient(135deg, rgba(245, 87, 108, 0.9), rgba(240, 147, 251, 0.9));
            box-shadow: 
                0 10px 30px rgba(245, 87, 108, 0.3),
                0 0 40px rgba(240, 147, 251, 0.2);
        }

        /* Responsive Design */
        @media (max-width: 480px) {
            .calculator {
                padding: 20px;
                border-radius: 25px;
            }

            .display {
                padding: 20px;
                border-radius: 15px;
                margin-bottom: 20px;
            }

            .previous-operand {
                font-size: 16px;
                min-height: 22px;
            }

            .current-operand {
                font-size: 28px;
                min-height: 40px;
            }

            .buttons {
                gap: 10px;
            }

            button {
                font-size: 18px;
                padding: 18px;
                border-radius: 12px;
            }
        }

        @media (max-width: 360px) {
            body {
                padding: 10px;
            }

            .calculator {
                padding: 15px;
            }

            .display {
                padding: 15px;
            }

            .previous-operand {
                font-size: 14px;
            }

            .current-operand {
                font-size: 24px;
            }

            button {
                font-size: 16px;
                padding: 15px;
            }

            .buttons {
                gap: 8px;
            }
        }

        /* Animation for number input */
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }

        .pulse {
            animation: pulse 0.2s ease;
        }

        /* Loading animation */
        .calculating {
            position: relative;
        }

        .calculating::after {
            content: '';
            position: absolute;
            bottom: 5px;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, transparent, #667eea, transparent);
            animation: loading 1s linear infinite;
        }

        @keyframes loading {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }