/* ===== Base ===== */
body {
  background: #1b1b1b;
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Calculator Container ===== */
.mavex-calculator {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 1vh;
  margin: 0;
  box-sizing: border-box;
  height: 100vh; /* تغطي الشاشة كاملة */
}

/* ===== Display Section ===== */
.display {
  width: 100%;
  height: 30%;
  background: #000;
  border-radius: 0;
  color: #fff;
  font-family: monospace;
  box-sizing: border-box;
  padding: 1vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#history {
  color: #888;
  font-size: 1.5rem;
  min-height: 24px;
}

#result {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 3rem;
  text-align: right;
  outline: none;
  word-wrap: break-word;
}

/* ===== Buttons Grid ===== */
.buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.8vh;
  flex-grow: 1;
  padding: 1vh;
  box-sizing: border-box;
}

.btn {
  padding: 1.5vh;
  border: none;
  border-radius: 0.5vh;
  font-size: 1.2rem;
  cursor: pointer;
  background: #222;
  color: #fff;
  transition: 0.15s;
}

.btn:hover {
  background: #333;
}

.btn.op {
  color: #a88b5f;
  font-weight: bold;
}

.btn.sci {
  color: #c7a97a;
  font-weight: bold;
}

.equals {
  background: #a88b5f;
  color: #000;
  font-weight: bold;
}

.equals:hover {
  background: #c7a97a;
}

/* تأثير hover عند الكيبورد */
.hoverEffect {
  transform: scale(1.05);
  box-shadow: 0 0 10px #d4af37;
}

/* ===== Medium screens ===== */
@media (max-width: 1024px) {
  #result {
    font-size: 2.5rem;
  }

  #history {
    font-size: 1.2rem;
  }

  .btn {
    font-size: 1rem;
    padding: 1vh;
  }

  .buttons {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5vh;
  }
}

/* ===== Small screens ===== */
@media (max-width: 600px) {
  #result {
    font-size: 5vw;
  }

  #history {
    font-size: 3.5vw;
  }

  .btn {
    font-size: 4vw;
    padding: 1vh;
  }

  .buttons {
    grid-template-columns: repeat(4, 1fr);
    gap: 1vh;
  }
}
