* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(185deg, #3A6073, #203A43, #2C5364);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-title {
  font-size: 48px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 8px #24C6DC, 0 0 15px #24C6DC, 0 0 25px #24C6DC;
  margin-bottom: 25px;
}

.calculator-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  transition: all 0.4s ease;
}

.calculator-wrapper.expanded {
  flex-wrap: nowrap;
}

.calculator-container {
  background: #414345;
  padding: 30px 25px;
  width: 340px;
  border-radius: 20px;
  box-shadow: 0 12px 28px #24C6DC;
}

#display {
  width: 100%;
  height: 60px;
  font-size: 26px;
  text-align: right;
  padding: 12px 18px;
  border-radius: 12px;
  background: #fcfcfc;
  margin-bottom: 20px;
  font-weight: bold;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.15);
  border: none;
  outline: none;
}

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

.btn {
  width: 100%;
  aspect-ratio: 1/1;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 600;
  color: #2f2f2f;
  background-color: #f8f9fa;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: 0.2s;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #87ceeb;
  color: black;
  background-color: yellow;
}

.clear, .del{
  background-color: rgb(224, 53, 53);
  color: whitesmoke;
}

.clear:hover , .del:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #87ceeb;
  color: black;
  background-color: rgb(224, 53, 53);
}

.operator, .percent {
  background-color: #e9ece8;
  color: #0aee56;
}

.operator:hover , .percent:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #87ceeb;
  color: black;
  background-color: #e9ece8;
}

.equal {
  background-color: #fb7c14;
  color: whitesmoke;
  font-weight: bold;
  font-size: 24px;
}

.equal:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #87ceeb;
  color: black;
  background-color: #fb7c14;
}

.mode-toggle {
  background-color: #cce5ff;
  color: #007bff;
  font-size: 22px;
}

.mode-toggle:hover {
  background-color: #cce5ff;
}

#scientificSection {
  width: 300px;
  margin-left: 20px;
  transition: 0.3s ease-in-out;
}

#scientificSection .btn {
  font-size: 16px;
  padding: 12px;
  background-color: #e8f5e9;
  color: black;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#scientificSection .btn:hover {
  background-color: #c8e6c9;
  box-shadow: 0 0 12px #81c784;
  color: black;
}

.active-touch {
  transform: scale(1.05);
  box-shadow: 0 0 15px #00cfff;
}

@media (max-width: 768px) {
  .calculator-wrapper {
    flex-direction: column;
    align-items: center;
  }

  #scientificSection {
    width: 100%;
    margin: 20px 0 0 0;
  }

  .calculator-container {
    width: 100%;
  }

  .calc-title {
    font-size: 36px;
  }
}
