/* ── Discovery Popup Modal ───────────────────────────────────────────────── */

.dp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dp-overlay.open { display: flex; }

.dp-modal {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.8);
  animation: dp-slide-in .22s ease;
}
@keyframes dp-slide-in {
  from { opacity:0; transform:translateY(24px) scale(.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

/* ── Header ── */
.dp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #21262d;
}
.dp-boss-emoji { font-size: 2rem; line-height: 1; }
.dp-header-text { flex: 1; }
.dp-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e6edf3;
  margin: 0 0 2px;
}
.dp-header-sub { font-size: .82rem; color: #8b949e; }
.dp-close {
  width: 32px; height: 32px;
  border: none; background: rgba(255,255,255,.06);
  border-radius: 8px; color: #8b949e;
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.dp-close:hover { background: rgba(255,255,255,.12); color: #e6edf3; }

/* ── Status badge ── */
.dp-status {
  padding: 3px 10px; border-radius: 100px;
  font-size: .73rem; font-weight: 700;
}
.dp-status.won  { background: rgba(63,185,80,.15); color: #3fb950; border: 1px solid rgba(63,185,80,.3); }
.dp-status.lost { background: rgba(248,81,73,.15);  color: #f85149; border: 1px solid rgba(248,81,73,.3); }
.dp-status.abandoned { background: rgba(139,148,158,.12); color: #8b949e; border: 1px solid rgba(139,148,158,.3); }

/* ── Two-panel visualisation row ── */
.dp-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #21262d;
}
@media (max-width: 620px) { .dp-panels { grid-template-columns: 1fr; } }

.dp-panel {
  padding: 20px 20px 16px;
}
.dp-panel:first-child { border-right: 1px solid #21262d; }

.dp-panel-label {
  font-size: .78rem;
  font-weight: 700;
  color: #58a6ff;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Molecule canvas */
#dp-mol-canvas {
  display: block;
  width: 100%;
  max-width: 340px;
  height: 280px;
  margin: 0 auto;
  border-radius: 8px;
  background: #0a0f1a;
  border: 1px solid #21262d;
}

/* Protein canvas */
#dp-protein-canvas {
  display: block;
  width: 100%;
  max-width: 340px;
  height: 280px;
  margin: 0 auto;
  border-radius: 8px;
  background: #0a0f1a;
  border: 1px solid #21262d;
}
.dp-protein-loading {
  width: 100%;
  max-width: 340px;
  height: 280px;
  margin: 0 auto;
  border-radius: 8px;
  background: #0a0f1a;
  border: 1px solid #21262d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #484f58;
  font-size: .82rem;
  gap: 8px;
}
.dp-protein-hint {
  font-size: .72rem; color: #484f58; text-align: center; margin-top: 6px;
}

/* ── Properties grid ── */
.dp-props {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #21262d;
}
.dp-props-title {
  font-size: .78rem; font-weight: 700; color: #8b949e;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 14px;
}
.dp-props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.dp-prop-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s;
}
.dp-prop-card:hover { border-color: #30363d; }
.dp-prop-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 2px;
}
.dp-prop-name {
  font-size: .72rem;
  font-weight: 600;
  color: #58a6ff;
  margin-bottom: 2px;
}
.dp-prop-desc {
  font-size: .68rem;
  color: #8b949e;
  line-height: 1.35;
}
.dp-prop-card.good .dp-prop-value { color: #3fb950; }
.dp-prop-card.warn .dp-prop-value { color: #d29922; }
.dp-prop-card.bad  .dp-prop-value { color: #f85149; }

/* Lipinski pass/fail */
.dp-lipinski-pass {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
}
.dp-lipinski-pass.pass { background: rgba(63,185,80,.15); color: #3fb950; border: 1px solid rgba(63,185,80,.3); }
.dp-lipinski-pass.fail { background: rgba(248,81,73,.12);  color: #f85149; border: 1px solid rgba(248,81,73,.3); }

/* ── Educational footer ── */
.dp-edu {
  padding: 16px 24px 20px;
  background: rgba(88,166,255,.03);
}
.dp-edu-title {
  font-size: .78rem; font-weight: 700; color: #8b949e;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}
.dp-edu-text {
  font-size: .82rem;
  color: #8b949e;
  line-height: 1.6;
}
.dp-edu-text strong { color: #c9d1d9; }

/* ── Footer actions ── */
.dp-footer {
  padding: 14px 24px;
  border-top: 1px solid #21262d;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.dp-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.dp-btn:hover { opacity: .85; }
.dp-btn-primary {
  background: linear-gradient(135deg, #58a6ff, #7c3aed);
  color: #fff;
}
.dp-btn-secondary {
  background: rgba(255,255,255,.07);
  color: #c9d1d9;
  border: 1px solid #30363d;
}

/* ── Expand button ── */
.dp-expand-btn {
  padding: 4px 10px;
  background: rgba(255,255,255,.06);
  border: none;
  border-radius: 6px;
  color: #8b949e;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.dp-expand-btn:hover {
  background: rgba(255,255,255,.12);
  color: #e6edf3;
}

/* ── Fullscreen Molecule Viewer ── */
.mol-fs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a0f1a;
  z-index: 9999;
  flex-direction: column;
}
.mol-fs-overlay.open { display: flex; }

.mol-fs-header {
  padding: 20px 24px;
  border-bottom: 1px solid #21262d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d1117;
}
.mol-fs-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e6edf3;
}
.mol-fs-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  color: #8b949e;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mol-fs-close:hover {
  background: rgba(255,255,255,.12);
  color: #e6edf3;
}

.mol-fs-body {
  display: flex;
  flex: 1;
  gap: 0;
  overflow: hidden;
}

#mol-fs-viewer {
  flex: 0 0 65%;
  height: 100%;
  background: #0a0f1a;
  border-right: 1px solid #21262d;
}

#mol-fs-edu {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  color: #e6edf3;
}

#mol-fs-edu h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #58a6ff;
  font-weight: 700;
}

#mol-fs-edu table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
}

#mol-fs-edu th,
#mol-fs-edu td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #21262d;
}

#mol-fs-edu th {
  background: #161b22;
  color: #8b949e;
  font-weight: 600;
}

#mol-fs-edu tr:hover {
  background: rgba(88,166,255,.05);
}

#mol-fs-edu p {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #21262d;
  color: #8b949e;
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Responsive fullscreen */
@media (max-width: 800px) {
  .mol-fs-body { flex-direction: column; }
  #mol-fs-viewer { flex: 0 0 auto; border-right: none; border-bottom: 1px solid #21262d; min-height: 300px; }
  #mol-fs-edu { flex: 1; }
}

/* Molecule viewer container styles */
#dp-mol-3d {
  background: #0a0f1a;
  border: 1px solid #21262d;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

#dp-mol-3d > canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}
