* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Roboto Mono", monospace;
  font-weight: 400px;
}
body {
  height: 100vh;
  background: linear-gradient(to bottom, #DC143C 50%, #ffffff 50%);
  font-size: 27px;
}
.calculator {
  width: 90%; 
  max-width: 400px; 
  background-color: #15173c;
  padding: 50px 30px;
  position: absolute;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 5, 24, 0.4);
}

.display {
  width: 100%;
}

.display input {
  width: 100%;
  padding: 15px 10px;
  text-align: right;
  border: none;
  background-color: transparent;
  color: #ffffff;
  font-size: 35px;
  ::placeholder 
    color: #ffffff;
    overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
  }
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 20px;
  margin-top: 40px;
}

.buttons input[type="button"] {
  font-size: 20px;
  padding: 17px;
  border: none;
  background-color: transparent;
  color: #ffffff;
  cursor: pointer;
  border-radius: 5px;
  .input-button[value="९"] 
  order: 2;

}

.buttons input[type="button"]:hover {
  box-shadow: 0 8px 25px #000d2e;
}

input[type="button"]#equal {
  grid-row: span 2;
  background-color: #f9544c;
}

input[type="button"][value="0"] {
  grid-column: span 2;

}

.contact-me {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 0.6em;
  color: #00FFFF;
  text-align: right;
  font-weight: 700;
}

.contact-me a {
  color: #fff;
  text-decoration: none;
  background-color: #f38500;
  font-weight: 300;
  padding: 5px 10px;
  border-radius: 5px;
  display: inline-block;
  margin-top: 5px;
}

.contact-me a:hover {
  background-color: #f5a623;
}

@media (max-width: 786px) {
  body {
    font-size: 14px;
    color: #Fffff;
  }

  .calculator {
    width: 100%;
    max-width: 300px;
    padding: 30px;
  }

  .buttons {
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
  }

  .buttons input[type="button"] {
    padding: 10px;
    font-size: 16px;
  }

  .display input {
    font-size: 24px; 
    color: #ffffff;
  }

  .contact-me {
    font-size: 0.5em;
  }
}

.display {
  width: 100%;
  text-align: right;
  padding: 15px 10px;
  border-bottom: 1px solid black; 
  background-color: transparent; 
  color: #ffffff;
  font-size: 35px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  position: relative;
}

.input-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.input-output input {
  flex: 1;
  border: none;
  background: transparent; 
  font-size: inherit;
  color: #ffffff;
  outline: none;
}

#result {
  font-size: inherit;
  color: #ffffff;
}

}
body {
    background: linear-gradient(to bottom, #DC143C 50%, #ffffff 50%);
    color: white; 

}

body.dark-mode {
    background: linear-gradient(to bottom, #FF8C00 50%, #000000 50%);
    color: black;
}

.mode-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px; 
}

.toggle-label {
  position: relative;
  width: 40px;
  height: 20px;
  margin-right: 10px; 
}

.toggle-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 10px;
  width: 40px;
  height: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(20px);
  -ms-transform: translateX(20px);
  transform: translateX(20px);
}

#mode-text {
  font-weight: bold;
  color: #555;
}

.toggle-container {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  margin-right: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toggle-input {
  display: none;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

body.dark-mode .toggle-label {
  background-color: #333;
}

body.dark-mode .toggle-slider {
  transform: translateX(20px);
}
