/**
 * 8th Pay Commission Salary Pay Matrix Calculator — WordPress Plugin Stylesheet
 * All rules scoped under .pmc-root — zero conflict with themes or other plugins.
 *
 * @package PayMatrixCalculator
 * @version 1.0.0
 */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.pmc-input-table th:nth-child(1),
.pmc-input-table td:nth-child(1) { width: 50%; }
.pmc-input-table th:nth-child(2),
.pmc-input-table td:nth-child(2) { width: 50%; }

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

.pmc-required {
  color: red;
}

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

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

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

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

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

.pmc-root .pmc-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(--pmc-font);
  font-size: 14px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  text-align: center;
}

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

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

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

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

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

.pmc-result-container {
  min-height: 60px;
  overflow-x: auto;
}

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

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

/* ══════════════════════════════════════════════════════
   12. PDF button
   ══════════════════════════════════════════════════════ */
.pmc-pdf-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.pmc-root .pmc-btn-pdf {
  background: #f44336;
  color: #ffffff;
  border: 2px solid #c62828;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-family: var(--pmc-font);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.pmc-root .pmc-btn-pdf:hover,
.pmc-root .pmc-btn-pdf:focus {
  background: #ffffff;
  color: #f44336;
  border-color: #f44336;
  outline: none;
}

/* ══════════════════════════════════════════════════════
   13. Result matrix table
   ══════════════════════════════════════════════════════ */
.pmc-matrix-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--pmc-line);
  table-layout: fixed;
}

.pmc-matrix-table th,
.pmc-matrix-table td {
  border: 1px solid var(--pmc-line);
  padding: 8px;
  vertical-align: middle;
  text-align: center;
  word-wrap: break-word;
  word-break: break-word;
}

.pmc-matrix-table th {
  background: linear-gradient(90deg, var(--pmc-grad-start), var(--pmc-grad-end));
  color: #fff;
  font-weight: 700;
  padding: 10px 8px;
}

.pmc-matrix-table th:nth-child(1),
.pmc-matrix-table td:nth-child(1) { width: 15%; }
.pmc-matrix-table th:nth-child(2),
.pmc-matrix-table td:nth-child(2) { width: 42.5%; }
.pmc-matrix-table th:nth-child(3),
.pmc-matrix-table td:nth-child(3) { width: 42.5%; }

.pmc-row-alt   { background: #f8f9fa; }
.pmc-row-plain { background: #ffffff; }

.pmc-cell-sno {
  font-weight: 600;
  color: var(--pmc-ink);
  font-size: 13px;
}

.pmc-cell-current {
  font-weight: 600;
  color: var(--pmc-ink);
  font-family: var(--pmc-mono);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
}

.pmc-cell-projected {
  font-weight: 600;
  color: var(--pmc-green);
  font-family: var(--pmc-mono);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
}

/* Fitment info footer */
.pmc-fitment-info {
  text-align: center;
  font-size: 12px;
  color: var(--pmc-muted);
  margin-top: 8px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════
   14. Mobile  ≤ 768px
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pmc-heading {
    font-size: 16px;
    margin: 8px 0;
  }

  .pmc-matrix-table th,
  .pmc-matrix-table td {
    padding: 8px 4px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
  }

  .pmc-matrix-table th {
    padding: 10px 4px;
    font-size: 12px;
  }

  .pmc-root .pmc-btn-pdf {
    padding: 8px 14px;
    font-size: 14px;
  }

  .pmc-fitment-info {
    font-size: 12px;
    padding: 8px;
    white-space: normal;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .pmc-matrix-table th:nth-child(1),
  .pmc-matrix-table td:nth-child(1) { width: 12%; }
  .pmc-matrix-table th:nth-child(2),
  .pmc-matrix-table td:nth-child(2) { width: 44%; }
  .pmc-matrix-table th:nth-child(3),
  .pmc-matrix-table td:nth-child(3) { width: 44%; }
}
