/* ====== Reset & پایه ====== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazir', Tahoma, sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

/* ====== عنوان ====== */
h2 {
  font-weight: 700;
  font-size: clamp(1.8rem, 2.5vw, 2.4rem); /* واکنش‌گرا */
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* ====== input ====== */
input[type=number] {
  width: 100%;
  max-width: 300px;
  padding: 12px 16px;
  font-size: 1.2rem;
  border-radius: 12px;
  border: none;
  outline: none;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  background-color: #1c2833;
  color: #eee;
  text-align: center;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

input[type=number]:focus {
  box-shadow: 0 0 15px #4caf50;
  background-color: #273746;
}

/* ====== دکمه ====== */
button {
  cursor: pointer;
  background: linear-gradient(45deg, #4caf50, #81c784);
  border: none;
  padding: 14px 30px;
  font-size: 1.2rem;
  border-radius: 20px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
  user-select: none;
  margin-bottom: 30px;
}

button:hover {
  background: linear-gradient(45deg, #388e3c, #66bb6a);
  box-shadow: 0 10px 30px rgba(56, 142, 60, 0.8);
  transform: translateY(-3px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* ====== خروجی ====== */
#output {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 25px 30px;
  border-radius: 18px;
  font-size: clamp(1.3rem, 2vw, 1.6rem); /* واکنش‌گرا */
  min-width: 250px;
  max-width: 90vw;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
  line-height: 2.2;
  color: #c8e6c9;
  user-select: text;
  word-break: break-word;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.6s ease, max-height 0.8s ease;
}

#output.show {
  opacity: 1;
  max-height: 500px;
}

sup {
  font-size: 1rem;
  vertical-align: super;
  color: #a5d6a7;
}

/* ====== loader ====== */
#loader {
  border: 6px solid rgba(255,255,255,0.2);
  border-top: 6px solid #4caf50;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 40px auto 0 auto;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* ====== footer ====== */
footer {
  margin-top: 60px;
  text-align: center;
  font-size: clamp(0.9rem, 1.5vw, 1rem); /* واکنش‌گرا */
  color: #a5d6a7;
  opacity: 0.8;
  padding: 20px 0;
  font-weight: bold;
  user-select: none;
}

.edrisabar{
  color: #4caf50;
}

/* ====== Media Queries ====== */
@media (max-width: 600px) {
  button, input[type=number] {
    font-size: 1rem;
    padding: 12px 20px;
  }
}

@media (max-width: 400px) {
  h2 {
    font-size: 1.6rem;
  }
  #output {
    font-size: 1.2rem;
  }
}
