/* ============================================
   Stake Modal Overlay and Container
============================================ */
.stake-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(to bottom, var(--background-color), var(--primary-color), var(--gradient-mid));
  backdrop-filter: blur(6px);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  flex-direction: column;
}

/* ============================================
   Close Button
============================================ */
.stake-modal .close-btn {
  position: absolute;
  top: 9px;
  right: 16px;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s;
  touch-action: manipulation;
}
.stake-modal .close-btn:hover {
  color: #fff;
}

/* ============================================
   Heading
============================================ */

.stake-header {
  position: relative;
  top: -90px; /* Moves it up */
  padding: 8px 16px 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
}

.stake-header h2 {
  margin: 0 auto;
  font-size: 24px;
  text-align: center;
  font-weight: 600;
  padding-bottom: 12px;
  width: 100%;
}

.stake-header .close-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 28px;
  color: #ccc;
  cursor: pointer;
  padding: 0;
}

.stake-header .close-btn:hover {
  color: #fff;
}

/* ============================================
   Available Balance
============================================ */
.stake-modal .available-balance {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--balance-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-right: 8px;
}

/* ============================================
   Stake Form
============================================ */
.stake-modal form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 400px;
}

.stake-modal label {
  font-size: 15px;
  color: var(--label-color);
  font-weight: 600;
}

.stake-modal input[type="number"],
.stake-modal select {
  padding: 12px 16px;
  font-size: 17px;
  border-radius: 8px;
  border: 1.5px solid var(--input-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  backdrop-filter: blur(3px);
}

.stake-modal input:focus,
.stake-modal select:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* ============================================
   Max Button
============================================ */
.stake-modal #maxstake {
  background: var(--button-color);
  color: white;
  width: 100px;
  align-self: flex-start;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}
.stake-modal #maxstake:hover {
  background: var(--button-hover);
}

/* ============================================
   Estimated Reward / Stake Fee
============================================ */
.stake-modal #stakeFee {
  font-size: 14px;
  font-style: italic;
  color: var(--fee-color);
  margin-bottom: 10px;
}

/* ============================================
   Confirm and View Buttons
============================================ */
.stake-modal .conversion-form__submit {
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background-color: var(--accent-color);
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}
.stake-modal .conversion-form__submit:hover {
  background-color: var(--accent-color-dark);
}

/* ============================================
   Unstake Section
============================================ */
.stake-modal h3 {
  margin-top: 30px;
  font-size: 20px;
  color: var(--heading-color);
}
.stake-modal #unstakeAmount {
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 1.5px solid var(--input-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
}
.stake-modal #unstakeAmount:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* ============================================
   Message Area
============================================ */
.stake-modal .message {
  font-size: 15px;
  color: var(--warning-color);
  margin-top: 10px;
  font-weight: 700;
  min-height: 24px;
}

/* ============================================
   Back Button
============================================ */


/* ============================================
   Responsive Design
============================================ */
@media (max-width: 480px) {
  .stake-modal {
    padding: 18px 12px;
  }
  .stake-modal h2 {
    font-size: 20px;
  }
  .stake-modal input,
  .stake-modal select,
  .stake-modal .conversion-form__submit {
    font-size: 15px;
  }
  .stake-modal #maxstake {
    width: 80px;
    font-size: 14px;
  }
}