/* ============================================================
   calculatorstyles.css  –  Shared calculator component styles
   ============================================================ */

.calculator {
  line-height: 2em;
  margin: 20px auto;
  border: 1px solid #ccc;
  padding: 20px;
  max-width: 400px;
  text-align: center;
}

.calculator-heading {
  background-color: white;
  color: #007BFF;
  padding: 10px;
  margin-bottom: 10px;
  text-align: center;
}

.calculator label {
  display: block;
  margin: 10px 0 5px;
  font-weight: bold;
}

.calculator input {
  width: calc(100% - 22px);
  margin-bottom: 10px;
  padding: 5px;
  font-size: 16px;
}

.calculator .description {
  font-size: 14px;
  margin-bottom: 5px;
  text-align: left;
}

.calculator button {
  width: 100%;
  padding: 10px;
  background-color: #007BFF;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.output {
  margin-top: 20px;
  font-size: 14px;
  text-align: left;
}

.output table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

.output table, .output th, .output td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

/* ── Toast notification ─────────────────────────────────── */
.toast {
  visibility: hidden;
  min-width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 16px;
  position: fixed;
  z-index: 1;
  left: 50%;
  bottom: 30px;
  font-size: 17px;
  transform: translateX(-50%);
}

.toast.show {
  visibility: visible;
  -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from { bottom: 0; opacity: 0; }
  to   { bottom: 30px; opacity: 1; }
}
@keyframes fadein {
  from { bottom: 0; opacity: 0; }
  to   { bottom: 30px; opacity: 1; }
}
@-webkit-keyframes fadeout {
  from { bottom: 30px; opacity: 1; }
  to   { bottom: 0; opacity: 0; }
}
@keyframes fadeout {
  from { bottom: 30px; opacity: 1; }
  to   { bottom: 0; opacity: 0; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .calculator {
    padding: 10px;
    max-width: 100%;
  }
  .calculator input, .calculator button {
    font-size: 14px;
  }
}

/* ── Visibility helpers ─────────────────────────────────── */
.mdv-hidden {
  display: none;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

/* ── Login gate message (benchmark: moolDhanVaapsi style) ── */
/*
   Used on all pages that require a login.
   Replaces any per-page .pro-message or ad-hoc login divs.
*/
.login-gate-message {
  text-align: center;
  margin: 3em auto;
  max-width: 560px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #333;
  padding: 1.6em 2em;
  background: #f0f4ff;
  border: 1px solid #b3c6f7;
  border-radius: 10px;
}

.login-gate-message a {
  color: #007BFF;
  font-weight: 600;
  text-decoration: underline;
}

.login-gate-message a:hover {
  color: #0056b3;
  text-decoration: none;
}

/* ── Input group (generic, used across calculators) ─────── */
.input-group {
  margin-bottom: 1em;
}

/* ── Semantic color helpers ─────────────────────────────── */
.bold       { font-weight: bold; }
.text-center { text-align: center; }
.positive   { color: #28a745; }
.negative   { color: #dc3545; }

/* ── Trade type indicators ──────────────────────────────── */
.trade-type { font-size: 1.1em; margin-bottom: 8px; }
.long  { color: #28a745; }
.short { color: #dc3545; }

/* ── Risk / Reward info panels ──────────────────────────── */
.risk-info,
.reward-info {
  margin-top: 1.2em;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.risk-info   { border-left: 5px solid #dc3545; }
.reward-info { border-left: 5px solid #28a745; }

/* ── Calculator description / footer note ───────────────── */
.calculator-note {
  text-align: center;
  margin-top: 20px;
  font-style: italic;
  color: #555;
  font-size: 0.95em;
}

/* ── Loading indicator ──────────────────────────────────── */
.loading-indicator {
  display: none;
  text-align: center;
  padding: 8px 0;
  color: #555;
}

/* ── Calculation details block (HoldingsCostRecalculator) ── */
.calculation-details {
  margin-top: 15px;
  font-size: 1em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  line-height: 1.4;
  color: #333;
  white-space: pre-line;
}

/* ── Result display ─────────────────────────────────────── */
.result-display {
  font-size: 1.2em;
  margin-top: 20px;
  text-align: center;
  font-weight: bold;
}

/* ── Button group (centered row of buttons) ─────────────── */
.button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.button-group button {
  width: auto;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.btn-primary { background-color: #28a745; }
.btn-primary:hover { background-color: #218838; }

.btn-danger  { background-color: #dc3545; }
.btn-danger:hover  { background-color: #c82333; }

/* ── Transaction table (HoldingsCostRecalculator) ────────── */
.transaction-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.transaction-table th,
.transaction-table td {
  text-align: center;
  vertical-align: middle;
  padding: 8px;
}

.transaction-table th:nth-child(1),
.transaction-table td:nth-child(1) { width: 130px; }

.transaction-table th:nth-child(2),
.transaction-table td:nth-child(2),
.transaction-table th:nth-child(3),
.transaction-table td:nth-child(3) { width: 110px; }

.transaction-table select.action {
  width: 120px;
  padding: 6px;
  box-sizing: border-box;
}

.transaction-table input.quantity,
.transaction-table input.price {
  width: 100px;
  padding: 6px;
  box-sizing: border-box;
  text-align: center;
}

/* ── CrossMultiply layout helpers ────────────────────────── */
.row-flex {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.input-group-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.input-group-inline label {
  flex: 1;
  text-align: right;
  min-width: 100px;
  font-weight: bold;
}

.input-group-inline input {
  flex: 2;
  max-width: 150px;
  width: auto;
  margin-bottom: 0;
}

/* ── GrowthX / findy dynamic result spacing ──────────────── */
#dynamic-result p {
  margin: 0.8em 0;
}

/* ── Points-to-Recover result card ──────────────────────── */
.recover-result-card {
  margin-top: 32px;
  padding: 28px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 14px;
  font-size: 1.3em;
  text-align: center;
}

.recover-result-card.positive {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: inherit;
}

.recover-result-big {
  font-size: 3.2em;
  font-weight: 800;
  margin: 12px 0;
  line-height: 1;
}

.recover-summary {
  background: #fff8e1;
  padding: 16px;
  border-radius: 10px;
  margin: 22px 0;
  font-weight: 600;
  color: #855c00;
}

/* ── Deploy slider group (Trade Qty Pro) ─────────────────── */
.deploy-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.8em;
  padding: 6px 10px;
  background: #f9fbfc;
  border-radius: 6px;
}

.deploy-group label {
  white-space: nowrap;
  font-weight: bold;
  min-width: 80px;
}

.deploy-group input[type="range"] {
  flex: 1;
  margin: 0 6px;
}

.deploy-group .deploy-value {
  min-width: 45px;
  text-align: right;
  font-weight: 600;
  color: #0066cc;
}

.deploy-notice {
  font-size: 0.82em;
  color: #555;
  text-align: center;
  margin: 0 0 1em 0;
  line-height: 1.3;
}

/* ── Hero or Zero: hero-specific layout ─────────────────── */
.hero-title {
  font-size: 2.5rem;
  color: #ff1744;
  font-weight: 800;
  margin: 25px 0 10px;
  text-align: center;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #333;
  text-align: center;
  margin: 0 auto 20px;
  max-width: 900px;
  line-height: 1.6;
}

.hero-disclaimer {
  font-size: 0.95rem;
  color: #d32f2f;
  font-weight: bold;
  text-align: center;
  margin: 10px auto 35px;
  max-width: 860px;
}

.hero-input-group {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 35px 0 45px;
}

.hero-input-group label {
  font-weight: bold;
  min-width: 160px;
  text-align: right;
  font-size: 1.1rem;
}

.hero-input-group input {
  padding: 12px 16px;
  width: 180px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.25rem;
}

.btn {
  padding: 14px 36px;
  font-size: 1.25rem;
  font-weight: bold;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-go { background: #ff1744; }
.btn-go:hover { background: #c62828; }

.btn-reset-hoz {
  background: #6c757d;
  display: none;
}

/* ── Hero/Zero row highlight colours ────────────────────── */
.hl0 { background: #f57c00 !important; color: #fff !important; }
.hl1 { background: #388e3c !important; color: #fff !important; }
.hl2 { background: #d32f2f !important; color: #fff !important; }
.hl3 { background: #0288d1 !important; color: #fff !important; }
.hl4 { background: #7b1fa2 !important; color: #fff !important; }

/* ── Option Max Price: lot-size editor ───────────────────── */
.lot-size-editor {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 16px 0 24px;
}

.lot-size-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.lot-size-field label {
  font-weight: 600;
  white-space: nowrap;
}

.lot-size-field input[type="number"] {
  width: 75px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  text-align: center;
}

.lot-size-field input[type="number"]:focus {
  outline: none;
  border-color: #0288d1;
  box-shadow: 0 0 0 2px rgba(2, 136, 209, .2);
}

.lot-size-note {
  font-size: 0.82rem;
  color: #888;
  text-align: center;
  margin-top: -12px;
  margin-bottom: 10px;
}

/* ── Option Max Price: row highlights ────────────────────── */
.omp-highlight-0 { background-color: #0288d1 !important; color: #fff !important; }
.omp-highlight-1 { background-color: #d32f2f !important; color: #fff !important; }
.omp-highlight-2 { background-color: #388e3c !important; color: #fff !important; }
.omp-highlight-3 { background-color: #f57c00 !important; color: #fff !important; }
.omp-highlight-4 { background-color: #7b1fa2 !important; color: #fff !important; }
.omp-highlight-5 { background-color: #c2185b !important; color: #fff !important; }
.omp-highlight-6 { background-color: #00796b !important; color: #fff !important; }
.omp-highlight-7 { background-color: #8e24aa !important; color: #fff !important; }
.omp-highlight-8 { background-color: #6d4c41 !important; color: #fff !important; }
.omp-highlight-9 { background-color: #455a64 !important; color: #fff !important; }

/* ── DataTable alignment fixes shared across table pages ─── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.dataTable thead th,
table.dataTable tbody td {
  box-sizing: border-box !important;
  padding: 10px !important;
  text-align: center !important;
}

table.dataTable thead th {
  background: #111;
  color: #fff;
  padding: 12px 10px !important;
  font-weight: bold;
}

table.dataTable tbody td:first-child,
table.dataTable thead th:first-child {
  padding-left: 16px !important;
  padding-right: 16px !important;
  font-weight: 600;
}

/* ── Full-width range slider (averagedown) ───────────────── */
.slider-full {
  width: 100%;
}
