* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: black;
    padding: 20px;
    transition: background 0.5s ease;
}

body.light-theme {
    background: white;
}

.calculator-container {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.light-theme .calculator-container {
    background: #f8f9fa;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    padding: 25px;
    border-radius: 25px;
    
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.light-theme .calculator-header {
    color: black;
}

.calculator-title {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.mode-switch {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.5s ease;
}

.light-theme .mode-switch {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mode-switch:hover {
    background: rgba(255, 255, 255, 0.25);
}

.light-theme .mode-switch:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: right;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    transition: background 0.3s ease;
}

.light-theme .display {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.05);
}

.previous-operand {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    min-height: 1.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.light-theme .previous-operand {
    color: rgba(0, 0, 0, 0.6);
}

.current-operand {
    font-size: 2.8rem;
    font-weight: 500;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.light-theme .current-operand {
    color: rgba(0, 0, 0, 0.9);
}

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

.button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 15px;
    padding: 18px 0;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.light-theme .button {
    background: rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1;
}

.light-theme .button::before {
    background: rgba(255, 255, 255, 0.3);
}

.button:hover::before {
    transform: translateX(0);
}

.button:active {
    transform: scale(0.95);
}

.operator {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.light-theme .operator {
    background: rgba(255, 255, 255, 0.7);
}

.equals {
    background: rgba(255, 140, 0, 0.8);
    font-weight: 500;
}

.light-theme .equals {
    background: rgba(255, 140, 0, 0.9);
}

/* Responsive design */
@media (max-width: 400px) {
    .calculator-container {
        padding: 15px;
    }
    
    .button {
        padding: 15px 0;
        font-size: 1.3rem;
    }
    
    .current-operand {
        font-size: 2.4rem;
    }
}