/* ── SENAC Tour 360° v2 · Viewer CSS ────────────────────────────────────── */

/* ── Root container ─────────────────────────────────────────────────────── */
.stour-root {
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: -apple-system, 'Segoe UI', Helvetica, sans-serif;
  max-width: 100%;
}

/* Layout "side": nav à esquerda, viewer à direita */
.stour-root:has(.stour-nav-side) {
  flex-direction: row;
  align-items: stretch;
}

/* ── Viewer wrap ─────────────────────────────────────────────────────────── */
.stour-viewer-wrap {
  position: relative;
  width: 100%;
  height: var(--stour-h, 70vh);
  background: #080810;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.05);
  flex: 1;
  min-height: 280px;
  touch-action: none;
}

/* quando há nav-side, o wrap fica sem border-radius à esquerda */
.stour-root:has(.stour-nav-side) .stour-viewer-wrap {
  border-radius: 0 14px 14px 0;
}

/* Fullscreen */
.stour-root:-webkit-full-screen .stour-viewer-wrap,
.stour-root:fullscreen .stour-viewer-wrap {
  height: 100vh !important;
  border-radius: 0 !important;
}

/* ── Canvas ─────────────────────────────────────────────────────────────── */
.stour-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
  cursor: grab;
}
.stour-canvas:active { cursor: grabbing; }

/* ── Nav — Tabs ─────────────────────────────────────────────────────────── */
.stour-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
}

.stour-nav-tabs {
  flex-direction: row;
  flex-wrap: wrap;
  padding: 10px 10px 0;
  background: #111118;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255,255,255,.06);
  border-bottom: none;
}
.stour-nav-tabs + .stour-viewer-wrap { border-radius: 0 0 14px 14px; }

.stour-nav-tabs .stour-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: rgba(255,255,255,.45);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.stour-nav-tabs .stour-nav-btn:hover  { background: rgba(255,255,255,.07); color: #fff; }
.stour-nav-tabs .stour-nav-btn.active { background: #080810; color: #fff; border-bottom: 2px solid #E31E26; }

/* ── Nav — Grid (miniaturas) ─────────────────────────────────────────────── */
.stour-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  padding: 10px;
  background: #111118;
  border: 1px solid rgba(255,255,255,.06);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
}
.stour-nav-grid + .stour-viewer-wrap { border-radius: 0 0 14px 14px; }

.stour-nav-grid .stour-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.5);
  font-size: .75rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.stour-nav-grid .stour-nav-btn:hover  { background: rgba(255,255,255,.09); color: #fff; }
.stour-nav-grid .stour-nav-btn.active { background: rgba(227,30,38,.18); color: #fff; border-color: #E31E26; }
.stour-nav-grid .stour-nav-icon { font-size: 1.4rem; line-height: 1; }

/* ── Nav — Side (painel lateral) ────────────────────────────────────────── */
.stour-nav-side {
  flex-direction: column;
  width: 160px;
  flex-shrink: 0;
  background: #111118;
  border: 1px solid rgba(255,255,255,.06);
  border-right: none;
  border-radius: 14px 0 0 14px;
  padding: 10px 8px;
  overflow-y: auto;
  gap: 4px;
}

.stour-nav-side .stour-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255,255,255,.45);
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  width: 100%;
}
.stour-nav-side .stour-nav-btn:hover  { background: rgba(255,255,255,.07); color: #fff; }
.stour-nav-side .stour-nav-btn.active { background: rgba(227,30,38,.2); color: #fff; border-left: 3px solid #E31E26; }
.stour-nav-side .stour-nav-icon { font-size: 1.1rem; flex-shrink: 0; }
.stour-nav-side .stour-nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Loading ─────────────────────────────────────────────────────────────── */
.stour-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(8,8,16,.93);
  z-index: 20;
  transition: opacity .4s;
}
.stour-loading.hidden { opacity: 0; pointer-events: none; }

.stour-spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(255,255,255,.08);
  border-top-color: #E31E26;
  border-radius: 50%;
  animation: stour-spin .6s linear infinite;
}
@keyframes stour-spin { to { transform: rotate(360deg); } }

.stour-loading-text {
  color: rgba(255,255,255,.45);
  font-size: .82rem;
}
.stour-loading-bar-wrap {
  width: 180px; height: 3px;
  background: rgba(255,255,255,.07);
  border-radius: 2px; overflow: hidden;
}
.stour-loading-bar {
  height: 100%; background: #E31E26; width: 0;
  transition: width .2s; border-radius: 2px;
}

/* ── Badge ───────────────────────────────────────────────────────────────── */
.stour-badge {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(8,8,16,.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 50px;
  padding: 6px 15px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity .4s;
}
.stour-badge.visible { opacity: 1; }

.stour-badge-dot {
  width: 7px; height: 7px;
  background: #E31E26; border-radius: 50%;
  flex-shrink: 0;
  animation: stour-pulse 2.4s ease infinite;
}
@keyframes stour-pulse {
  0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(1.6)}
}
.stour-badge-icon { font-size: 1rem; line-height: 1; }
.stour-badge-name {
  color: rgba(255,255,255,.9);
  font-size: .78rem; font-weight: 600; letter-spacing: .03em;
}

/* ── HUD ─────────────────────────────────────────────────────────────────── */
.stour-hud {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(8,8,16,.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50px;
  padding: 4px 10px;
  z-index: 10;
  opacity: 0;
  transition: opacity .3s;
}
.stour-hud.visible { opacity: 1; }

.stour-hud-btn {
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,.4);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  line-height: 1;
}
.stour-hud-btn:hover  { background: rgba(255,255,255,.1); color: #fff; }
.stour-hud-btn.active { background: #E31E26; color: #fff; }
.stour-hud-sep { width: 1px; height: 18px; background: rgba(255,255,255,.1); margin: 0 2px; }

/* ── Hint ────────────────────────────────────────────────────────────────── */
.stour-hint {
  position: absolute;
  bottom: 58px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.3);
  font-size: .7rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9;
  animation: stour-fadein .5s 1s forwards, stour-fadeout .5s 5.5s forwards;
  opacity: 0;
}
@keyframes stour-fadein  { to { opacity: 1; } }
@keyframes stour-fadeout { to { opacity: 0; } }

/* ── Error ───────────────────────────────────────────────────────────────── */
.stour-error {
  color: #c00; background: #fff0f0;
  border: 1px solid #fcc; padding: 10px 14px;
  border-radius: 6px; font-size: .9rem;
}

/* ── Responsividade ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .stour-viewer-wrap { border-radius: 8px; }
  .stour-nav-tabs, .stour-nav-grid { border-radius: 8px 8px 0 0; }
  .stour-nav-tabs + .stour-viewer-wrap,
  .stour-nav-grid + .stour-viewer-wrap { border-radius: 0 0 8px 8px; }

  /* side vira tabs no mobile */
  .stour-root:has(.stour-nav-side) { flex-direction: column; }
  .stour-nav-side {
    width: 100%; flex-direction: row; flex-wrap: wrap;
    border-radius: 8px 8px 0 0; border-right: 1px solid rgba(255,255,255,.06); border-bottom: none;
    padding: 8px;
  }
  .stour-nav-side .stour-nav-btn { width: auto; flex: 0 0 auto; }
  .stour-root:has(.stour-nav-side) .stour-viewer-wrap { border-radius: 0 0 8px 8px; }

  .stour-nav-tabs .stour-nav-btn { padding: 6px 11px; font-size: .75rem; }
  .stour-badge { font-size: .72rem; padding: 5px 12px; }
}
