/* =============================================================
   Puzzle-STAMPS  –  site-wide custom styles
   ============================================================= */

/* --- Navbar dropdown ---------------------------------------- */
@media (min-width: 992px) {
  .navbar .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}

.navbar .dropdown-menu {
  border-radius: 0;
  border-top: 2px solid #343a40;
  border-left: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
  border-bottom: 1px solid #dee2e6;
  min-width: 200px;
  padding: 0.25rem 0;
  box-shadow: 0 4px 8px rgba(0,0,0,.08);
}

.navbar .dropdown-item {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: #495057;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: #f8f9fa;
  color: #343a40;
}

.navbar .dropdown-item.active-page {
  background-color: #343a40;
  color: #fff;
}

/* Indent sub-items in mobile slideout menu */
.mobile-sub-item a {
  padding-left: 2rem !important;
  font-size: 0.92em;
  color: #555;
}

/* --- Download bar ------------------------------------------- */
.download-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem 1.25rem;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
}

.download-btn {
  display: inline-block;
  background: #f8f9fa;
  color: #fff !important;
  padding: 0.45rem 1.1rem;
  border-radius: 0.25rem;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.download-btn:hover {
  background: #23272b;
  color: #fff !important;
}

.download-note {
  font-size: 0.85rem;
  color: #6c757d;
}

/* --- Sensor table ------------------------------------------- */
.sensor-table th { background-color: #f8f9fa; }

/* --- Dataset sub-pages -------------------------------------- */
.page-header-sub {
  color: #6c757d;
  text-align: center;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.75rem;
}

/* When two sub-navs are stacked, remove the separator from the first */
.sub-nav:has(+ .sub-nav) {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.3rem;
}

/* Secondary sub-nav (e.g. protocol phases) — muted grey scheme */
.sub-nav + .sub-nav a,
.sub-nav + .sub-nav a:link,
.sub-nav + .sub-nav a:visited {
  background: #fff;
  color: #6c757d !important;
  border-color: #adb5bd;
  font-size: 0.83rem;
}

.sub-nav + .sub-nav a:hover,
.sub-nav + .sub-nav a:focus {
  background: #f8f9fa;
  color: #495057 !important;
  border-color: #6c757d;
}

.sub-nav + .sub-nav a.active-page,
.sub-nav + .sub-nav a.active-page:link,
.sub-nav + .sub-nav a.active-page:visited {
  background: #6c757d;
  color: #fff !important;
  border-color: #6c757d;
}

.sub-nav + .sub-nav a.active-page:hover,
.sub-nav + .sub-nav a.active-page:focus {
  background: #5a6268;
  color: #fff !important;
  border-color: #5a6268;
}

.sub-nav a,
.sub-nav a:link,
.sub-nav a:visited {
  padding: 0.35rem 0.85rem;
  border-radius: 0.25rem;
  font-size: 0.88rem;
  color: #343a40 !important;
  text-decoration: none !important;
  background: #fff;
  border: 1px solid #343a40;
  transition: background 0.15s, color 0.15s;
}

.sub-nav a:hover,
.sub-nav a:focus {
  background: #f8f9fa;
  color: #343a40 !important;
  border-color: #343a40;
}

.sub-nav a.active-page,
.sub-nav a.active-page:link,
.sub-nav a.active-page:visited {
  background: #343a40;
  color: #fff !important;
  border-color: #343a40;
}

.sub-nav a.active-page:hover,
.sub-nav a.active-page:focus {
  background: #23272b;
  color: #fff !important;
  border-color: #23272b;
}

/* --- Issue tables ------------------------------------------- */
.issue-table th {
  background-color: #f8f9fa;
}

.badge-resolved {
  background-color: #28a745;
  color: #fff;
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
  font-size: 0.82em;
  white-space: nowrap;
}

.badge-unresolved {
  background-color: #dc3545;
  color: #fff;
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
  font-size: 0.82em;
  white-space: nowrap;
}

.badge-partial {
  background-color: #fd7e14;
  color: #fff;
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
  font-size: 0.82em;
  white-space: nowrap;
}

.badge-documented {
  background-color: #6c757d;
  color: #fff;
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
  font-size: 0.82em;
  white-space: nowrap;
}

/* --- Puzzle cards ------------------------------------------- */
.puzzle-card {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
}

.puzzle-card .puzzle-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.puzzle-card .hint-list {
  padding-left: 1.2rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.puzzle-card .segment-badge {
  font-size: 0.78em;
  background-color: #e9ecef;
  color: #495057;
  padding: 0.15em 0.55em;
  border-radius: 0.25rem;
  margin-right: 0.4rem;
}

/* --- Floor plan placeholder --------------------------------- */
.floor-plan-placeholder {
  border: 2px dashed #ced4da;
  border-radius: 0.375rem;
  padding: 3rem;
  text-align: center;
  color: #6c757d;
  background-color: #f8f9fa;
  margin: 1.5rem 0;
}

/* --- Consent table ----------------------------------------- */
.consent-table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #dee2e6; /* Ensures the outer boundary is consistent */
}

/* Base styling for all cells */
.consent-table th, 
.consent-table td {
    padding: 0.3rem 0.5rem;
    font-size: 0.88rem;
    vertical-align: middle;
    text-align: center;
    border: 1px solid #dee2e6; /* Standardizes all grid lines */
}

/* Header Specifics */
.consent-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Border for the start of a new recording group */
.consent-table tbody tr.rec-start {
    border-top: 2px solid #dee2e6;
}

/* HANDLING THE COLUMN SHIFT */
/* First row of a group: Participant is col 2, Role is col 3 */
.consent-table tr.rec-start td:nth-child(2),
.consent-table tr.rec-start td:nth-child(3) {
    text-align: center;
}

/* Subsequent rows: Participant is col 1, Role is col 2 */
.consent-table tr:not(.rec-start) td:nth-child(1),
.consent-table tr:not(.rec-start) td:nth-child(2) {
    text-align: center;
}

/* Status Colors (Yes/No) */
.consent-yes {
    background-color: #28a745;
    color: #fff;
    font-size: 0.82em;
    font-weight: bold;
}

.consent-no {
    background-color: #dc3545;
    color: #fff;
    font-size: 0.82em;
    font-weight: bold;
}

/* --- Recording Header (The Spanned Cell) ------------------- */
.consent-table td[rowspan] {
    background-color: #f8f9fa;
    font-weight: bold;
    /* Thick black border removed from here */
    border-left: 1px solid #dee2e6; 
}

/* --- Standalone Highlight Box (Keep this for external notes) - */
.consent-highlight {
    border-left: 4px solid #343a40;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    margin: 1rem 0;
}