:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --calc-bg: rgba(255, 255, 255, 0.05);
    --calc-border: rgba(255, 255, 255, 0.1);
    --btn-bg: rgba(255, 255, 255, 0.05);
    --btn-hover: rgba(255, 255, 255, 0.15);
    --btn-active: rgba(255, 255, 255, 0.25);
    --btn-operator-bg: rgba(99, 102, 241, 0.2);
    --btn-operator-hover: rgba(99, 102, 241, 0.4);
    --btn-equals-bg: rgba(236, 72, 153, 0.6);
    --btn-equals-hover: rgba(236, 72, 153, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --blur-strong: blur(16px);
}

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

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

/* Decorative Background Shapes */
.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #6366f1;
}

.shape-2 {
    bottom: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: #ec4899;
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 60%;
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    animation-delay: -2s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Calculator Container */
.calculator {
    background: var(--calc-bg);
    backdrop-filter: var(--blur-strong);
    -webkit-backdrop-filter: var(--blur-strong);
    border: 1px solid var(--calc-border);
    border-radius: 24px;
    padding: 32px;
    width: 360px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Display Screen */
.display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    min-height: 120px;
    word-wrap: break-word;
    word-break: break-all;
}

.previous-operand {
    color: var(--text-secondary);
    font-size: 1.1rem;
    min-height: 1.5rem;
    font-weight: 300;
}

.current-operand {
    color: var(--text-primary);
    font-size: 3rem;
    font-weight: 500;
    line-height: 1;
}

/* Keypad Grid */
.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Buttons */
.btn {
    background: var(--btn-bg);
    border: 1px solid var(--calc-border);
    border-radius: 16px;
    padding: 16px 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
    background: var(--btn-active);
    transform: translateY(1px);
}

.btn-zero {
    grid-column: span 2;
    border-radius: 16px;
}

.operator {
    background: var(--btn-operator-bg);
    color: #a5b4fc;
    font-weight: 500;
}

.operator:hover {
    background: var(--btn-operator-hover);
}

.operator-special {
    color: #fca5a5;
    font-weight: 500;
}

.operator-equals {
    background: var(--btn-equals-bg);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.operator-equals:hover {
    background: var(--btn-equals-hover);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}
