/* css/viewer.css - Estilos do viewer 3D */

.viewer-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - var(--header-height) - 100px);
  min-height: 500px;
}

@media (max-width: 1024px) {
  .viewer-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ========== PAINEL LATERAL ========== */
.viewer-panel {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.viewer-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.viewer-panel-header select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

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

.model-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.model-item.active {
  background: rgba(232, 97, 26, 0.1);
  color: var(--accent);
}

.model-item .model-name {
  font-weight: 500;
}

.model-item .model-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ========== VIEWER 3D ========== */
.viewer-container {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}

#viewer-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #1a1a2e;
  border-radius: 10px;
}

/* ========== CONTROLES OVERLAY ========== */
.viewer-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.viewer-btn {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.viewer-btn:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.viewer-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.viewer-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ========== INFO PANEL OVERLAY ========== */
.viewer-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 300px;
  z-index: 10;
}

.viewer-info p {
  margin-bottom: 2px;
}

.viewer-info .label {
  color: rgba(255,255,255,0.6);
}

/* ========== LOADING OVERLAY ========== */
.viewer-loading {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 20;
  border-radius: 10px;
}

.viewer-loading .spinner {
  border-color: rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  width: 40px;
  height: 40px;
}

.viewer-loading p {
  margin-top: 12px;
  font-size: 14px;
}

.viewer-loading .progress-text {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

/* ========== EMPTY STATE ========== */
.viewer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 40px;
}

.viewer-empty svg {
  width: 48px;
  height: 48px;
  fill: currentColor;
  margin-bottom: 12px;
}

.viewer-empty p {
  font-size: 14px;
}
