/* XLPE EHV Cable Current Rating Calculator — Plugin Stylesheet
   All selectors prefixed with .xlpe- to avoid theme conflicts.
   ================================================================ */

.xlpe-calc-wrap {
  margin: 0 auto;
  padding: 0 0 40px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.7;
  color: #3a3a3a;
}

/* ── Intro ───────────────────────────────────────────────────────── */
.xlpe-intro-text {
  font-size: 15px;
  color: #555;
  margin-bottom: 22px;
  line-height: 1.65;
}

/* ── Section heading ──────────────────────────────────────────────── */
.xlpe-section-h3 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin: 22px 0 10px !important;
  line-height: 1.3 !important;
  border: none !important;
  padding: 0 !important;
}

/* ── Tab bar ──────────────────────────────────────────────────────── */
.xlpe-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2.5px solid #2459b8;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.xlpe-tab-btn {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #555;
  background: #f4f4f4;
  border: 1.5px solid #ddd;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  margin-right: 3px;
  transition: all 0.15s;
  line-height: 1.4;
}
.xlpe-tab-btn:hover {
  color: #2459b8;
  background: #eaf0fb;
  border-color: #2459b8;
}
.xlpe-tab-btn.xlpe-active {
  background: #fff;
  color: #2459b8;
  border-color: #2459b8;
  border-bottom: 2.5px solid #fff;
  margin-bottom: -2.5px;
  z-index: 1;
  position: relative;
}

/* ── Option groups (radio pills) ─────────────────────────────────── */
.xlpe-option-group {
  margin-bottom: 20px;
}
.xlpe-group-label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin-bottom: 7px !important;
}
.xlpe-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.xlpe-option-group input[type="radio"],
.xlpe-option-group input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.xlpe-opt-label {
  display: inline-block;
  padding: 6px 13px;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  background: #f4f4f4;
  border: 1.5px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  user-select: none;
}
.xlpe-opt-label:hover {
  background: #eaf0fb;
  border-color: #3b74d4;
  color: #2459b8;
}
.xlpe-option-group input[type="radio"]:checked + .xlpe-opt-label,
.xlpe-option-group input[type="checkbox"]:checked + .xlpe-opt-label {
  background: #2459b8;
  border-color: #2459b8;
  color: #fff;
}
.xlpe-opt-note {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 5px;
  font-style: italic;
}

/* ── Slider ──────────────────────────────────────────────────────── */
.xlpe-slider-group {
  margin-bottom: 20px;
}
.xlpe-slider-group .xlpe-group-label {
  margin-bottom: 7px;
}
.xlpe-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xlpe-slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #d0d9ef;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
  box-shadow: none;
}
.xlpe-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2459b8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #2459b8;
  cursor: pointer;
}
.xlpe-slider-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2459b8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #2459b8;
  cursor: pointer;
}
.xlpe-slider-val {
  font-size: 14px;
  font-weight: 700;
  color: #2459b8;
  min-width: 62px;
  text-align: right;
}
.xlpe-slider-range {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #aaa;
  margin-top: 3px;
}

/* ── Toggle switches ─────────────────────────────────────────────── */
.xlpe-toggle-group {
  margin-bottom: 20px;
}
.xlpe-toggle-list {
  border: 1.5px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}
.xlpe-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  gap: 12px;
}
.xlpe-toggle-item:last-child {
  border-bottom: none;
}
.xlpe-toggle-item-label {
  font-size: 14px;
  color: #3a3a3a;
  flex: 1;
}
.xlpe-toggle-item-sub {
  font-size: 12px;
  color: #888;
  display: block;
  margin-top: 2px;
}
.xlpe-sw {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  display: inline-block;
}
.xlpe-sw input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.xlpe-sw-track {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
}
.xlpe-sw-track::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 4px;
  top: 4px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.xlpe-sw input:checked + .xlpe-sw-track {
  background: #2459b8;
}
.xlpe-sw input:checked + .xlpe-sw-track::before {
  transform: translateX(16px);
}

/* ── Divider ─────────────────────────────────────────────────────── */
.xlpe-divider {
  border: none !important;
  border-top: 2px solid #e8e8e8 !important;
  margin: 26px 0 !important;
  background: none !important;
}

/* ── Calculate button ────────────────────────────────────────────── */
.xlpe-btn-calc {
  display: inline-block;
  padding: 11px 30px;
  background: #2459b8;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 6px;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.xlpe-btn-calc:hover {
  background: #1a3e8a;
  color: #fff !important;
}

/* ── Result panel ────────────────────────────────────────────────── */
.xlpe-result-wrap {
  margin-top: 24px;
}
.xlpe-result-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}
.xlpe-result-hero {
  background: #f0f5ff;
  border: 2px solid #2459b8;
  border-left: 5px solid #2459b8;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.xlpe-rh-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.xlpe-rh-value {
  font-size: 42px;
  font-weight: 700;
  color: #2459b8;
  line-height: 1;
}
.xlpe-rh-unit {
  font-size: 18px;
  color: #555;
  font-weight: 600;
}
.xlpe-rh-mva {
  font-size: 15px;
  color: #666;
  margin-left: 8px;
}
.xlpe-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.xlpe-metric-box {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 11px 12px;
  text-align: center;
}
.xlpe-mb-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 4px;
}
.xlpe-mb-val {
  font-size: 19px;
  font-weight: 700;
  color: #1a1a1a;
}
.xlpe-mb-unit {
  font-size: 12px;
  color: #888;
  font-weight: 400;
}

/* ── Derating factor table ───────────────────────────────────────── */
.xlpe-df-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}
.xlpe-df-table thead tr {
  background: #2459b8;
  color: #fff;
}
.xlpe-df-table thead th {
  padding: 9px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
}
.xlpe-df-table thead th:nth-child(3),
.xlpe-df-table thead th:nth-child(4),
.xlpe-df-table thead th:nth-child(5) {
  text-align: center;
}
.xlpe-df-table tbody tr {
  border-bottom: 1px solid #ececec;
}
.xlpe-df-table tbody tr:nth-child(even) {
  background: #f8f8f8;
}
.xlpe-df-table tbody tr:hover {
  background: #eaf0fb;
}
.xlpe-df-table td {
  padding: 8px 10px;
  color: #3a3a3a;
  vertical-align: middle;
}
.xlpe-df-table td:nth-child(3),
.xlpe-df-table td:nth-child(4) {
  text-align: center;
}
.xlpe-df-table td:nth-child(5) {
  text-align: right;
  font-size: 11px;
  color: #888;
}
.xlpe-df-val-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
}
.xlpe-df-bar-wrap {
  width: 72px;
  display: inline-block;
  vertical-align: middle;
}
.xlpe-df-bar-bg {
  background: #e0e0e0;
  height: 6px;
  border-radius: 3px;
}
.xlpe-df-bar {
  height: 6px;
  border-radius: 3px;
}

/* ── Reference tables ────────────────────────────────────────────── */
.xlpe-ref-table-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
}
.xlpe-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.xlpe-ref-table thead tr {
  background: #2459b8;
  color: #fff;
}
.xlpe-ref-table thead th {
  padding: 8px 10px;
  text-align: right;
  font-weight: 700;
  font-size: 12px;
}
.xlpe-ref-table thead th:first-child {
  text-align: left;
}
.xlpe-ref-table tbody tr {
  border-bottom: 1px solid #ececec;
}
.xlpe-ref-table tbody tr:nth-child(even) {
  background: #f8f8f8;
}
.xlpe-ref-table td {
  padding: 7px 10px;
  text-align: right;
  color: #3a3a3a;
}
.xlpe-ref-table td:first-child {
  text-align: left;
  font-weight: 600;
}
.xlpe-ref-table tr.xlpe-active-row td {
  background: #fff3cd;
  color: #856404;
  font-weight: 700;
}

/* ── Info / warn boxes ───────────────────────────────────────────── */
.xlpe-info-box {
  background: #f0f5ff;
  border-left: 4px solid #2459b8;
  padding: 11px 15px;
  font-size: 14px;
  color: #444;
  margin: 12px 0;
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}
.xlpe-warn-box {
  background: #fffbe6;
  border-left: 4px solid #f0a500;
  padding: 11px 15px;
  font-size: 13px;
  color: #664d00;
  margin: 12px 0;
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}

/* ── Secondary button ────────────────────────────────────────────── */
.xlpe-btn-secondary {
  display: inline-block;
  padding: 8px 20px;
  background: #fff;
  color: #2459b8 !important;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  border: 2px solid #2459b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
  margin-right: 8px;
  text-decoration: none;
}
.xlpe-btn-secondary:hover {
  background: #eaf0fb;
  color: #2459b8 !important;
}

/* ── Disclaimer ──────────────────────────────────────────────────── */
.xlpe-disclaimer {
  font-size: 12px;
  color: #888;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #eee;
  line-height: 1.65;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .xlpe-rh-value { font-size: 32px; }
  .xlpe-metrics-row { grid-template-columns: 1fr 1fr; }
  .xlpe-opt-label { font-size: 13px; padding: 5px 10px; }
  .xlpe-df-table td:nth-child(4) { display: none; }
  .xlpe-df-table th:nth-child(4) { display: none; }
}

@media print {
  .xlpe-tab-bar,
  .xlpe-btn-calc,
  .xlpe-btn-secondary { display: none !important; }
}
