/* HPT card view specific styles */

/* Search bar */
.hpt-search { background: white; border-bottom: 1px solid var(--hpt-border); padding: 0.6rem 0; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.sw { position: relative; max-width: 480px; }
.sw .si { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--hpt-muted); pointer-events: none; font-size: 0.85rem; }
#searchInput { padding-left: 2.2rem; border: 1.5px solid var(--hpt-border); border-radius: 6px; font-size: 0.88rem; height: 2.3rem; }
#searchInput:focus { border-color: var(--bs-success); box-shadow: 0 0 0 3px rgba(25,135,84,0.15); outline: none; }
.rcount { font-size: 0.8rem; color: var(--hpt-muted); white-space: nowrap; }

/* View toggle button */
.btn-tableview { background: white; color: var(--bs-success); border: none; font-weight: 600; font-size: 0.82rem; padding: 0.4rem 1rem; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.btn-tableview:hover { background: var(--hpt-gold-light); color: var(--hpt-gold); }

/* Intro blurb */
.hpt-intro { border-left: 4px solid var(--bs-success); background: white; border-radius: 0 6px 6px 0; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; color: #444; }

/* Ingredient list */
.ing-list { display: flex; flex-direction: column; }
.ing-btn { background: white; border: 1px solid var(--hpt-border); border-radius: 0; padding: 0.5rem 0.9rem; text-align: left; font-size: 0.875rem; font-weight: 500; color: var(--bs-success); cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-bottom: none; transition: background 0.1s; }
.ing-btn:first-child { border-radius: 6px 6px 0 0; }
.ing-btn:last-child  { border-radius: 0 0 6px 6px; border-bottom: 1px solid var(--hpt-border); }
.ing-btn:only-child  { border-radius: 6px; border-bottom: 1px solid var(--hpt-border); }
.ing-btn:hover  { background: #e8f5e9; }
.ing-btn.active { background: var(--bs-success); color: white; border-color: var(--bs-success); }
.cas-b { font-family: monospace; font-size: 0.67rem; color: var(--hpt-muted); background: var(--hpt-bg); padding: 0.1rem 0.35rem; border-radius: 3px; }
.ing-btn.active .cas-b { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }
.ing-alias { display: block; font-size: 0.68rem; font-weight: 400; color: var(--hpt-muted); font-style: italic; }
.ing-btn.active .ing-alias { color: rgba(255,255,255,0.75); }

/* Detail panel */
#detailPanel { background: white; border: 1px solid var(--hpt-border); border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); min-height: 260px; }
.det-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem; color: var(--hpt-muted); text-align: center; }
.det-placeholder svg { opacity: 0.3; margin-bottom: 0.6rem; }
.det-header { background: var(--bs-success); color: white; padding: 0.8rem 1rem 0.75rem; border-radius: 6px 6px 0 0; }
.det-header h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.2rem; text-transform: capitalize; }
.mbadge { font-family: monospace; font-size: 0.67rem; background: rgba(255,255,255,0.2); border-radius: 3px; padding: 0.1rem 0.45rem; display: inline-block; }
.det-body { padding: 0.9rem 1rem; }

/* Property cards */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px,1fr)); gap: 0.45rem; }
.pcard { background: var(--hpt-bg); border: 1px solid var(--hpt-border); border-radius: 5px; padding: 0.5rem 0.65rem; position: relative; }
.plabel { font-size: 0.67rem; color: var(--hpt-muted); font-weight: 500; margin-bottom: 0.12rem; }
.pval { font-family: monospace; font-size: 0.93rem; font-weight: 600; color: #1a1a1a; }
.pval.multi { border-bottom: 2px dashed var(--hpt-gold); cursor: pointer; display: inline-block; }
.punit { font-size: 0.67rem; color: var(--hpt-muted); margin-top: 0.08rem; }
.nbadge { position: absolute; top: 0.28rem; right: 0.38rem; background: var(--hpt-gold); color: white; font-size: 0.57rem; font-weight: 700; padding: 0.06rem 0.28rem; border-radius: 2px; }

/* Data tables (in detail panel) */
.dtw { overflow-x: auto; }
.dt { width: 100%; font-size: 0.79rem; border-collapse: separate; border-spacing: 0; }
.dt th { background: #e8f5e9; color: var(--bs-success); font-weight: 700; padding: 0.32rem 0.55rem; border-bottom: 2px solid var(--hpt-border); white-space: nowrap; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.dt td { padding: 0.3rem 0.55rem; border-bottom: 1px solid #f0f4f0; vertical-align: middle; }
.dt td.lc { font-weight: 600; color: #444; white-space: nowrap; }
.dt td.mn { font-family: monospace; }
.dt tr:last-child td { border-bottom: none; }
.dt tr:hover td { background: #f1f8f1; }

/* Popover - card view uses absolute positioning */
.hpopover { position: absolute; min-width: 225px; max-width: 305px; }
.pop-val { font-family: monospace; font-weight: 600; min-width: 68px; flex-shrink: 0; font-size: 0.8rem; }

/* Interpretation section */
.interp-block { display: flex; align-items: flex-start; gap: 0.75rem; background: var(--hpt-bg); border: 1px solid var(--hpt-border); border-radius: 5px; padding: 0.6rem 0.75rem; margin-bottom: 0.5rem; }
.interp-block img { width: 72px; height: 72px; flex-shrink: 0; border-radius: 3px; border: 2px solid darkgray; }
.interp-text { font-size: 0.84rem; line-height: 1.45; }
.interp-text h4 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--bs-success); margin-bottom: 0.25rem; }
.interp-text h4 a { color: var(--bs-success); text-decoration: underline dotted; }
.interp-text h4 a:hover { text-decoration-style: solid; }
/* GIF background colors by soil type */
img.gif-water   { background-color: lightskyblue; }
img.gif-vapor   { background-color: lightsteelblue; }
img.gif-clay    { background-color: #993300; }
img.gif-silt    { background-color: #cc9900; }
img.gif-sandy   { background-color: #cccc00; }
img.gif-unknown { background-color: white; }
img.gif-other   { background-color: darkgray; }
.gus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap: 0.45rem; margin-top: 0.4rem; }
.gus-cell { background: var(--hpt-bg); border: 1px solid var(--hpt-border); border-radius: 5px; padding: 0.45rem 0.6rem; text-align: center; font-size: 0.79rem; }
.gus-cell img { width: 62px; height: 62px; margin-bottom: 0.25rem; display: block; margin-left: auto; margin-right: auto; border: 2px solid darkgray; }
.gus-cell .gc-soil { font-weight: 700; font-size: 0.72rem; color: var(--bs-success); margin-bottom: 0.2rem; }
.gus-cell .gc-verdict { line-height: 1.35; }
.gus-blurb { font-size: 0.8rem; color: #444; background: var(--hpt-bg); border: 1px solid var(--hpt-border); border-radius: 5px; padding: 0.5rem 0.75rem; margin-bottom: 0.45rem; line-height: 1.5; }
.nodata-blurb { font-size: 0.85rem; background: #fff8e1; border: 1px solid #ffe082; border-radius: 5px; padding: 0.75rem 1rem; color: #5d4037; }

/* Card view GUS bar is slightly wider */
.gw { gap: 0.35rem; }
.gbg { width: 46px; flex-shrink: 0; }

@media (max-width: 767px) {
  .hpt-subheader h1 { font-size: 1.15rem; }
  #detailPanel { margin-top: 0.75rem; }
  .pcards { grid-template-columns: 1fr 1fr; }
}
