/*
 * PayInsightHub – Shared Calculator Base Styles v1.0
 * Author: Yasir Ali | payinsighthub.com
 *
 * This file is shared across all 4 calculator plugins.
 * Each plugin wraps content in its own unique class (.pih-ls-wrap,
 * .pih-ot-wrap, .pih-eos-wrap, .pih-ss-wrap) so there is zero
 * bleed into your WordPress theme or other plugins.
 *
 * Per-plugin accent colours are applied via CSS custom properties
 * set on the individual wrapper elements.
 */

/* ── Shared selectors: each plugin's wrap scopes these ── */

.pih-ls-wrap,
.pih-ot-wrap,
.pih-eos-wrap,
.pih-ss-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a2e;
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
}

.pih-ls-wrap *, .pih-ls-wrap *::before, .pih-ls-wrap *::after,
.pih-ot-wrap *, .pih-ot-wrap *::before, .pih-ot-wrap *::after,
.pih-eos-wrap *, .pih-eos-wrap *::before, .pih-eos-wrap *::after,
.pih-ss-wrap *, .pih-ss-wrap *::before, .pih-ss-wrap *::after {
  box-sizing: inherit;
}

/* ── Two-column grid ── */
.pih-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 680px) {
  .pih-calc-grid { grid-template-columns: 1fr; }
}

/* ── Panel card ── */
.pih-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.pih-panel-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f2f5;
}
.pih-ico { font-size: 20px; line-height: 1; }
.pih-panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a2e;
  letter-spacing: -.01em;
}

/* ── Fields ── */
.pih-field { margin-bottom: 18px; }
.pih-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pih-opt {
  font-weight: 400;
  color: #9ca3af;
  text-transform: none;
  font-size: 11px;
  font-style: normal;
}
.pih-hint {
  margin: 5px 0 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

/* ── Inputs — strictly scoped, never bleeds to theme ── */
.pih-ls-wrap .pih-input,
.pih-ot-wrap .pih-input,
.pih-eos-wrap .pih-input,
.pih-ss-wrap .pih-input,
.pih-ls-wrap .pih-select,
.pih-ot-wrap .pih-select,
.pih-eos-wrap .pih-select,
.pih-ss-wrap .pih-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a2e;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
}
.pih-ls-wrap .pih-input:focus,
.pih-ot-wrap .pih-input:focus,
.pih-eos-wrap .pih-input:focus,
.pih-ss-wrap .pih-input:focus {
  border-color: var(--pih-accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: #fff;
}

/* Select arrow */
.pih-ls-wrap .pih-select,
.pih-ot-wrap .pih-select,
.pih-eos-wrap .pih-select,
.pih-ss-wrap .pih-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* AED prefix input */
.pih-input-wrap { position: relative; }
.pih-prefix {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px; font-weight: 600;
  color: #6b7280;
  pointer-events: none;
  z-index: 1;
}
.pih-has-prefix { padding-left: 52px !important; }

/* ── Toggle buttons ── */
.pih-ls-toggle,
.pih-ot-toggle,
.pih-eos-toggle,
.pih-ss-toggle {
  display: flex;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}

.pih-ls-wrap .pih-ls-tbtn,
.pih-ot-wrap .pih-ot-tbtn,
.pih-eos-wrap .pih-eos-tbtn,
.pih-ss-wrap .pih-ss-tbtn {
  flex: 1;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #6b7280;
  background: #f8fafc;
  border: none;
  border-right: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: background .15s, color .15s;
  outline: none;
}
.pih-ls-wrap .pih-ls-tbtn:last-child,
.pih-ot-wrap .pih-ot-tbtn:last-child,
.pih-eos-wrap .pih-eos-tbtn:last-child,
.pih-ss-wrap .pih-ss-tbtn:last-child { border-right: none; }

.pih-ls-wrap .pih-ls-tbtn.pih-ls-active,
.pih-ot-wrap .pih-ot-tbtn.pih-ot-active,
.pih-eos-wrap .pih-eos-tbtn.pih-eos-active,
.pih-ss-wrap .pih-ss-tbtn.pih-ss-active {
  background: var(--pih-accent, #6366f1);
  color: #fff;
  font-weight: 600;
}
.pih-ls-wrap .pih-ls-tbtn:hover:not(.pih-ls-active),
.pih-ot-wrap .pih-ot-tbtn:hover:not(.pih-ot-active),
.pih-eos-wrap .pih-eos-tbtn:hover:not(.pih-eos-active),
.pih-ss-wrap .pih-ss-tbtn:hover:not(.pih-ss-active) { background: #f0f2f5; }

/* ── Action buttons ── */
.pih-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.pih-ls-wrap .pih-btn,
.pih-ot-wrap .pih-btn,
.pih-eos-wrap .pih-btn,
.pih-ss-wrap .pih-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.pih-ls-wrap .pih-btn:hover,
.pih-ot-wrap .pih-btn:hover,
.pih-eos-wrap .pih-btn:hover,
.pih-ss-wrap .pih-btn:hover { opacity: .88; }
.pih-ls-wrap .pih-btn:active,
.pih-ot-wrap .pih-btn:active,
.pih-eos-wrap .pih-btn:active,
.pih-ss-wrap .pih-btn:active { transform: scale(.98); }

.pih-btn-calc {
  background: var(--btn-color, var(--pih-accent, #6366f1));
  color: #fff;
}
.pih-btn-reset {
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0 !important;
}
.pih-btn-wa {
  background: #25d366;
  color: #fff;
  width: 100%;
}
.pih-btn-print {
  background: #1e293b;
  color: #fff;
  width: 100%;
}

/* ── Total result box ── */
.pih-total-box {
  background: linear-gradient(135deg,
    var(--box-color-a, #6366f1) 0%,
    var(--box-color-b, #4f46e5) 100%);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 20px;
}
.pih-total-lbl {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pih-total-amt {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1;
}
.pih-total-sub {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,.65);
}

/* ── Breakdown rows ── */
.pih-breakdown {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
.pih-brow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.pih-brow:nth-child(even) { background: #fafafa; }
.pih-brow:last-child { border-bottom: none; }
.pih-brow span:first-child { color: #6b7280; }
.pih-brow span:last-child { font-weight: 600; color: #1a1a2e; }
.pih-brow-total {
  background: #f8fafc !important;
  font-weight: 700;
}
.pih-brow-total span:first-child { font-weight: 700; color: #1a1a2e; }
.pih-brow-total span:last-child {
  color: var(--pih-accent, #6366f1);
  font-size: 15px;
}
.pih-brow-highlight span:last-child { color: #16a34a; }

/* ── Export bar ── */
.pih-export {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* ── Disclaimer ── */
.pih-disc {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.5;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

/* ── Salary Slip specific ── */
.pih-slip-out {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  font-size: 13px;
}
.pih-slip-header {
  background: var(--pih-accent, #6366f1);
  color: #fff;
  padding: 18px 20px;
  text-align: center;
}
.pih-slip-header h4 { margin: 0 0 4px; font-size: 16px; }
.pih-slip-header p  { margin: 0; font-size: 12px; opacity: .8; }
.pih-slip-section {
  padding: 0 20px;
  border-bottom: 1px solid #f1f5f9;
}
.pih-slip-section-title {
  padding: 10px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 2px;
}
.pih-slip-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
}
.pih-slip-row:last-child { border-bottom: none; }
.pih-slip-row.pih-slip-subtotal {
  font-weight: 600;
  color: #1a1a2e;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
  padding-top: 10px;
}
.pih-slip-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #f8fafc;
  font-weight: 700;
  font-size: 14px;
}
.pih-slip-net { color: var(--pih-accent, #6366f1); font-size: 17px; }
