* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  height: 100vh;
  overflow: hidden;
  background-color: #1a1a1a;
  color: #ffffff;
}

.dashboard {
  display: grid;
  grid-template-areas:
    "sidebar header"
    "sidebar viewer"
    "sidebar controls";
  grid-template-columns: 280px 1fr;
  grid-template-rows: 60px 1fr 80px;
  height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, #2d2d2d 0%, #1f1f1f 100%);
  border-right: 1px solid #3d3d3d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #3d3d3d;
  background: #333333;
}

.sidebar-logo {
  max-width: 100%;
  height: auto;
  max-height: 45px;
  margin-bottom: 8px;
  border-radius: 4px;
  display: block;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 5px;
}

.sidebar-subtitle {
  font-size: 12px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scene-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.scene-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.scene-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #4a9eff;
}

.scene-item.active {
  background: rgba(74, 158, 255, 0.2);
  border-left-color: #4a9eff;
}

.scene-icon {
  width: 32px;
  height: 32px;
  background: #4a9eff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 14px;
}

.scene-info {
  flex: 1;
}

.scene-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.scene-description {
  font-size: 12px;
  color: #888888;
}

/* Top Bar */
.header {
  grid-area: header;
  background: #2d2d2d;
  border-bottom: 1px solid #3d3d3d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  position: relative;
}

.current-scene {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.scene-counter {
  position: absolute;
  right: 20px;
  font-size: 12px;
  color: #888888;
  background: #3d3d3d;
  padding: 4px 8px;
  border-radius: 12px;
}

/* Main Viewer Area */
.viewer {
  grid-area: viewer;
  background: radial-gradient(circle at center, #2d2d2d 0%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.viewer-placeholder {
  width: 200px;
  height: 200px;
  border: 2px dashed #4a9eff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a9eff;
  font-size: 16px;
  opacity: 0.7;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.viewer-info {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  color: #cccccc;
}

/* Bottom Control Bar */
.controls {
  grid-area: controls;
  background: #2d2d2d;
  border-top: 1px solid #3d3d3d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 15px;
}

.control-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-button {
  width: 44px;
  height: 44px;
  background: #3d3d3d;
  border: 1px solid #4d4d4d;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  user-select: none;
}

.control-button:hover {
  background: #4a9eff;
  border-color: #4a9eff;
  transform: translateY(-1px);
}

.control-button:active {
  transform: translateY(0);
}

.control-separator {
  width: 1px;
  height: 30px;
  background: #4d4d4d;
  margin: 0 10px;
}

.control-label {
  font-size: 11px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 10px;
}

/* Marzipano Viewer Styles */
#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Hide the placeholder when Marzipano is loaded */
.marzipano-loaded .viewer-placeholder {
  display: none;
}

/* Loading states */
.loading .viewer-placeholder {
  border-color: #4a9eff;
  color: #4a9eff;
}

.error .viewer-placeholder {
  border-color: #ff4a4a;
  color: #ff4a4a;
  animation: none;
}

.error .viewer-placeholder::before {
  content: "⚠️ ";
}

/* Autorotate toggle button */
.autorotate-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #4d4d4d;
  border-radius: 6px;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.autorotate-toggle:hover {
  background: #4a9eff;
  border-color: #4a9eff;
}

.autorotate-toggle.active {
  background: #4a9eff;
  border-color: #4a9eff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard {
    grid-template-areas:
      "header"
      "viewer"
      "controls"
      "sidebar";
    grid-template-columns: 1fr;
    grid-template-rows: 60px 1fr auto 200px;
  }

  .sidebar {
    border-right: none;
    border-top: 1px solid #3d3d3d;
  }

  .scene-list {
    max-height: 140px;
  }

  .controls {
    flex-direction: row;
    gap: 8px;
    padding: 12px 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .control-label {
    display: none; /* Hide labels on mobile to save space */
  }

  .control-group {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .control-separator {
    display: block;
    width: 1px;
    height: 30px;
    background: #555555;
    margin: 0 4px;
    flex-shrink: 0;
  }

  .control-button {
    width: 44px;
    height: 44px;
    font-size: 14px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  /* Reset any ordering for single row layout */
  .controls > * {
    order: 0;
  }
}

@media (max-width: 480px) {
  .dashboard {
    grid-template-rows: 50px 1fr auto 180px;
  }

  .sidebar-header {
    padding: 12px 15px;
  }

  .sidebar-logo {
    max-height: 35px;
    margin-bottom: 6px;
  }

  .sidebar-title {
    font-size: 16px;
  }

  .current-scene {
    font-size: 16px;
  }

  .scene-item {
    padding: 10px 15px;
  }

  .scene-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .controls {
    padding: 10px 6px;
    gap: 6px;
  }

  .control-button {
    width: 42px;
    height: 42px;
    font-size: 13px;
  }

  .control-group {
    gap: 4px;
  }

  .control-separator {
    height: 28px;
    margin: 0 3px;
  }
}

/* Custom Scrollbar */
.scene-list::-webkit-scrollbar {
  width: 6px;
}

.scene-list::-webkit-scrollbar-track {
  background: #1f1f1f;
}

.scene-list::-webkit-scrollbar-thumb {
  background: #4d4d4d;
  border-radius: 3px;
}

.scene-list::-webkit-scrollbar-thumb:hover {
  background: #5d5d5d;
}

.link-hotspot-icon {
  width: 150%;
  height: 150%;
  cursor: pointer;
}

