* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #111;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 10px 20px;
}
.left,
.right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 35px;
  width: 35px;
  object-fit: cover;
  border-radius: 50%;
  cursor: pointer;
}

.top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text {
  display: flex;
  flex-direction: column;
}

.name {
  font-size: 13.5px;
  cursor: pointer;
}

.name a {
  text-decoration: none;
  color: #9b9dad;
}

.title {
  font-size: 19.5px;
  font-weight: 600;
  color: #ffffff;
  display: block;
}

.follow {
  font-size: 12px;
  padding: 3px 8px;
  background: #22c55e;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}

.follow a {
  text-decoration: none;
  color: black;
}

.right button {
  height: 40px;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.heart {
  padding: 6px 8px;
  background-color: #3a3f4a;
  color: #ffffff;
  font-size: 16px;
  position: relative;
}

.code {
  background-color: #444857;
}

.code a {
  text-decoration: none;
  color: #ffffff;
}

.sign-up {
  background-color: #22c55e;
  color: black;
  font-weight: 500;
}

.log-in {
  background-color: #3a3f4a;
  color: #ffffff;
}

main {
  margin-top: 100px;
  display: flex;
  justify-content: center;
}
:root {
  --bg-light: linear-gradient(135deg, #8edfa8, #3ec7c9);
  --bg-dark: linear-gradient(135deg, #0f172a, #1e293b, #134e4a);
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg-light);
  transition: background 0.4s ease;
  overflow-x: hidden;
}

body.dark {
  background: var(--bg-dark);
}

:root {
  /* Light  */
  --calc-light: #e6e6e6;
  --btn-light: #e0e0e0;
  --text-light: #333;

  /* Dark  */
  --calc-dark: #1e293b;
  --btn-dark: #2c2f3a;
  --text-dark: #e5e7eb;

  /* Accents */
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
}
.Calculator {
  height: 550px;
  width: 325px;
  background-color: white;
  position: relative;
  top: 10px;
  border-radius: 20px;
  background: var(--calc-light);
  color: var(--text-light);
  box-shadow:
    12px 12px 25px rgba(0, 0, 0, 0.2),
    -12px -12px 25px rgba(255, 255, 255, 0.5);
}

body.dark .Calculator {
  background: var(--calc-dark);
  color: var(--text-dark);
  box-shadow:
    12px 12px 25px rgba(0, 0, 0, 0.8),
    -12px -12px 25px rgba(255, 255, 255, 0.05);
}

.toggle {
  height: 30px;
  width: 60px;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 3px;
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: 0.3s;
  cursor: pointer;
}

body.dark .toggle {
  background-color: #2c2f3a;
}

.circle {
  height: 24px;
  width: 24px;
  background: #2f2f2f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  box-shadow:
    2px 2px 5px rgba(0, 0, 0, 0.2),
    -2px -2px 5px rgba(255, 255, 255, 0.4);
}

body.dark .circle {
  background: #d7d2d2;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.icon {
  font-size: 12px;
}

.toggle.active .circle {
  transform: translateX(30px);
  background: #fff;
  transition: 0.3s;
}

.wrapped {
  position: relative;
  display: flex;
  justify-content: center;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(2);
  }
  100% {
    transform: scale(1);
  }
}

.pop {
  animation: pop 0.3s ease;
}

.display {
  height: 100px;
  margin: 20px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  font-size: 28px;
  background: var(--calc-light);
  box-shadow:
    inset 6px 6px 12px rgba(0, 0, 0, 0.15),
    inset -6px -6px 12px rgba(255, 255, 255, 0.9);
  overflow-x: auto;
  white-space: nowrap;
}
.display::-webkit-scrollbar {
  display: none;
}

body.dark .display {
  background: var(--calc-dark);
  box-shadow:
    inset 6px 6px 12px rgba(0, 0, 0, 0.8),
    inset -6px -6px 12px rgba(255, 255, 255, 0.05);
}
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  padding: 20px;
  grid-template-areas:
    "ac percent div mul"
    "seven eight nine sub"
    "four five six plus"
    "one two three equal"
    "zero zero dot equal";
}

/* Font size for operators */
.buttons .div,
.buttons .mul,
.buttons .sub,
.buttons .plus,
.buttons .percent,
.buttons .equal,
.buttons .dot {
  font-size: 26px;
  font-weight: 500;
}

.ac {
  grid-area: ac;
}
.div {
  grid-area: div;
}
.mul {
  grid-area: mul;
}
.sub {
  grid-area: sub;
}

.seven {
  grid-area: seven;
}
.eight {
  grid-area: eight;
}
.nine {
  grid-area: nine;
}
.plus {
  grid-area: plus;
}

.four {
  grid-area: four;
}
.five {
  grid-area: five;
}
.six {
  grid-area: six;
}

.one {
  grid-area: one;
}
.two {
  grid-area: two;
}
.three {
  grid-area: three;
}

.buttons button {
  min-height: 60px;
  border-radius: 15px;
  border: none;
  font-size: 18px;
  background: var(--calc-light);
  color: var(--text-light);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.15),
    -6px -6px 12px rgba(255, 255, 255, 0.9);
  transition: all 0.15s ease;
  cursor: pointer;
}

/* Operators (light mode) */
body:not(.dark) .buttons .div,
body:not(.dark) .buttons .mul,
body:not(.dark) .buttons .sub,
body:not(.dark) .buttons .plus,
body:not(.dark) .buttons .percent {
  color: var(--blue);
}

/* Font size  operators */
body:not(.dark) .buttons .div,
body:not(.dark) .buttons .mul,
body:not(.dark) .buttons .sub,
body:not(.dark) .buttons .plus,
body:not(.dark) .buttons .percent,
body:not(.dark) .buttons .equal,
body:not(.dark) .buttons .dot {
  font-size: 26px;
}

body:not(.dark) .buttons .percent {
  color: var(--blue);
}

body:not(.dark) .buttons .equal {
  color: #16a34a;
}

.buttons button:active {
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.2),
    inset -4px -4px 8px rgba(255, 255, 255, 0.8);
  transform: scale(0.97);
}

body.dark .buttons button {
  background: var(--calc-dark);
  color: var(--text-dark);
  background: var(--btn-dark);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.7),
    -6px -6px 12px rgba(255, 255, 255, 0.04);
}
body.dark .buttons button:active {
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.8),
    inset -4px -4px 8px rgba(255, 255, 255, 0.05);
}

/* AC  */
.buttons button:first-child {
  color: var(--red);
}

.percent {
  grid-area: percent;
  color: var(--blue);
}

.equal {
  color: var(--green);
  grid-area: equal;
  align-self: stretch;
  height: 100%;
  color: #22c55e;
  font-size: 24px;
  font-weight: 600;
}
.zero {
  grid-area: zero;
}
body:not(.dark) .buttons .zero {
  color: #f59e0b;
}
.dot {
  grid-area: dot;
}

@media (max-width: 480px) {
  .Calculator {
    width: 95%;
    max-width: 340px;
    height: auto;
    margin: 20px auto;
    padding-bottom: 15px;
  }

  .buttons {
    gap: 12px;
    padding: 16px;
  }
  .buttons buttons {
    min-height: 52px;
    font-size: 15px;
  }

  .display {
    height: 85px;
    font-size: 20px;
    margin: 15px;
  }

  main {
    margin-top: 140px;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .left {
    width: 100%;
  }

  .right {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .right button {
    flex: 1 1 auto;
    height: 32px;
    font-size: 12px;
    padding: 4px 6px;
  }

  .toggle {
    top: -55px;
  }
}

@media (max-width: 375px) {
  .Calculator {
    width: 92%;
    max-width: none;
  }
}
