/**
 * 8th Pay Commission Fitment Factor Calculator — WordPress Plugin Stylesheet
 * All rules scoped under .ffc-root — zero conflict with themes or other plugins.
 *
 * @package FitmentFactorCalculator
 * @version 1.0.0
 */

/* ══════════════════════════════════════════════════════
   1. Design tokens
   ══════════════════════════════════════════════════════ */
.ffc-root {
  --ffc-bg:      #ffffff;
  --ffc-card:    #ffffff;
  --ffc-ink:     #0f172a;
  --ffc-muted:   #64748b;
  --ffc-line:    #dfeaf7;
  --ffc-accent:  #0ea5e9;
  --ffc-green:   #259922;
  --ffc-green-bg:#e8f5e9;
  --ffc-blue-bg: #e8f0ff;
  --ffc-grad-start: #0b62c6;
  --ffc-grad-end:   #004aad;
  --ffc-font:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ffc-mono:    'Roboto Mono', 'Noto Sans Mono', 'Liberation Mono', Consolas, monospace;
}

/* ══════════════════════════════════════════════════════
   2. Root / Reset
   ══════════════════════════════════════════════════════ */
.ffc-root {
  background: var(--ffc-bg);
  color: var(--ffc-ink);
  font-family: var(--ffc-font);
  font-size: 14px;
  line-height: 1.5;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.ffc-root *,
.ffc-root *::before,
.ffc-root *::after {
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════
   3. Layout
   ══════════════════════════════════════════════════════ */
.ffc-wrap {
  max-width: 1200px;
  margin: 2px auto;
  padding: 0;
}

.ffc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 880px) {
  .ffc-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════
   4. Heading
   ══════════════════════════════════════════════════════ */
.ffc-heading {
  text-align: left;
  font-size: 20px;
  margin: 6px 0 10px;
  font-weight: 700;
  color: var(--ffc-ink);
  font-family: var(--ffc-font);
}

.ffc-heading-sub {
  color: var(--ffc-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* ══════════════════════════════════════════════════════
   5. Top note bar
   ══════════════════════════════════════════════════════ */
.ffc-note {
  background: var(--ffc-blue-bg);
  border-radius: 4px;
  color: var(--ffc-muted);
  font-size: 12px;
  margin-bottom: 8px;
  padding: 4px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   6. Card
   ══════════════════════════════════════════════════════ */
.ffc-card {
  background: var(--ffc-card);
  border: 1px solid var(--ffc-line);
  border-radius: 4px;
  padding: 3px;
}

.ffc-left-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ══════════════════════════════════════════════════════
   7. Input table
   ══════════════════════════════════════════════════════ */
.ffc-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--ffc-line);
}

.ffc-table th,
.ffc-table td {
  border: 1px solid var(--ffc-line);
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.25;
  font-size: 14px;
  vertical-align: middle;
}

.ffc-table th {
  background: linear-gradient(90deg, var(--ffc-grad-start), var(--ffc-grad-end));
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 4px 8px !important;
}

/* 50/50 column widths */
.ffc-table th:nth-child(1),
.ffc-table td:nth-child(1) { width: 50%; }
.ffc-table th:nth-child(2),
.ffc-table td:nth-child(2) { width: 50%; }

.ffc-cell {
  padding: 4px 8px;
}

.ffc-required {
  color: red;
}

/* ══════════════════════════════════════════════════════
   8. Inputs
   ══════════════════════════════════════════════════════ */
.ffc-root input[type="number"] {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #e9f3ff;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  color: var(--ffc-ink);
  font-family: var(--ffc-font);
  box-shadow: none;
  outline: none;
}

.ffc-root input[type="number"]:focus {
  border-color: var(--ffc-accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.ffc-input-wrap {
  position: relative;
}

.ffc-rupee {
  color: var(--ffc-accent);
  font-weight: 600;
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
}

.ffc-has-prefix {
  padding-left: 25px !important;
}

/* ══════════════════════════════════════════════════════
   9. Info / formula box
   ══════════════════════════════════════════════════════ */
.ffc-info-box {
  background: var(--ffc-blue-bg);
  border-left: 3px solid var(--ffc-grad-end);
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 2px;
}

.ffc-info-sub {
  font-size: 0.9em;
  margin-top: 6px;
  color: var(--ffc-muted);
}

/* ══════════════════════════════════════════════════════
   10. Action buttons
   ══════════════════════════════════════════════════════ */
.ffc-actions {
  display: flex;
  gap: 2px;
  margin-top: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.ffc-root .ffc-btn {
  flex: 1 1 45px;
  min-width: 50px;
  padding: 10px;
  border-radius: 4px;
  border: 2px solid transparent;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--ffc-font);
  font-size: 14px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  text-align: center;
}

.ffc-root .ffc-btn-calculate {
  background: var(--ffc-accent);
  border-color: #0284c7;
}

.ffc-root .ffc-btn-calculate:hover,
.ffc-root .ffc-btn-calculate:focus {
  background: #ffffff;
  color: var(--ffc-accent);
  border-color: var(--ffc-accent);
  outline: none;
}

.ffc-root .ffc-btn-reset {
  background: var(--ffc-muted);
  border-color: #475569;
}

.ffc-root .ffc-btn-reset:hover,
.ffc-root .ffc-btn-reset:focus {
  background: #ffffff;
  color: var(--ffc-muted);
  border-color: var(--ffc-muted);
  outline: none;
}

/* ══════════════════════════════════════════════════════
   11. Result panel
   ══════════════════════════════════════════════════════ */
.ffc-muted {
  color: var(--ffc-muted);
  font-size: 12px;
  text-align: center;
  padding: 10px 6px;
}

.ffc-result-container {
  min-height: 60px;
}

/* Timestamp bar */
.ffc-timestamp {
  text-align: center;
  font-size: 11px;
  color: var(--ffc-muted);
  margin-bottom: 8px;
  padding: 4px;
  background: #f8f9fa;
  border-radius: 3px;
}

/* Result heading */
.ffc-result-heading {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--ffc-ink);
  margin: 10px 0;
  font-family: var(--ffc-font);
}

.ffc-result-heading-sub {
  color: var(--ffc-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* Green highlight result */
.ffc-highlight-result {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ffc-green);
  margin: 15px 0;
  padding: 15px;
  background: var(--ffc-green-bg);
  border-radius: 6px;
  border-left: 4px solid var(--ffc-green);
  font-family: var(--ffc-mono);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
}

/* Result details table */
.ffc-result-table-wrap {
  margin: 20px 0;
}

.ffc-result-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--ffc-line);
}

.ffc-result-table th,
.ffc-result-table td {
  border: 1px solid var(--ffc-line);
  padding: 8px;
  font-size: 14px;
}

.ffc-result-table thead th {
  background: linear-gradient(90deg, var(--ffc-grad-start), var(--ffc-grad-end));
  color: #fff;
  text-align: center;
}

.ffc-result-table .ffc-row-alt {
  background: #f8f9fa;
}

.ffc-result-table .ffc-row-plain {
  background: #ffffff;
}

.ffc-result-table .ffc-row-green {
  background: var(--ffc-green-bg);
}

.ffc-result-label {
  font-weight: 600;
  color: var(--ffc-muted);
}

.ffc-result-label-green {
  font-weight: 800;
  color: var(--ffc-green);
}

.ffc-result-value {
  font-weight: 600;
  color: var(--ffc-ink);
  text-align: right;
  font-family: var(--ffc-mono);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
}

.ffc-result-value-green {
  font-weight: 800;
  color: var(--ffc-green);
  text-align: right;
  font-family: var(--ffc-mono);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
}

/* Formula box */
.ffc-formula-box {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  margin: 10px 0;
  border: 1px dashed var(--ffc-line);
  font-family: var(--ffc-mono);
  letter-spacing: -0.02em;
}

/* Pay increase footer */
.ffc-pay-increase {
  font-size: 12px;
  color: var(--ffc-muted);
  text-align: center;
  margin-top: 15px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
}

/* ══════════════════════════════════════════════════════
   12. Mobile  ≤ 600px
   ══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .ffc-root {
    font-size: 13px;
  }

  .ffc-heading {
    font-size: 16px;
  }

  .ffc-highlight-result {
    font-size: 1.4rem;
    padding: 10px;
  }

  .ffc-root .ffc-btn {
    padding: 8px 6px;
    font-size: 13px;
  }

  .ffc-result-table th,
  .ffc-result-table td {
    padding: 6px 5px;
    font-size: 13px;
  }
}
