/* ═══════════════════════════════════════════════════════════════
   Insight Metrics — Custom CSS Utility Classes
   Source of truth: §10.1 of JEEVI_MBTI_B2B_UI_Blueprint.md
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────── ANIMATIONS ───────────────────────── */
@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.animate-slide-in-right { animation: slide-in-right 300ms ease-out; }

@keyframes slide-out-right {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
.animate-slide-out-right { animation: slide-out-right 200ms ease-in forwards; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-in { animation: fade-in 200ms ease-out; }

@keyframes bounce-once {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-12px); }
  60% { transform: translateY(-4px); }
}
.animate-bounce-once { animation: bounce-once 600ms ease-out; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.animate-modal-in { animation: modal-in 200ms ease-out; }

/* ───────────────────────── WP THEME BLEND — kill parent spacing ── */
#im-b2b-app {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  float: none !important;
}

/* ───────────────────────── LOGO (prevent WP theme override) ──── */
.im-b2b-portal img.im-logo,
.im-b2b-candidate img.im-logo {
  height: 36px !important;
  width: auto !important;
  max-width: 200px !important;
  object-fit: contain !important;
}
.im-b2b-portal img.im-logo-sm,
.im-b2b-candidate img.im-logo-sm {
  height: 24px !important;
  width: auto !important;
  max-width: 160px !important;
  object-fit: contain !important;
}

/* ───────────────────────── TYPOGRAPHY — nuclear WP-theme override ── */
/* Use #id selector for max specificity; WP themes style bare h1-h6 tags
   with their own font-family, weight, letter-spacing, text-transform.
   We must override ALL of those.                                       */

#im-b2b-app,
#im-b2b-app *:not(.font-serif):not([class*="font-serif"]) {
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif !important;
}
#im-b2b-app .font-serif,
#im-b2b-app [style*="Fraunces"] {
  font-family: 'Fraunces', Georgia, Cambria, serif !important;
  font-optical-sizing: auto !important;
}

#im-b2b-app h1,
#im-b2b-app h2,
#im-b2b-app h3,
#im-b2b-app h4,
#im-b2b-app h5,
#im-b2b-app h6 {
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif !important;
  letter-spacing: 0.6px !important;
  word-spacing: 3px !important;
  text-transform: none !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}
/* Serif headings (candidate pages) keep Fraunces */
#im-b2b-app h1.font-serif,
#im-b2b-app h2.font-serif,
#im-b2b-app h3.font-serif,
#im-b2b-app h4.font-serif {
  font-family: 'Fraunces', Georgia, Cambria, serif !important;
  font-optical-sizing: auto !important;
}
/* Font-weight: let Tailwind classes work, but override any theme !important */
#im-b2b-app .font-semibold { font-weight: 600 !important; }
#im-b2b-app .font-medium   { font-weight: 500 !important; }
#im-b2b-app .font-bold     { font-weight: 700 !important; }
#im-b2b-app .font-normal   { font-weight: 400 !important; }

/* Body text */
#im-b2b-app p,
#im-b2b-app span,
#im-b2b-app label,
#im-b2b-app a,
#im-b2b-app li,
#im-b2b-app td,
#im-b2b-app th,
#im-b2b-app input,
#im-b2b-app button,
#im-b2b-app select,
#im-b2b-app textarea {
  letter-spacing: 0.4px !important;
  word-spacing: 2px !important;
  text-transform: none !important;
}

/* Tailwind text-size classes — force correct sizes over theme resets */
#im-b2b-app .text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
#im-b2b-app .text-xl  { font-size: 1.25rem !important; line-height: 1.75rem !important; }
#im-b2b-app .text-lg  { font-size: 1.125rem !important; line-height: 1.75rem !important; }
#im-b2b-app .text-sm  { font-size: 0.875rem !important; line-height: 1.25rem !important; }
#im-b2b-app .text-xs  { font-size: 0.75rem !important; line-height: 1rem !important; }

/* ───────────────────────── PORTAL LAYOUT ───────────────────────── */
/* Flex shell — hardened with #id + !important so WP themes can't break it */

#im-b2b-app .im-b2b-shell {
  display: flex !important;
  flex-direction: row !important;
  min-height: 80vh !important;
  position: relative !important;
  border: 1px solid #e4e7ee !important;
  border-radius: 0.75rem !important;
  overflow: hidden !important;
  background: #f9fafb !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Desktop sidebar: sticky inside the flex container */
#im-b2b-app .im-b2b-sidebar {
  width: 15rem !important;
  min-width: 15rem !important;
  max-width: 15rem !important;
  flex-shrink: 0 !important;
  display: none !important;
  flex-direction: column !important;
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  overflow-y: auto !important;
  background: #fff !important;
  border-right: 1px solid #e4e7ee !important;
  z-index: 40 !important;
  padding: 0 !important;
  margin: 0 !important;
}
@media (min-width: 1024px) {
  #im-b2b-app .im-b2b-sidebar {
    display: flex !important;
    transform: none !important;
  }
}

/* Mobile sidebar: fixed overlay (toggle via JS) */
@media (max-width: 1023px) {
  #im-b2b-app .im-b2b-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 15rem !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Content area takes remaining space */
#im-b2b-app .im-b2b-content-wrap {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ───────────────────────── INPUTS ───────────────────────── */
.input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #cbd0dc;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  transition: all 150ms ease-out;
}
.input::placeholder { color: #9ba4b8; }
.input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #c9a961;
  border-color: #c9a961;
}
.input:disabled {
  background-color: #f1f3f7;
  color: #9ba4b8;
  cursor: not-allowed;
}

.input-error {
  border-color: #ef4444;
}
.input-error:focus {
  box-shadow: 0 0 0 2px #ef4444;
  border-color: #ef4444;
}

.input-success {
  border-color: #22c55e;
}
.input-success:focus {
  box-shadow: 0 0 0 2px #22c55e;
  border-color: #22c55e;
}

.input-editorial {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #cbd0dc;
  border-radius: 0.375rem;
  transition: all 150ms ease-out;
}
.input-editorial::placeholder { color: #9ba4b8; }
.input-editorial:focus {
  outline: none;
  box-shadow: 0 0 0 2px #c9a961;
  border-color: #c9a961;
}

/* ───────────────────────── BUTTONS (HR) ───────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: #c9a961;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  transition: all 150ms ease-out;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background-color: #b8922f; }
.btn-primary:active { background-color: #997727; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:disabled:hover { background-color: #c9a961; }
.btn-primary:focus { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #c9a961; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  border: 1px solid #e4e7ee;
  transition: all 150ms ease-out;
  cursor: pointer;
}
.btn-secondary:hover { background-color: #f8f9fb; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary:focus { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #c9a961; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: transparent;
  color: #1a2332;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  transition: all 150ms ease-out;
  cursor: pointer;
}
.btn-ghost:hover { background-color: #f1f3f7; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: #dc2626;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  border: none;
  transition: all 150ms ease-out;
  cursor: pointer;
}
.btn-danger:hover { background-color: #b91c1c; }
.btn-danger:focus { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #dc2626; }

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background-color: #ffffff;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  border: 1px solid #fca5a5;
  transition: all 150ms ease-out;
  cursor: pointer;
}
.btn-danger-outline:hover { background-color: #fef2f2; }
.btn-danger-outline:focus { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #dc2626; }

/* Sizes */
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; }
.btn-xl { padding: 0.875rem 1.5rem; font-size: 1rem; }

/* ───────────────────────── BUTTONS (CANDIDATE/EDITORIAL) ───────────────────────── */
.btn-editorial-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background-color: #c9a961;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  border: none;
  transition: all 150ms ease-out;
  cursor: pointer;
}
.btn-editorial-gold:hover { background-color: #ceae52; }
.btn-editorial-gold:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-editorial-gold:disabled:hover { background-color: #c9a961; }
.btn-editorial-gold:focus {
  outline: none;
  box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #ceae52;
}

.btn-editorial-navy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background-color: #0f172a;
  color: #fefdfa;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  border: none;
  transition: all 150ms ease-out;
  cursor: pointer;
}
.btn-editorial-navy:hover { background-color: #121a26; }
.btn-editorial-navy:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-editorial-navy:disabled:hover { background-color: #0f172a; }
.btn-editorial-navy:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a;
}

/* ───────────────────────── BADGES ───────────────────────── */
.badge-success {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: #f0fdf4;
  color: #15803d;
}
.badge-success::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #22c55e;
}

.badge-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: #fefce8;
  color: #a16207;
}
.badge-warning::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #eab308;
}

.badge-info {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: #eff6ff;
  color: #1d4ed8;
}
.badge-info::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #3b82f6;
}

.badge-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: #fef2f2;
  color: #b91c1c;
}
.badge-danger::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #ef4444;
}

.badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: #faf7ee;
  color: #7d6023;
  border: 1px solid #e7d9a6;
}

.badge-neutral {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: #f1f3f7;
  color: #2f3647;
}
.badge-neutral::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #9ba4b8;
}

/* ───────────────────────── NAV ITEMS ───────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  color: #1a2332;
  transition: all 150ms ease-out;
  text-decoration: none;
}
.nav-item:hover {
  background-color: #f1f3f7;
  color: #0f172a;
}
.nav-item svg { color: #9ba4b8; }
.nav-item:hover svg { color: #27324a; }

.nav-item-active {
  background-color: #faf7ee;
  color: #7d6023;
  box-shadow: inset 2px 0 0 0 #c9a961;
}
.nav-item-active:hover {
  background-color: #faf7ee;
  color: #7d6023;
}
.nav-item-active svg { color: #997727; }

/* ───────────────────────── CARDS ───────────────────────── */
.card {
  background-color: #ffffff;
  border: 1px solid #e4e7ee;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
}

.card-padded {
  background-color: #ffffff;
  border: 1px solid #e4e7ee;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  padding: 1.5rem;
}

.card-premium {
  background-color: #ffffff;
  border: 2px solid #c9a961;
  border-radius: 1rem;
  box-shadow: 0 10px 40px -10px rgb(201 169 97 / 0.3);
  position: relative;
}

.card-editorial {
  background-color: #ffffff;
  border: 1px solid #e9ebf0;
  border-radius: 0.375rem;
}

/* ───────────────────────── EDITORIAL PRIMITIVES ───────────────────────── */
.gold-rule {
  height: 1px;
  width: 6rem;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, transparent, #c9a961, transparent);
}

.gold-rule-wide {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, #c9a961 20%, #c9a961 80%, transparent);
}

.medallion {
  width: 8rem;
  height: 8rem;
  border-radius: 9999px;
  background-color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid #c9a961;
  box-shadow: inset 0 0 0 4px #0f172a, inset 0 0 0 5px #c9a961;
}

.medallion-text {
  font-family: 'Fraunces', Georgia, Cambria, serif;
  color: #fefdfa;
  font-size: 1.875rem;
  font-weight: 500;
}

.h-serif {
  font-family: 'Fraunces', Georgia, Cambria, serif;
  font-optical-sizing: auto;
  color: #0f172a;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.h-serif-light {
  font-family: 'Fraunces', Georgia, Cambria, serif;
  font-optical-sizing: auto;
  color: #fefdfa;
  font-weight: 500;
  letter-spacing: -0.025em;
}

/* ───────────────────────── STAT CARDS ───────────────────────── */
.stat-card {
  background-color: #ffffff;
  border: 1px solid #e4e7ee;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05);
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64708a;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0.5rem;
}

.stat-delta-positive {
  font-size: 0.75rem;
  font-weight: 500;
  color: #16a34a;
}

.stat-icon-wrap {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: #faf7ee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon {
  width: 1rem;
  height: 1rem;
  color: #997727;
}

/* ───────────────────────── LINK STYLE ───────────────────────── */
.link-gold {
  color: #997727;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 150ms ease-out;
}
.link-gold:hover { color: #7d6023; }

/* ───────────────────────── TABLE HELPERS ───────────────────────── */
.table-header {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64708a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ───────────────────────── FOCUS RING UTILITY ───────────────────────── */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #c9a961;
}
