/* ==========================================================================
   [tattl] · 3D Medialandschap Stylesheet
   ========================================================================== */

body.page-medialandschap {
  margin: 0;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-dark-bg, #090d16);
  color: #f0f6fc;
}

body.page-medialandschap .site-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  margin: 0;
}

.medialandschap-wrapper {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #090d16;
}

#canvas-container {
  position: absolute;
  /* Contain the depth-based z-index values assigned by CSS2DRenderer. */
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Linker bedieningspaneel */
#ui-sidebar {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 320px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  background: rgba(16, 23, 38, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #26334d;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

#ui-sidebar h1 {
  font-size: 17px;
  margin: 0 0 4px 0;
  font-weight: 800;
  color: #f0f6fc;
  letter-spacing: -0.01em;
}

#ui-sidebar .subtitle {
  font-size: 12px;
  color: #8b949e;
  margin: 0 0 14px 0;
  line-height: 1.45;
}

#ui-sidebar .section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8b949e;
  margin: 14px 0 6px 0;
  font-weight: 700;
}

.btn-row {
  display: flex;
  background: #0d131f;
  border: 1px solid #202b3f;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 6px;
}

#ui-sidebar button {
  flex: 1;
  padding: 5px 8px;
  background: transparent;
  color: #8b949e;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
  text-align: center;
}

#ui-sidebar button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f0f6fc;
}

#ui-sidebar button.active {
  background: #2f81f7;
  color: #ffffff;
  border-color: #58a6ff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

#ui-sidebar button.reset-btn {
  width: 100%;
  margin-top: 8px;
  background: #21262d;
  border-color: #3b4e75;
  color: #f0f6fc;
}

#ui-sidebar button.reset-btn:hover {
  background: #30363d;
  border-color: #8b949e;
}

#ui-sidebar input[type="search"],
#ui-sidebar select {
  width: 100%;
  padding: 8px 10px;
  background: #0d131f;
  border: 1px solid #26334d;
  color: #f0f6fc;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 6px;
  outline: none;
  font-family: inherit;
}

.region-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 10px;
  background: #0d131f;
  border: 1px solid #26334d;
  border-radius: 6px;
  padding: 7px 10px;
}

.region-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  color: #f0f6fc;
  flex: 1;
  user-select: none;
}

.region-filter-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #58a6ff;
  cursor: pointer;
  margin: 0;
}

#ui-sidebar input[type="search"]:focus,
#ui-sidebar select:focus {
  border-color: #2f81f7;
}

/* Legenda */
.legend-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  color: #f0f6fc;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.legend-left span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.count-pill {
  font-size: 10px;
  color: #8b949e;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Rechter detailkaart */
#detail-card {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 320px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  background: rgba(16, 23, 38, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #26334d;
  z-index: 20;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

#detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

#detail-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

#detail-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  padding-right: 28px;
}

.owner-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
}

.detail-grid {
  display: grid;
  grid-template-columns: 95px 1fr;
  row-gap: 6px;
  column-gap: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}

.detail-label {
  color: #8b949e;
  font-weight: 600;
}

.detail-website-link {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
  transition: color 0.15s ease;
}

.detail-website-link:hover {
  color: #79c0ff;
  text-decoration: underline;
}

.detail-desc {
  font-size: 12px;
  color: #c9d1d9;
  line-height: 1.5;
  margin-bottom: 12px;
}

.coord-bars {
  border-top: 1px solid #26334d;
  padding-top: 10px;
  margin-top: 8px;
  font-size: 11px;
}

.bar-row {
  margin-bottom: 8px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #8b949e;
  margin-bottom: 3px;
  font-size: 11px;
}

.bar-head span {
  flex: 1;
}

.bar-head span:first-child {
  text-align: left;
}

.bar-head span:last-child {
  text-align: right;
}

.bar-head strong {
  color: #f0f6fc;
  text-align: center;
  min-width: 36px;
}

.bar-track {
  height: 6px;
  background: #161f30;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bar-track::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-50%);
  z-index: 1;
}

.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  left: 50%;
  width: 0;
  background: #2f81f7;
  border-radius: 2px;
  transition: left 0.3s ease, width 0.3s ease;
}

/* HTML-aslabels boven de 3D-kaart */
.axis-tag {
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: rgba(16, 23, 38, 0.92);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
}

/* Actieknoppen in rechteronderhoek (Reset & Volledig scherm) */
.canvas-bottom-actions {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
}

.canvas-action-btn,
.fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(16, 23, 38, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f0f6fc;
  border: 1px solid #26334d;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: all 0.15s ease;
  font-family: inherit;
}

.canvas-action-btn:hover,
.fullscreen-btn:hover {
  background: #1f2d46;
  border-color: #58a6ff;
  color: #ffffff;
  transform: translateY(-1px);
}

.canvas-action-btn:active,
.fullscreen-btn:active {
  transform: translateY(0);
}

.canvas-action-btn:focus-visible,
.fullscreen-btn:focus-visible {
  outline: 2px solid #2f81f7;
  outline-offset: 2px;
}

.canvas-action-btn svg,
.fullscreen-btn svg {
  display: block;
  flex-shrink: 0;
}

.medialandschap-wrapper:fullscreen,
.medialandschap-wrapper:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background-color: #090d16;
}

@media (max-width: 860px) {
  #ui-sidebar {
    width: 270px;
    padding: 14px;
    font-size: 11px;
  }
  #detail-card {
    width: 270px;
    padding: 14px;
  }
}

@media (max-width: 640px) {
  #ui-sidebar {
    top: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 40vh;
  }
  #detail-card {
    top: auto;
    bottom: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 45vh;
  }
  .canvas-bottom-actions {
    bottom: 12px;
    right: 12px;
    gap: 6px;
  }
  .canvas-action-btn,
  .fullscreen-btn {
    width: 38px;
    height: 38px;
  }
}

#btn-motion .motion-play{display:none}#btn-motion[aria-pressed=false] .motion-play{display:block}#btn-motion[aria-pressed=false] .motion-pause{display:none}

.media-group-marker {
  display: flex;
  align-items: center;
  max-inline-size: min(15rem, 34vw);
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--group-color);
  border-radius: 0.6rem;
  background: #101923;
  color: #f0f6fc;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  pointer-events: auto;
}

.media-group-marker:focus-visible,
.legend-item:focus-visible {
  outline: 2px solid #f0f6fc;
  outline-offset: 2px;
}

.legend-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.legend-item[aria-pressed="true"] {
  border-color: #8b949e;
  background: rgba(255, 255, 255, 0.08);
}

#media-search-status {
  margin: 0.35rem 0;
  font-size: 0.75rem;
}

.media-group-marker[hidden] {
  display: none;
}
