* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --accent-color: #0f3460;
    --text-light: #ffffff;
    --text-secondary: #b8c1ec;
    --display-bg: rgba(255, 255, 255, 0.1);
    --button-primary: rgba(255, 255, 255, 0.15);
    --button-hover: rgba(255, 255, 255, 0.25);
    --button-active: rgba(255, 255, 255, 0.35);
    --operator-gradient: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    --equals-gradient: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.3);
}

.centerElements {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body {
    background: var(--primary-gradient);
    background-attachment: fixed;
    font-size: 18px;
    color: var(--text-light);
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"><animate attributeName="opacity" values="0;1;0" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"><animate attributeName="opacity" values="0;1;0" dur="4s" repeatCount="indefinite"/></circle><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"><animate attributeName="opacity" values="0;1;0" dur="2s" repeatCount="indefinite"/></circle></svg>') repeat;
    pointer-events: none;
    z-index: -1;
}

.calculator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.8s ease-out;
}

.calculator::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent,
        rgba(255, 255, 255, 0.03)
    );
    animation: rotate 10s linear infinite;
    pointer-events: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

.display {
    width: 350px;
    height: 120px;
    background: var(--display-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin-bottom: 25px;
    padding: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-light);
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.2),
        0 2px 10px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.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
    );
    transition: left 0.5s ease;
}

.display:hover::before {
    left: 100%;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 15px;
    width: 350px;
    height: 450px;
}

.spanColTwo {
    grid-column-end: span 2;
}

button {
    background: var(--button-primary);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: var(--text-light);
    font-size: 1.4rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    outline: none;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.5s ease;
}

button:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    background: var(--button-active);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.oper {
    background: var(--operator-gradient);
    color: white;
    font-weight: 600;
}

.oper:hover {
    background: var(--operator-gradient);
    filter: brightness(1.1);
    transform: translateY(-3px);
}

.cbtn, .delbtn {
    background: var(--secondary-gradient);
    color: white;
    font-weight: 600;
}

.cbtn:hover, .delbtn:hover {
    background: var(--secondary-gradient);
    filter: brightness(1.1);
    transform: translateY(-3px);
}

.equals {
    background: var(--equals-gradient) !important;
    color: white;
    font-weight: 700;
    font-size: 1.6rem;
}

.equals:hover {
    background: var(--equals-gradient) !important;
    filter: brightness(1.1);
    transform: translateY(-3px);
}

.num {
    font-weight: 400;
}

@media (max-width: 480px) {
    .calculator {
        padding: 20px;
        margin: 20px;
    }
    
    .display {
        width: 300px;
        height: 100px;
        font-size: 2rem;
    }
    
    .buttons {
        width: 300px;
        height: 380px;
        gap: 10px;
    }
    
    button {
        font-size: 1.2rem;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.num:active {
    animation: pulse 0.2s ease;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 4px 25px rgba(255, 107, 107, 0.4); }
}

.oper:hover {
    animation: glow 2s infinite;
}

