/* Main Calculator Container */
.calculator-container {
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 2px solid var(--glass-border);
    border-radius: 28px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 10px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 40px rgba(79, 70, 229, 0.15);
    overflow: hidden;
    width: 100%;
    max-width: 820px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Fit to screen mode - calculator always fits in viewport */
.calculator-container.fit-screen {
    max-height: calc(100vh - 30px);
}

.calculator-container.fit-screen .buttons-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calculator-container.fit-screen .buttons,
.calculator-container.fit-screen .scientific-btns {
    flex: 1;
    min-height: 0;
}

.calculator-container.fit-screen .btn {
    aspect-ratio: unset;
    min-height: 40px;
    height: 100%;
}

.calculator-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(79, 70, 229, 0.05) 0%,
        transparent 50%,
        rgba(6, 182, 212, 0.05) 100%
    );
    pointer-events: none;
    z-index: -1;
}

.buttons-container {
    background: linear-gradient(135deg, var(--dark-lighter) 0%, rgba(26, 26, 46, 0.98) 100%);
    padding: 12px;
    border-top: 1px solid var(--border);
}