/**
 * NursingRidge NANDA Lookup — Drupal Module CSS
 * Designed to sit INSIDE an existing Drupal page layout.
 * No fixed topbar — uses the site's own header/nav.
 * All selectors scoped to #nr-nanda-app to avoid conflicts.
 */

#nr-nanda-app {
  --navy:  #153A5B;
  --teal:  #2D9C9C;
  --gold:  #C79A3B;
  --bg:    #F8FAFC;
  --white: #FFFFFF;
  --border:#DDE3EC;
  --txt:   #1F2937;
  --sub:   #64748B;
  --sky:   #D9EEF2;
  --mint:  #F0FDF4;
  --navy2: #1F4E79;

  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--txt);
  background: var(--bg);

  /* Flex column so tool-bar + screens stack vertically */
  display: flex;
  flex-direction: column;

  position: relative;
  width: 100%;
  height: calc(100vh - 200px); /* adjust to match your theme header + page title height */
  min-height: 500px;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── BREADCRUMB BAR (replaces topbar — sits at top of the tool) ── */
#nr-tool-bar {
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--navy);
  padding: 0 14px;
  gap: 0;
  flex-shrink: 0;
  border-radius: 6px 6px 0 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.bc-sep { color: rgba(255,255,255,.25); margin: 0 6px; font-size: 13px; flex-shrink: 0; }
.bc-item {
  font-size: 12px; color: rgba(255,255,255,.55);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.bc-item:hover { color: rgba(255,255,255,.9); text-decoration: underline; }
.bc-item.here  { color: var(--gold); cursor: default; pointer-events: none; font-weight: 600; }
#nr-back {
  background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 12px; font-weight: 500; padding: 4px 10px;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
  flex-shrink: 0; display: none; margin-left: 8px;
}
#nr-back:hover { background: rgba(255,255,255,.2); }
#nr-back.visible { display: block; }

/* ── SCREEN CONTAINER ── */
#nr-screens {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform .25s ease;
  will-change: transform;
}
.screen.active { transform: translateX(0); }
.screen.behind  { transform: translateX(-30%); }
.nr-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── SEARCH ── */
.search-bar { padding: 10px 14px; background: var(--white); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-inner { position: relative; }
.search-inner svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.search-inner input {
  width: 100%; padding: 9px 32px 9px 32px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--txt);
  background: var(--bg); outline: none; transition: border-color .15s;
}
.search-inner input:focus { border-color: var(--teal); background: var(--white); }
.search-inner input::placeholder { color: #94a3b8; }
#nr-clr {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #94a3b8; font-size: 20px;
  cursor: pointer; display: none; line-height: 1; padding: 0;
}

/* ── SPECIALTY PILLS ── */
.pills {
  display: flex; gap: 6px; padding: 8px 14px;
  overflow-x: auto; background: var(--white);
  border-bottom: 1px solid var(--border); scrollbar-width: none; flex-shrink: 0;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  padding: 5px 12px; border-radius: 14px; font-size: 11px; font-weight: 500;
  cursor: pointer; border: 1.5px solid var(--border); color: var(--sub);
  background: var(--white); white-space: nowrap; transition: all .12s; flex-shrink: 0;
}
.pill.on { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ── RESULTS INFO ── */
.ri { padding: 6px 14px; font-size: 11px; color: var(--sub); background: var(--bg); border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* ── SECTION HEADERS (collapsible) ── */
.sec-hdr {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; cursor: pointer;
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--sub);
  background: var(--bg); border-bottom: 1px solid var(--border);
  user-select: none;
}
.sec-hdr:hover { background: #e4eaf1; }
.sec-dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sec-count { font-weight: 400; opacity: .5; }
.sec-chev  { margin-left: auto; font-size: 12px; color: #94a3b8; transition: transform .2s; line-height: 1; flex-shrink: 0; }
.sec-chev.closed { transform: rotate(-90deg); }
.sec-body  { overflow: hidden; }

/* ── CONDITION ROWS ── */
.cond-row {
  display: flex; align-items: center; padding: 12px 14px;
  background: var(--white); border-bottom: 1px solid var(--border);
  cursor: pointer; border-left: 3px solid transparent;
}
.cond-row:hover { background: var(--sky); border-left-color: var(--teal); }
.cond-info  { flex: 1; min-width: 0; }
.cond-name  { font-size: 13px; font-weight: 500; color: var(--txt); line-height: 1.35; }
.cond-sub   { font-size: 11px; color: var(--sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cond-badge { font-size: 10px; font-weight: 600; color: var(--teal); background: var(--sky); padding: 2px 7px; border-radius: 8px; margin-left: 8px; flex-shrink: 0; }
.cond-arr   { color: #cbd5e1; font-size: 16px; margin-left: 8px; flex-shrink: 0; }

.no-res { padding: 48px 20px; text-align: center; color: var(--sub); }
.no-res .ico { font-size: 32px; margin-bottom: 10px; opacity: .3; }

/* ── CONDITION DETAIL ── */
.cond-hdr-block { padding: 16px; flex-shrink: 0; }
.cond-spec-tag  { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 3px; }
.cond-title     { font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; color: #fff; line-height: 1.2; }
.legend-bar     { display: flex; gap: 14px; flex-wrap: wrap; padding: 9px 14px; background: var(--sky); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.leg            { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--sub); }
.leg-dot        { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dx-grp         { padding: 8px 14px 5px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--sub); background: var(--bg); }
.dx-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--white); border-bottom: 1px solid var(--border);
  cursor: pointer; border-left: 3px solid transparent;
}
.dx-row:hover  { background: var(--sky); border-left-color: var(--teal); }
.dx-dot        { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dx-dot.p      { background: var(--gold); }
.dx-dot.a      { background: var(--teal); }
.dx-info       { flex: 1; min-width: 0; }
.dx-name       { font-size: 13px; font-weight: 500; color: var(--txt); line-height: 1.3; }
.dx-hint       { font-size: 11px; color: var(--sub); margin-top: 2px; }
.dx-arr        { color: #cbd5e1; font-size: 16px; flex-shrink: 0; }

/* ── CARE PLAN ── */
.cp-hdr-block  { padding: 16px 18px 13px; flex-shrink: 0; }
.cp-type-tag   { font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 3px; }
.cp-dx-title   { font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; color: #fff; line-height: 1.2; }
.cp-content    { padding: 14px 16px 0; }
.lbl           { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--teal); margin-bottom: 5px; }
.card          { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; margin-bottom: 11px; font-size: 13px; color: var(--txt); line-height: 1.65; border-left: 3px solid var(--teal); }
.card.gold     { border-left-color: var(--gold); }
.card.grn      { border-left-color: #059669; background: var(--mint); }
.iv-block      { background: var(--white); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.iv-hd         { background: var(--navy); color: #fff; font-size: 10px; font-weight: 600; padding: 6px 12px; display: flex; align-items: center; gap: 5px; }
.iv-hd span    { opacity: .5; font-weight: 400; }
.iv-body       { padding: 10px 12px; font-size: 13px; color: var(--txt); line-height: 1.5; border-bottom: 1px solid var(--border); }
.iv-rat        { padding: 10px 12px; font-size: 12px; color: var(--sub); line-height: 1.5; font-style: italic; background: var(--bg); }
.tip-card      { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px; padding: 10px 13px; font-size: 13px; color: #92600A; line-height: 1.65; margin-bottom: 12px; }
.tip-card strong { display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 3px; }

/* ── FREE TIER NOTICE ── */
.nr-tier-notice { background: var(--sky); border-top: 1px solid var(--border); padding: 8px 14px; font-size: 12px; color: var(--sub); text-align: center; flex-shrink: 0; }
.nr-tier-notice a { color: var(--teal); font-weight: 600; }
