:root {
  --canvas-opacity: 1;
}

* {
  margin: 0;
  padding: 0;
  touch-action: none;
}

body {
  overflow: hidden;
  font-family: "Roboto", sans-serif;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

canvas {
  opacity: var(--canvas-opacity);
}

button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.hidden {
  display: none !important;
}

.spacer {
  flex-grow: 1;
}

#ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ui * {
  pointer-events: auto;
}

/* poster */
#poster {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--poster-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* loadingWrap */
#loadingWrap {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translate(-50%, 0);
  width: 380px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
#loadingWrap > #loadingText {
  font-size: 18px;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
#loadingWrap > #loadingBar {
  width: 100%;
  height: 10px;
  margin-top: 8px;
  border-radius: 4px;
  overflow: hidden;
}

/* controlsWrap */
#controlsWrap {
  display: none !important;
}
#controlsWrap.faded-in {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}
#controlsWrap.faded-out {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.5s, opacity 0.5s ease-out;
}
#controlsWrap > #timelineContainer {
  height: 30px;
  cursor: pointer;
}
#controlsWrap > #timelineContainer > #line {
  width: 100%;
  height: 50%;
  border-bottom: 4px solid #d9d9d9;
}
#controlsWrap > #timelineContainer > #handle {
  position: absolute;
  top: 16.5px;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 2px solid #d9d9d9;
  border-radius: 50%;
  background-color: #FFAF50;
}
#controlsWrap > #timelineContainer > #time {
  position: absolute;
  top: 0;
  padding: 2px 4px;
  transform: translate(-50%, -100%);
  font-size: 12px;
  border-radius: 4px;
  color: #fff;
  background-color: rgba(40, 40, 40, 0.5);
}
#controlsWrap > #buttonsContainer {
  display: flex;
  gap: 8px;
  /* controlButton */
}
#controlsWrap > #buttonsContainer .controlButton {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  cursor: pointer;
  color: #E0DCDD;
  background-color: transparent;
}
#controlsWrap > #buttonsContainer .controlButton:hover {
  color: #fff;
}
#controlsWrap > #buttonsContainer .controlButton {
  /* icon styling */
}
#controlsWrap > #buttonsContainer .controlButton > svg {
  display: block;
  margin: auto;
}
#controlsWrap > #buttonsContainer .controlButton > svg > g.stroke {
  fill: none;
  stroke: black;
  stroke-width: 2;
  stroke-linejoin: round;
  opacity: 0.4;
}
#controlsWrap > #buttonsContainer .controlButton > svg > g.fill {
  fill: currentColor;
  stroke: none;
}
#controlsWrap > #buttonsContainer .controlButton {
  /* camera toggle styling */
}
#controlsWrap > #buttonsContainer .controlButton.toggle {
  background: linear-gradient(90deg, transparent 0%, transparent 50%, #F60 50%, #F60 100%);
  background-size: 200% 100%;
  background-position: 100% 0%;
  background-repeat: no-repeat;
  transition: background-position 0.1s ease-in-out;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.left {
  margin-right: -4px;
  border-radius: 4px 0px 0px 4px;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.left:not(.active) {
  background-position: 0% 0%;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.right {
  margin-left: -4px;
  margin-right: 20px;
  border-radius: 0px 4px 4px 0px;
}
#controlsWrap > #buttonsContainer .controlButton.toggle.right:not(.active) {
  background-position: 200% 0%;
}

/* settingsPanel */
#settingsPanel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 14px;
  color: #E0DCDD;
  background-color: #333;
}
#settingsPanel > .settingsRow {
  display: flex;
  gap: 4px;
  width: 100%;
}
#settingsPanel > .settingsRow > button {
  flex-grow: 1;
  padding: 10px 20px;
  border: 0;
  cursor: pointer;
  color: #E0DCDD;
  background-color: #141414;
}
#settingsPanel > .settingsRow > button:hover {
  color: #fff;
}
#settingsPanel > .settingsRow > div {
  padding: 8px;
  cursor: pointer;
  color: #AAA;
}
#settingsPanel > .settingsRow > div.checkMark {
  width: 16px;
}
#settingsPanel > .settingsRow > div.checkMark:not(.active) {
  color: #333;
}
#settingsPanel > .settingsRow > div:hover {
  color: #E0DCDD;
}
#settingsPanel > .divider {
  width: 100%;
  height: 1px;
  margin: 8px 0;
  background-color: #666;
}

/* infoPanel */
#infoPanel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}
#infoPanel > #infoPanelContent {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translate(-50%, 0);
  min-height: 280px;
  min-width: 320px;
  padding: 8px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  color: #E0DCDD;
  background-color: rgba(51, 51, 51, 0.8);
}
#infoPanel > #infoPanelContent > #tabs {
  display: flex;
  gap: 16px;
  padding: 8px;
  border-radius: 22px;
  background-color: #282828;
}
#infoPanel > #infoPanelContent > #tabs > .tab {
  padding: 8px;
  border-radius: 16px;
  cursor: pointer;
  flex-grow: 1;
  text-align: right;
  font-weight: bold;
  font-size: 20px;
  color: #E0DCDD;
  transition: background-color 250ms ease;
}
#infoPanel > #infoPanelContent > #tabs > .tab:hover {
  background-color: #444;
}
#infoPanel > #infoPanelContent > #tabs > .tab.active {
  background-color: #444;
}
#infoPanel > #infoPanelContent > #infoPanels {
  padding: 16px;
}
#infoPanel > #infoPanelContent > #infoPanels h1 {
  font-size: 14px;
  font-weight: bold;
  padding: 0 0 6px 0;
  color: #fff;
}
#infoPanel > #infoPanelContent > #infoPanels .control-item {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  line-height: 1.5;
}
#infoPanel > #infoPanelContent > #infoPanels .control-item > .control-action {
  text-align: left;
}
#infoPanel > #infoPanelContent > #infoPanels .control-item > .control-key {
  text-align: right;
}
#infoPanel > #infoPanelContent > #infoPanels .control-spacer {
  border-bottom: 1px dashed #666;
  margin: 10px 0;
}

#joystickBase {
  position: absolute;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  touch-action: none;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 50%, black 100%);
  background-color: rgba(0, 0, 0, 0.1333333333);
}
#joystickBase > #joystick {
  position: absolute;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  touch-action: none;
  background-color: rgba(255, 255, 255, 0.5333333333);
}

#tooltip {
  display: none;
  position: absolute;
  border-radius: 4px;
  padding: 4px 4px;
  font-size: 14px;
  color: #E0DCDD;
  /*background-color: #282828;*/
}

#annotations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#annotations * {
  pointer-events: auto;
}
.annotation-content {
    max-width: 800px;
}

.annotation-image {
    width: 100%;
    height: auto;
    margin-bottom: 8px;
    border-radius: 4px;
}
#annotation-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 25%;
    height: 100vh;
    background: rgba(49, 49, 49, 0.259);
    color: white;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 10;
    backdrop-filter: blur(2px);
    font-size: 18px;
  

    transform: translateX(100%);
    transition: transform 0.3s ease;
}

#annotation-panel.visible {
    transform: translateX(0);
}

.annotation-panel-title {
    margin: 0 0 12px 0;
    font-size: 24px;
}

.annotation-panel-body img.annotation-image {
    width: 100%;
    height: auto;
    margin-bottom: 4px;
    border-radius: 4px;
}
.annotation-panel-branding { /* Bildunterschrift-Stil */
    font-size: 10px;        /* Größe anpassen */
    color: #888888;         /* dezente graue Farbe */
    margin-bottom: 10px; 
    margin-top: 0px;       /* Abstand zum Bild */
    line-height: 1.2;       /* Zeilenhöhe */
    font-style: normal;     /* z.B. kursiv, wenn du willst: italic */
    text-align: left;     /* optional zentriert */
}
#branding {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 10;

    /*background: rgba(0, 0, 0, 0.6);*/
    color: rgb(0, 0, 0);
    padding: 8px 8px;
    border-radius: 4px;

    font-size: 13px;
    font-family: inherit;

    pointer-events: none;
}

#branding a {
    pointer-events: auto;
    cursor: pointer;
}

.branding-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px; /* Abstand zwischen den Zeilen */
}

.branding-content:last-child {
    margin-bottom: 0; /* Kein Abstand bei letzter Zeile */
}

/* Kleine Logos (erste Zeile) */
.branding-row-small img {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

/* Große Logos (zweite Zeile) */
.branding-row-large img {
    height: 60px; /* 3x 30px */
    width: auto;
    vertical-align: middle;
}
#hotspot-list {
    position: fixed;
    top: 350px;
    left: 16px;
    transform: translateY(-50%);
    z-index: 10;

    display: flex;
    flex-direction: column;
    gap: 4px;

    background: rgba(49, 49, 49, 0);
    backdrop-filter: blur(2px);
    padding: 10px;
    border-radius: 8px;

    max-height: 70vh;
    overflow-y: auto;
}
.hotspot-list-item {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 6px 10px;
    border-radius: 6px;

    cursor: pointer;
    user-select: none;

    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.hotspot-list-icon {
    width: 22px;
    height: 22px;
    border-radius: 60%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 600;

    /* Farben über Variablen steuerbar */
    --icon-bg: rgba(255, 255, 255, 0.15);
    --icon-text: white;
    --icon-border: rgba(255, 255, 255, 0.3);

    background-color: var(--icon-bg);
    color: var(--icon-text);
    border: 1px solid var(--icon-border);

    flex-shrink: 0;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

/* Hover über Listeneintrag */
.hotspot-list-item:hover {
  background: rgba(255, 255, 255, 0.12);
}
.hotspot-list-icon {
    --icon-bg: rgba(255, 255, 255, 0.12);
}
.hotspot-list-item.active {
    background: rgba(255, 255, 255, 0.28);
    color: white;}
/* Aktiver Listeneintrag */
.hotspot-list-item.active .hotspot-list-icon {
    --icon-bg: rgb(0, 0, 0);   /* gleiche Farbe wie 3D-Hotspot */
    --icon-text: rgb(255, 102,0);
    --icon-border: rgb(255, 102, 0); /* dünne Umrandung passend zum Hotspot */
}
#viewer-title {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 15;

    background: rgba(49, 49, 49, 0);
    backdrop-filter: blur(2px);

    padding: 10px 14px;
    border-radius: 8px;

    color: white;
    pointer-events: none;
}

.viewer-title-main {
    font-size: 28px;
    font-weight: 800;
    line-height: 2;
    color: rgba(255, 255, 255, 0.745);
    margin-left: 8px;
}

.viewer-title-sub {
    font-size:20px;
    opacity: 0.8;
    margin-top: 8px;
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.474);
}
#viewer-root {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#viewer-root pc-app {
    position: absolute;
    inset: 0;
}

#vignette-blur {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    /* Scharfe Mitte, unscharfe Ränder */
    mask-image: radial-gradient(
        ellipse 100% 80% at 40% 50%,
        rgba(0,0,0,0) 45%,
        rgba(0,0,0,0.6) 60%,
        rgba(0,0,0,1) 85%
    );
    -webkit-mask-image: radial-gradient(
        ellipse 100% 80% at 40% 50%,
        rgba(0,0,0,0) 45%,
        rgba(0,0,0,0.6) 60%,
        rgba(0,0,0,1) 85%
    );
}
#vignette-blur {
    pointer-events: none;
}
