:root {
    --bg-color: #0f172a;
    --calc-bg: rgba(30, 41, 59, 0.7);
    --display-bg: rgba(15, 23, 42, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-orange: #f97316;
    --accent-violet: #8b5cf6;
    --accent-slate: rgba(51, 65, 85, 0.8);
    --btn-hover: rgba(71, 85, 105, 0.9);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

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

/* Background Decorations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    opacity: 0.4;
}

.blob-1 {
    background: var(--accent-violet);
    top: -100px;
    left: -100px;
}

.blob-2 {
    background: var(--accent-orange);
    bottom: -100px;
    right: -100px;
}

/* Calculator Container */
.calculator-container {
    padding: 20px;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.8s ease-out;
}

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

.calculator {
    background: var(--calc-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 24px;
    box-shadow: var(--shadow);
}

/* Display */
.display {
    background: var(--display-bg);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    word-wrap: break-word;
    word-break: break-all;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.previous-operand {
    color: var(--text-secondary);
    font-size: 1rem;
    min-height: 1.5rem;
    transition: all 0.2s;
}

.current-operand {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s;
}

/* Buttons Grid */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn {
    border: none;
    outline: none;
    border-radius: 16px;
    background: var(--accent-slate);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    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.2);
}

.btn:active {
    transform: scale(0.95) translateY(0);
}

.btn-operator {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-violet);
    font-size: 1.5rem;
}

.btn-operator:hover {
    background: rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

.btn-equals {
    background: var(--accent-orange);
    color: white;
    grid-row: span 2;
}

.btn-equals:hover {
    background: #ea580c;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

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

/* Responsive adjustments */
@media (max-width: 380px) {
    .calculator {
        padding: 16px;
    }
    
    .btn {
        padding: 14px;
        font-size: 1.1rem;
    }
    
    .current-operand {
        font-size: 2rem;
    }
}
