body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #d4d4d4;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease;
}

body.light-mode {
    background-color: #f0f0f0;
}

#calculator {
    display: flex;
    flex-direction: column;
    width: 380px;
    padding: 20px;
    border-radius: 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background-color: #1a1a1a;
    position: relative;
    transition: all 0.3s ease;  
}

body.light-mode #calculator {
    background-color: #f0f0f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 0.001px solid #ff0ba150;
}

/* Moon icon in top left */
#calculator::before {
    content: '🌙';
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.3s ease;  
    
}

body.light-mode #calculator::before {
    content: '☀️';
    opacity: 0.8;
}

#display {
    height: 140px;
    margin: 0 0 20px 0;
    border-radius: 25px;
    background-color: #000000;
    color: #ffffff;
    font-size: 4em;
    text-align: right;
    padding: 30px 25px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    overflow: hidden;
    border: none;
    letter-spacing: -2px;
    transition: all 0.3s ease;
}

body.light-mode #display {
    background-color: #ffffff;
    color: #1a1a1a;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    border: 0.001px solid #ff0ba150;
}

/* 3D Toggle Slider - FIXED */
.mode-toggle {
    position: absolute;
    top: 185px;
    left: 120px;  
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-checkbox {
    display: none;
}

.toggle-label {
    position: relative;
    width: 70px;
    height: 35px;
    background: linear-gradient(145deg, #2a2a2a, #1f1f1f);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.5),
        inset -2px -2px 5px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    border: 0.001px solid #bda4b350;
}

body.light-mode .toggle-label {
    background: linear-gradient(145deg, #e6e6e6, #f5f5f5);
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.1),
        inset -2px -2px 5px rgba(255, 255, 255, 0.8);
}

.toggle-button {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 29px;
    height: 29px;
    background: linear-gradient(145deg, #ff6b6b, #ff5252);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.3),
        -1px -1px 3px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-checkbox:checked + .toggle-label .toggle-button {
    left: 38px;
    background: linear-gradient(145deg, #ffd93d, #ffb93d);
}

.toggle-icon {
    font-size: 14px;
    transition: all 0.3s ease;
}

.toggle-checkbox:checked + .toggle-label .toggle-button .toggle-icon::before {
    content: '☀️';
}

.toggle-checkbox:not(:checked) + .toggle-label .toggle-button .toggle-icon::before {
    content: '🌙';
}

.mode-text {
    font-size: 0.85em;
    color: #ff9999;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

body.light-mode .mode-text {
    color: #666;
}

/* Clear button */
.CLear-btn {
    position: absolute;
    top: 180px;
    left: 24px;
    width: 70px;
    height: 50px;
    border: none;
    border-radius: 25px;
    background-color: #2a2a2a;
    color: #ff6b6b;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.2s ease;
}

body.light-mode .CLear-btn {
    background-color: #ffaaaa;
    color: #333;
    transition: all 0.2s ease;
}

.CLear-btn:hover {
    background-color: #333;
    transform: scale(1.05);
}

body.light-mode .CLear-btn:hover {
    background-color: #ff9999;
}

.CLear-btn:active {
    transform: scale(0.95);
    background-color: #333333c0;
}

body.light-mode .CLear-btn:active {
    background-color: #ff8888;
}

#keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 60px 0 0 0;
}

.btn {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 2px solid #333;
    background-color: #1a1a1a;
    color: #ff9999;
    font-size: 1.8em;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 300;
    box-shadow: none;
    transition: all 0.2s ease;
    border: 0.001px solid #fffdfe50;
}

body.light-mode .btn {
    background-color: #2a2a2a;
    border-color: #1a1a1a;
    color: #ff9999;
    border: 2px solid #ff0ba150;
}

.btn:hover {
    background-color: #2a2a2a;
    border-color: #444;
    transform: scale(1.05);
}

body.light-mode .btn:hover {
    background-color: #333;
}

.btn:active {
    transform: scale(0.95);
    background-color: #333;
}

/* Equals button - FIXED SELECTOR */
.Equal-btn:nth-child(15) {
    background-color: #ffb3ba;
    color: #000000;
    font-weight: 500;
    width: 75px;
    height: 75px;
    border: none;
    border-radius: 50%;
    font-size: 1.8em;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 300;
    box-shadow: none;
    transition: all 0.3s ease;
}

.Equal-btn:nth-child(15):hover {
    background-color: #ffc9ce;
}

.Equal-btn:nth-child(15):active {
    transform: scale(0.95);
    background-color: #ffaaaa;
}


/* Operator buttons styling */
.operator {
    color: #ff9999;
}

/* Decimal point button */
.btn:nth-child(14) {
    font-size: 2.5em;
    line-height: 0.6;
}

