/* Presentation Mode & Viewpoint Panel Styles */

/* ── Viewpoint Panel (left side) ── */
.viewpoint-panel {
  position: absolute;
  top: 48px; /* below toolbar */
  left: 0;
  bottom: 80px; /* above sheet nav */
  width: 280px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  z-index: 15;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.viewpoint-panel.open {
  transform: translateX(0);
}

.viewpoint-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.viewpoint-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.viewpoint-panel-actions {
  display: flex;
  gap: 4px;
}

.viewpoint-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.viewpoint-list:empty::after {
  content: 'No viewpoints saved yet. Navigate to a view and click "Save View" below.';
  display: block;
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.viewpoint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.viewpoint-item:hover {
  background: var(--color-bg);
}

.viewpoint-item.active {
  background: var(--color-primary-light);
}

.viewpoint-item.drag-over {
  border-top: 2px solid var(--color-primary);
}

.viewpoint-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.viewpoint-item.active .viewpoint-number {
  background: var(--color-primary);
  color: white;
}

.viewpoint-info {
  flex: 1;
  min-width: 0;
}

.viewpoint-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewpoint-sheet {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.viewpoint-item-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.viewpoint-item:hover .viewpoint-item-actions {
  display: flex;
}

.viewpoint-item-actions .btn-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.viewpoint-panel-footer {
  padding: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.viewpoint-panel-footer .btn {
  width: 100%;
  font-size: 13px;
  padding: 8px 12px;
}

/* ── Rename Input ── */
.viewpoint-rename-input {
  font-size: 13px;
  padding: 2px 6px;
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  outline: none;
}

/* ── Presentation Mode ── */
.viewer-layout.presentation-mode .viewer-toolbar,
.viewer-layout.presentation-mode .sheet-nav-container,
.viewer-layout.presentation-mode .viewpoint-panel {
  display: none !important;
}

.viewer-layout.presentation-mode .viewer-canvas {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ── Presentation Overlay ── */
.presentation-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 10px 20px;
  border-radius: 40px;
  z-index: 100;
  transition: opacity 0.4s ease;
  opacity: 1;
}

.presentation-overlay.faded {
  opacity: 0;
  pointer-events: none;
}

.presentation-overlay .btn-pres {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: white;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.presentation-overlay .btn-pres:hover {
  background: rgba(255, 255, 255, 0.15);
}

.presentation-overlay .btn-pres:disabled {
  opacity: 0.3;
  cursor: default;
}

.presentation-overlay .btn-pres:disabled:hover {
  background: transparent;
}

.presentation-counter {
  color: white;
  font-size: 14px;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.presentation-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.25);
}

.presentation-viewpoint-name {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Toolbar Buttons for Viewpoints ── */
.btn-icon.viewpoint-active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ── Presentation Draw ── */

.presdraw-popover-content {
  min-width: 200px;
}

.presdraw-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.presdraw-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 4px);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.1s, border-color 0.1s;
}
.presdraw-tool-btn:hover {
  border-color: var(--color-primary-light);
}
.presdraw-tool-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.presdraw-tool-btn .tool-icon {
  font-size: 18px;
}
.presdraw-tool-btn .tool-label {
  font-size: 10px;
}

.presdraw-color-row {
  display: flex;
  gap: 6px;
  padding: 6px 0 8px;
  justify-content: center;
}

.presdraw-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.presdraw-color-swatch:hover {
  transform: scale(1.15);
}
.presdraw-color-swatch.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary);
}

/* Laser pointer glow */
.laser-head {
  filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.8))
          drop-shadow(0 0 8px rgba(255, 0, 0, 0.5));
}

/* ── Auto-advance (timed slideshow) ── */
.presentation-overlay { position: fixed; }
.presentation-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
  border-radius: 0 0 8px 8px;
}
.presentation-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-primary, #2563eb);
  animation-name: pres-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes pres-progress { from { width: 0; } to { width: 100%; } }
.btn-pres-auto.paused { color: var(--color-primary, #2563eb); }
