/* ==========================================================================
   VivreFR French Payslip Decoder - V1 Prototype Style Sheet
   Aesthetic: Premium Warm Minimalist Glassmorphism (VivreFR Design System)
   ========================================================================== */

/* Design Tokens (Matching VivreFR Global Variables) */
:root {
  --vf-bg:               #f6f2ec;
  --vf-brand-beige:      #dcd6cc;
  --vf-surface:          #ffffff;
  --vf-surface-soft:     #ece6de;
  --vf-navy:             #1c3281;
  --vf-navy-dark:        #14245c;
  --vf-navy-deep:        #0c1a40;
  --vf-red-ui:           #c8321a;
  --vf-red-flag:         #e1000f;
  --vf-green-ui:         #16a34a;
  --vf-orange-ui:        #ea580c;
  --vf-ink:              #080f1e;
  --vf-muted:            #64748b;
  --vf-espresso:         #6b5e4e;
  --vf-line:             rgba(0,0,0,0.08);
  --vf-line-strong:      rgba(0,0,0,0.12);
  --vf-shadow:           0 10px 30px rgba(0,0,0,0.06);
  --vf-shadow-hover:     0 18px 50px rgba(28,50,129,0.10);
  --vf-hero-panel-start: rgba(28,50,129,0.96);
  --vf-hero-panel-end:   rgba(20,36,92,0.98);
  --vf-r-sm:             10px;
  --vf-r-md:             18px;
  --vf-r-lg:             26px;
  --vf-r-xl:             36px;
  --vf-display:          "Plus Jakarta Sans", sans-serif;
  --vf-body:             "Plus Jakarta Sans", sans-serif;

  /* Category Colors */
  --pd-green:            #16a34a;
  --pd-green-bg:         #ecfdf5;
  --pd-blue:             #2563eb;
  --pd-blue-bg:          #eff6ff;
  --pd-orange:           #ea580c;
  --pd-orange-bg:        #fff7ed;
  --pd-purple:           #7c3aed;
  --pd-purple-bg:        #f5f3ff;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--vf-body);
  color: var(--vf-ink);
  background: var(--vf-bg);
  -webkit-font-smoothing: antialiased;
}

/* Wrapper */
.pd-wrapper,
.pd-wrapper *,
.pd-wrapper *::before,
.pd-wrapper *::after {
  box-sizing: border-box !important;
}

.pd-wrapper {
  box-sizing: border-box;
}

/* Container */
.pd-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Hero ===== */
.pd-hero {
  text-align: center;
  padding: 48px 0 12px;
}

.pd-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--vf-surface-soft);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--vf-navy);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.pd-main-title {
  font-family: var(--vf-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--vf-navy);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pd-subtitle {
  color: var(--vf-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== Card ===== */
.pd-card {
  background: var(--vf-surface);
  border-radius: var(--vf-r-lg);
  box-shadow: var(--vf-shadow);
  padding: 32px;
  margin-bottom: 28px;
  transition: box-shadow 0.2s;
}

.pd-card:hover {
  box-shadow: var(--vf-shadow-hover);
}

.pd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--vf-line);
}

.pd-card-header h2 {
  font-family: var(--vf-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--vf-navy);
  margin: 0;
}

/* ===== Input Form ===== */
.pd-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .pd-form-grid { grid-template-columns: 1fr; }
}

.pd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pd-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--vf-navy);
}

.pd-field .pd-label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--vf-muted);
}

.pd-input,
.pd-select {
  padding: 12px 16px;
  border: 2px solid var(--vf-line-strong);
  border-radius: var(--vf-r-sm);
  font-family: var(--vf-body);
  font-size: 0.95rem;
  color: var(--vf-ink);
  background: var(--vf-surface);
  transition: border-color 0.2s;
  outline: none;
}

.pd-input:focus,
.pd-select:focus {
  border-color: var(--vf-navy);
}

.pd-input::placeholder {
  color: var(--vf-muted);
  opacity: 0.6;
}

/* ===== Buttons ===== */
.pd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 30px;
  font-family: var(--vf-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.pd-btn-primary {
  background: var(--vf-navy);
  color: #fff;
}

.pd-btn-primary:hover {
  background: var(--vf-navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(28,50,129,0.2);
}

.pd-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pd-btn-secondary {
  background: var(--vf-surface-soft);
  color: var(--vf-navy);
}

.pd-btn-secondary:hover {
  background: #ddd6cb;
}

.pd-btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.pd-btn-center {
  text-align: center;
  margin-top: 24px;
}

/* ===== Payslip Layout ===== */
.pd-payslip {
  font-family: "Courier New", "Menlo", monospace;
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: var(--vf-r-md);
  padding: 28px 24px;
  line-height: 1.7;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.pd-payslip-header {
  text-align: center;
  border-bottom: 2px solid var(--vf-ink);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.pd-payslip-header h3 {
  font-family: var(--vf-display);
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: var(--vf-navy);
}

.pd-payslip-header .pd-payslip-meta {
  font-size: 0.8rem;
  color: var(--vf-muted);
}

.pd-payslip-section-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vf-muted);
  margin: 16px 0 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--vf-line-strong);
}

.pd-payslip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.pd-payslip-row:hover {
  background: rgba(28,50,129,0.06);
}

.pd-payslip-row.pd-highlighted {
  background: rgba(28,50,129,0.1);
}

.pd-payslip-row .pd-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-payslip-row .pd-row-value {
  font-weight: 600;
}

.pd-payslip-total {
  border-top: 2px solid var(--vf-ink);
  margin-top: 12px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 1.05rem;
}

.pd-payslip-total .pd-row-value {
  color: var(--vf-green-ui);
}

/* ===== Category Chips ===== */
.pd-category-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pd-dot-green  { background: var(--pd-green); }
.pd-dot-blue   { background: var(--pd-blue); }
.pd-dot-orange { background: var(--pd-orange); }
.pd-dot-purple { background: var(--pd-purple); }

/* ===== Decoder Side Panel ===== */
.pd-decoder-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 460px;
  height: 100vh;
  background: var(--vf-surface);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pd-decoder-panel.pd-open {
  right: 0;
}

.pd-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.pd-panel-overlay.pd-visible {
  opacity: 1;
  pointer-events: auto;
}

.pd-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--vf-line);
  flex-shrink: 0;
}

.pd-panel-header-info {
  flex: 1;
}

.pd-panel-category-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}

.pd-chip-green  { background: var(--pd-green-bg);  color: var(--pd-green); }
.pd-chip-blue   { background: var(--pd-blue-bg);   color: var(--pd-blue); }
.pd-chip-orange { background: var(--pd-orange-bg); color: var(--pd-orange); }
.pd-chip-purple { background: var(--pd-purple-bg); color: var(--pd-purple); }

.pd-panel-french-name {
  font-family: var(--vf-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--vf-ink);
  margin: 0 0 4px;
}

.pd-panel-english-name {
  font-size: 0.95rem;
  color: var(--vf-muted);
}

.pd-panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--vf-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.pd-panel-close:hover {
  background: var(--vf-surface-soft);
}

.pd-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.pd-panel-section {
  margin-bottom: 24px;
}

.pd-panel-section-h2 {
  font-family: var(--vf-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--vf-navy);
  margin: 0 0 12px;
  text-transform: none;
  letter-spacing: normal;
}

.pd-panel-section h4,
.pd-panel-section-h3 {
  font-family: var(--vf-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vf-muted);
  margin: 0 0 8px;
  display: block;
}

.pd-panel-section p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--vf-ink);
  margin: 0;
}

.pd-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
}

.pd-badge-mandatory {
  background: #dcfce7;
  color: #166534;
}

.pd-badge-optional {
  background: #fef3c7;
  color: #92400e;
}

.pd-badge-rate {
  background: var(--vf-surface-soft);
  color: var(--vf-espresso);
  border-radius: 8px;
}

.pd-smart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--vf-navy);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  background: #eef2ff;
  border-radius: var(--vf-r-sm);
  transition: background 0.2s;
  font-size: 0.9rem;
}

.pd-smart-link:hover {
  background: #e0e7ff;
}

/* ===== "Where Did My Money Go?" Visual Journey ===== */
.pd-journey {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%);
  border-radius: var(--vf-r-md);
  border: 1px solid #dcfce7;
}

.pd-journey-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.pd-journey-step::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 42px;
  bottom: -10px;
  width: 2px;
  background: #d1d5db;
}

.pd-journey-step:last-child::before {
  display: none;
}

.pd-journey-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
  z-index: 1;
}

.pd-journey-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.pd-journey-amount {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--vf-display);
}

.pd-journey-subtract { color: var(--vf-red-ui); }
.pd-journey-add     { color: var(--vf-green-ui); }
.pd-journey-neutral { color: var(--vf-ink); }

/* ===== Employer Cost Card ===== */
.pd-employer-card {
  background: var(--pd-purple-bg);
  border: 1px solid #ede9fe;
  border-radius: var(--vf-r-md);
  padding: 24px;
  text-align: center;
}

.pd-employer-card h3 {
  font-family: var(--vf-display);
  font-size: 1rem;
  color: var(--vf-muted);
  margin: 0 0 16px;
}

.pd-employer-comparison {
  display: flex;
  justify-content: center;
  gap: 40px;
  align-items: center;
}

@media (max-width: 500px) {
  .pd-employer-comparison {
    flex-direction: column;
    gap: 16px;
  }
}

.pd-employer-item {
  text-align: center;
}

.pd-employer-item .pd-label {
  font-size: 0.8rem;
  color: var(--vf-muted);
  margin-bottom: 4px;
}

.pd-employer-item .pd-amount {
  font-family: var(--vf-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.pd-employer-item .pd-amount-gross {
  color: var(--vf-green-ui);
}

.pd-employer-item .pd-amount-total {
  color: var(--pd-purple);
}

.pd-employer-arrow {
  font-size: 1.5rem;
  color: var(--vf-muted);
}

.pd-employer-note {
  font-size: 0.85rem;
  color: var(--vf-muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ===== Did You Know ===== */
.pd-insight-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--vf-r-md);
  padding: 20px 24px;
}

.pd-insight-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  margin: 0 0 8px;
}

.pd-insight-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--vf-ink);
  margin: 0;
}

/* ===== Disclaimer ===== */
.pd-disclaimer {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--vf-r-md);
  padding: 16px 20px;
  font-size: 0.85rem;
  color: #991b1b;
  line-height: 1.6;
}

.pd-disclaimer strong {
  display: block;
  margin-bottom: 4px;
}

/* ===== Legend ===== */
.pd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--vf-surface-soft);
  border-radius: var(--vf-r-sm);
}

.pd-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--vf-muted);
}

/* ===== Result Tabs ===== */
.pd-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--vf-surface-soft);
  border-radius: var(--vf-r-sm);
  padding: 4px;
}

.pd-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-family: var(--vf-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--vf-muted);
  transition: all 0.2s;
}

.pd-tab:hover {
  color: var(--vf-ink);
}

.pd-tab.pd-active {
  background: var(--vf-surface);
  color: var(--vf-navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pd-tab-content {
  display: none;
}

.pd-tab-content.pd-active {
  display: block;
  animation: pdFadeIn 0.3s ease;
}

@keyframes pdFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Summary Stats ===== */
.pd-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pd-stat-card {
  background: var(--vf-surface-soft);
  border-radius: var(--vf-r-sm);
  padding: 16px;
  text-align: center;
}

.pd-stat-card .pd-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--vf-muted);
  margin-bottom: 8px;
}

.pd-stat-card .pd-stat-value {
  font-family: var(--vf-display);
  font-size: 1.4rem;
  font-weight: 700;
}

/* ===== State Indicators ===== */
.pd-state-empty,
.pd-state-error {
  text-align: center;
  padding: 20px 20px 48px;
}

.pd-state-empty .pd-state-icon,
.pd-state-error .pd-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.pd-state-empty h3,
.pd-state-error h3 {
  font-family: var(--vf-display);
  font-size: 1.3rem;
  color: var(--vf-navy);
  margin: 0 0 8px;
}

.pd-state-empty p,
.pd-state-error p {
  color: var(--vf-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ===== Highlight pulse for clicked row ===== */
@keyframes pdPulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(28,50,129,0.12); }
}

.pd-pulse {
  animation: pdPulse 0.8s ease 2;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .pd-card {
    padding: 20px;
  }

  .pd-decoder-panel {
    width: 100%;
    right: -100%;
  }

  .pd-payslip {
    font-size: 0.8rem;
    padding: 16px;
  }
}

/* ===== Immune list resets for WordPress theme overrides ===== */
.pd-decoder-panel ul,
.pd-decoder-panel ol,
.pd-container ul,
.pd-container ol {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pd-decoder-panel li,
.pd-container li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pd-decoder-panel li::before,
.pd-decoder-panel li::after,
.pd-container li::before,
.pd-container li::after {
  content: none !important;
  display: none !important;
}

/* ===== Things to Know Layout styles ===== */
.pd-insight-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.pd-insight-item {
  margin-bottom: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.pd-insight-question {
  font-weight: 700 !important;
  color: var(--vf-navy) !important;
  font-size: 0.9rem !important;
  margin-bottom: 6px !important;
}

.pd-insight-answer {
  padding-left: 24px !important;
  color: var(--vf-ink) !important;
  font-size: 0.88rem !important;
  font-weight: 400 !important;
  line-height: 1.65 !important;
}


