#container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#viewer {
  position: relative;
  flex: 1;
  cursor: grab;
  overflow: hidden;
}

#viewer.dragging {
  cursor: grabbing;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
}

#polygonOverlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}

#benefitLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#benefitLayer .benefit-marker {
  pointer-events: auto;
}

#controls {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  z-index: 50;
}

.nav-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  padding: 8px;
  border-radius: 40px;
}

.control-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #000;
  color: white;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.control-btn:hover {
  background: #222;
  transform: scale(1.05);
}

.control-btn:active,
.control-btn:focus {
  background: #000;
}

.control-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.control-btn:disabled:hover {
  background: #000;
  transform: none;
}

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.angle-display {
  font-family: var(--font-family);
  min-width: 60px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #000;
  padding: 0 8px;
}



.benefit-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border-radius: 24px;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.3s, z-index 0s;
  transform-origin: bottom center;
  z-index: 10;
  overflow: visible;
}

.benefit-marker:hover {
  z-index: 10000;
}

.view-section {
  margin-bottom: 40px;
}

.view-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
}

.modal-footer-form {
  border-radius: 20px;
  padding: 32px;
  width: 40%;
  margin-left: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  #viewer {
    cursor: move;
  }

  #viewer.dragging {
    cursor: move;
  }

  #controls {
    padding: 8px 16px;
    gap: 8px;
  }

  .control-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  #tooltip.show {
    pointer-events: auto;
    cursor: pointer;
  }

  .view-image {
    height: 200px;
  }

  .modal-footer-form {
    margin-left: 0;
    width: 100%;
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  .modal-footer-form .footer-form-title {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .modal-footer-form .form-group input {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 10px;
  }

  .modal-footer-form .submit-btn {
    padding: 14px;
    font-size: 15px;
    margin-top: 12px;
    border-radius: 10px;
  }

  .benefit-marker-compact {
    padding: 7px;
    gap: 0;
  }

  .benefit-marker:hover .benefit-marker-compact {
    padding-right: 12px;
  }

  .benefit-marker-label {
    font-size: 11px;
    text-overflow: ellipsis;
  }

  .benefit-marker:hover .benefit-marker-label {
    max-width: 150px;
    margin-left: 6px;
  }

  .benefit-marker-icon {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
}

.touch-device #viewer {
  cursor: move;
}

.touch-device #viewer.dragging {
  cursor: move;
}

.touch-device #tooltip.show {
  pointer-events: auto;
  cursor: pointer;
}

