/* ==========================================================================
   Forex Position Size Calculator - Core Styles
   Dark navy + gold theme – matched to futures
   ========================================================================== */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.calculator {
  background: #13294b;
  padding: 25px 35px;
  border-radius: 10px;
  box-shadow: 0 0 15px #ffd700aa;
  max-width: 420px;
  width: 100%;
  margin: 2rem auto;
}

.calculator h2 {
  text-align: center;
  margin-bottom: 0.4rem;
  color: #ffd700;
  font-size: 1.8rem;
}

.calculator-intro {
  text-align: center;
  color: #ffd700cc;
  font-size: 1rem;
  margin-bottom: 0.1rem;
  max-width: 820px;
  padding: 0 1rem;
}

.calculator-intro p {
  margin: 0.1rem 0;
  line-height: 1.5;
}
/* Header with help button */
.calculator .header-with-help {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 8rem;               /* same big space as futures */
}

.calculator .header-with-help h2 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  margin-top: 1.9rem;
  width: 100%;
  text-align: center;
}

.calculator .help-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd70022;
  border: 1px solid #ffd70055;
  color: #ffd700;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.calculator .help-btn:hover {
  background: #ffd70044;
}

/* Help popup – exact match to futures */
.calculator .help-popup {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 320px;
  max-width: 90vw;
  margin-top: -208px;                  /* same negative margin as futures */
  background: #13294b;
  border: 1px solid #ffd70055;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.calculator .help-popup.active {
  display: block;
}

.calculator .close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: #0a1a33;
  border: 1px solid #ffd70066;
  border-radius: 50%;
  color: #ffd700;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calculator .close-btn:hover {
  background: #ffd70022;
}

.calculator .help-content {
  position: relative;
  padding: 2.4rem 1.2rem 1.2rem;
}

.calculator .help-content h3 {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.25rem;
}

.calculator .help-content ol {
  padding-left: 1.4rem;
  margin: 0 0 1.2rem;
  line-height: 1.5;
}

.calculator .help-content p {
  margin: 0.8rem 0 0;
  font-size: 0.97rem;
}

.calculator .small-note {
  font-size: 0.9rem;
  color: #ffd70099;
  font-style: italic;
  margin-top: 1.2rem;
}

/* Labels */
.calculator label {
  display: block;
  margin: 1.2rem 0 0.4rem;
  font-weight: 600;
  color: #ffd700;
}

/* Selects & inputs */
.calculator select,
.calculator input:not([type="number"]) {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border-radius: 5px;
  border: 1px solid #ffd70066;
  background-color: #0a1a33;
  color: #ffd700;
  font-size: 1rem;
  box-sizing: border-box;
}

.calculator select option {
  background-color: #13294b;
  color: #ffd700;
}

/* Number inputs */
.calculator input[type="number"] {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
  width: 100%;
  padding: 11px 58px 11px 14px;
  border: 1px solid #ffd70066;
  border-radius: 5px;
  background: #0a1a33;
  color: #ffd700;
  font-size: 1.1rem;
  box-sizing: border-box;
}

.calculator input[type="number"]::-webkit-inner-spin-button,
.calculator input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Number wrapper (no stepper in forex, but keep structure) */
.calculator .number-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 380px;
  margin: 0.6rem 0 1.4rem;
}

.calculator .number-input-wrapper input[type="number"] {
  width: 100%;
  padding: 11px 14px;                    /* no right padding for stepper */
  border: 1px solid #ffd70066;
  border-radius: 5px;
  background: #0a1a33;
  color: #ffd700;
  font-size: 1.1rem;
  box-sizing: border-box;
}

/* Calculate button */
.calculator button:not(.help-btn):not(.close-btn) {
  margin-top: 1.8rem;
  padding: 12px;
  width: 100%;
  background-color: #ffd700;
  border: none;
  color: #0a1a33;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.calculator button:not(.help-btn):not(.close-btn):hover {
  background-color: #e6c300;
}

/* Result */
.calculator #result {
  margin-top: 2rem;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  color: #ffd700;
  min-height: 2.2rem;
}

/* Readonly pip value */
.calculator #pipValue {
  background: #13294b !important;
  color: #ffd700aa !important;
  cursor: default;
}
