:root {
  /* Define default (light) colors */
  --bg-color: #2370eb;
  --calculator-bg: #c0dafa;
  --text-color: #002185;
  --size: 320px;
  --gap: 6px;
}
/*BODY AND CALCULATOR STYLE*/
body {
  /* Use the variable */
  background: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  font-family: Arial, sans-serif;
  transition: background 0.3s ease; /* Smooth transition */
}
h1 {
    font-family: "Jersey 10", sans-serif;
    font-size: 50px;
    margin: 0px 0px 20px 0px;
    color: whitesmoke;
    text-shadow:4px 4px 8px black;
}

.calculator {
    width: var(--size);
    border: 8px solid #002185;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    background: #c0dafa;
    box-shadow: 0px 0px 10px #002185;
}

.display {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;

    font-family: "Jersey 10", sans-serif;
    color: #002185;
    height: 10%;
    min-height: 80px;
    border-bottom: 8px solid #002185;
    display: flex;
    padding: 0.5rem;
    font-size: 3.5rem;
    box-sizing: border-box;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    padding: var(--gap);
}

.btn {
    font-family: "Jersey 10", sans-serif;
    color: #002185;
    font-weight: bold;
    aspect-ratio: 1 / 1;
    border: 4px solid #002185;
    background: #97c1f7;
    font-size: 3rem;
    cursor: pointer;
    border-radius: 5px;

    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    background: #c9dcff;
}

.operator { background: #1e7ff7; color: whitesmoke; text-shadow: 0px 0px 12px black}
.action { background: #fc2d1e;}
.equals { background: #00ccff; grid-column: span 2; aspect-ratio: auto;}
.btn.action {
    font-size: 2rem;
}

/*THEME TOGGLE STYLE*/
#theme-btn {
    position: absolute;
    top: 15px;
    left: 10px;
    z-index: 999;
    cursor: pointer;
    background: #002185;
    border: none;

    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


#theme-imgs {
    width: 35px;
    height: 35px;
    filter: invert(100%);
}

#theme-btn:active {transform: translateY(2px);}

/*DARK MODE THEME*/
body.dark-theme {
  --bg-color: #011701;
}
.calculator {
  background: var(--calculator-bg);
}
body.dark-theme .calculator {
  --calculator-bg: #0f752f;
  border: 8px solid #00ff50;
  box-shadow: 0px 0px 10px #00ff50;
}
body.dark-theme h1{
    color: #2eff51;
    text-shadow:
        0 0 5px #2eff51,
        0 0 15px #2eff51,
        0 0 20px rgba(0, 255, 81, 0.5);
}

body.dark-theme .display{
    color: #00ff50;
    border-bottom: 8px solid #00ff50;
}

body.dark-theme .btn {
    color:#2eff51;
    border: 4px solid #00ff50;
    background: #025e02;
}
body.dark-theme .btn:active {
    background: #269126;
}

body.dark-theme #theme-btn {
    background: #17ad46;
}
body.dark-theme #theme-imgs {
    filter: invert(0%);
}

/* DISABLED STATE ERROR STATE*/
.btn-disabled {
    opacity: 0.25;
    cursor: not-allowed !important;
    pointer-events: none;
    filter: grayscale(100%) blur(0.5px);
    transform: scale(0.95)
}
.btn.error-pulse {
    animation: pulse 2s infinite;
    box-shadow: 0 0 15px rgba(252, 45, 30, 0.5);
    z-index: 10;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
