/* ============================================================
   360°バリアフリーVRルート案内システム — styles.css (v1.2)
   ============================================================ */

:root {
  --accent: #29ABE2;       /* START / ハイライト水色 / 旋回中シークバー */
  --pause-orange: #FF9800; /* 待機中シークバー */
  --warn-red: #e53935;
  --warn-amber: #fb8c00;
  --sidebar-w: 150px;
  --rightcol-w: 280px;
  --thumb-h: 90px;
  --seekbar-h: 8px;

  --info-ok: #E8F5E9;
  --info-slope: #FFF8E1;
  --info-width: #FFF3E0;
  --info-surface: #FBE9E7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
               -apple-system, "Segoe UI", sans-serif;
  background: #000;
}

/* ---------- Layer: 360 viewer (z-index 0) ---------- */
#panorama {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Pannellum zoom controls -> bottom-right (v1.2) */
.pnlm-zoom-controls {
  bottom: 80px !important;
  right: 16px !important;
  top: auto !important;
  left: auto !important;
}

/* ---------- Fixed navigation arrow (center-bottom, v1.2) ---------- */
.hs-arrow-fixed {
  position: fixed;
  bottom: 80px;          /* above the seekbar */
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  z-index: 50;
  border: none;
  background: transparent;
  cursor: pointer;
  animation: pulse 2s ease-in-out infinite;
}
.hs-arrow-fixed[hidden] { display: none; }
.hs-arrow-fixed::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 96px; height: 96px;
  background: rgba(229, 57, 53, 0.85);
  border-radius: 50%;
}
.hs-arrow-fixed::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -60%);
  width: 0; height: 0;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
  border-bottom: 44px solid #fff;
}
.hs-arrow-fixed .hand {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  font-size: 28px;
  pointer-events: none;
}
.hs-arrow-fixed:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes pulse {
  0%, 100% { transform: translateX(-50%) scale(0.9); }
  50%      { transform: translateX(-50%) scale(1.1); }
}

/* ---------- Top bar ---------- */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 0;
  z-index: 120;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }

.icon-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 121;
}
.icon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Sidebar ---------- */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  padding: 64px 0 16px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
#sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.thumb-list { list-style: none; margin: 0; padding: 0; }
.thumb-item {
  position: relative;
  margin: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #222;
}
.thumb-item img { display: block; width: 100%; height: var(--thumb-h); object-fit: cover; }
.thumb-item.active { border-color: var(--accent); }
.thumb-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.thumb-num {
  position: absolute;
  top: 2px;
  left: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-shadow: 0 0 4px #000, 0 0 4px #000;
}
.thumb-check {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  color: #2e7d32;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  display: none;
}
.thumb-item.visited .thumb-check { display: block; }

/* ============================================================
   Right column: map + resident info panel
   ============================================================ */
#rightCol {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--rightcol-w);
  height: 100%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.55);
  padding: 12px;
  gap: 12px;
}

.map-toggle {
  display: none;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
  cursor: pointer;
}

#map {
  width: 100%;
  height: 240px;
  border-radius: 10px;
  background: #555;
  flex-shrink: 0;
}

.map-pin {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  background: var(--warn-red);
  border: 2px solid #fff;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.map-pin.visited { background: #9e9e9e; }
.map-pin.current { background: var(--warn-red); width: 26px; height: 26px; }

.info-panel {
  flex: 1;
  min-height: 140px;
  background: var(--info-ok);
  border-radius: 10px;
  padding: 14px;
  color: #222;
  overflow-y: auto;
  transition: background-color 0.3s ease;
}
.info-panel.slope   { background: var(--info-slope); }
.info-panel.width   { background: var(--info-width); }
.info-panel.surface { background: var(--info-surface); }

.info-head { display: flex; align-items: center; gap: 8px; }
.info-icon { font-size: 24px; }
.info-label { font-weight: 700; font-size: 15px; flex: 1; }
.speech-btn {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.speech-btn.speaking { animation: pulse-soft 1s ease-in-out infinite; }
.speech-btn:focus-visible { outline: 2px solid var(--accent); }
@keyframes pulse-soft { 0%,100% { transform: scale(1);} 50% { transform: scale(1.18);} }

.info-width { font-size: 36px; font-weight: 800; color: var(--warn-red); margin: 8px 0; }
.info-note { font-size: 14px; line-height: 1.6; margin: 8px 0 0; }

/* ---------- Pause indicator ---------- */
.pause-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 105;
}

/* ============================================================
   Seekbar (bottom progress, v1.2)
   ============================================================ */
.seekbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: var(--seekbar-h);
  background: #E0E0E0;
  z-index: 100;
}
.seekbar[hidden] { display: none; }
.seekbar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}
.seekbar-fill.pausing { background: var(--pause-orange); }

/* ============================================================
   Width dimension overlay (hotspot)
   ============================================================ */
.hs-width {
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  transform: translate(-50%, -50%);
}
.hs-width .width-arrow {
  color: var(--warn-red);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.hs-width .width-label {
  display: block;
  margin-top: 2px;
  color: var(--warn-red);
  font-size: 26px;
  font-weight: 800;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

/* ============================================================
   Start modal (z-index 200)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-width: 480px;
  width: 100%;
  padding: 24px;
}
.start-modal { display: flex; gap: 16px; align-items: center; }
.start-logos { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.start-logos:empty { display: none; }
.start-logos img { max-width: 96px; max-height: 96px; object-fit: contain; }
.start-body { flex: 1; }
.start-title { font-size: 24px; margin: 0 0 4px; color: #222; }
.start-subtitle { margin: 0 0 12px; color: #666; font-size: 15px; }
.start-time { margin: 0 0 18px; color: #333; font-size: 14px; }
.start-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.start-btn:focus-visible { outline: 3px solid #0d6e96; outline-offset: 2px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 767px) {
  #sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  #sidebar.open { transform: translateX(0); }

  #rightCol {
    position: fixed;
    top: auto;
    bottom: var(--seekbar-h);
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 50%;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.7);
  }
  .map-toggle { display: block; }
  #map { height: 180px; }
  #rightCol.map-collapsed #map { display: none; }

  .start-modal { flex-direction: column; text-align: center; }
  .start-logos { flex-direction: row; justify-content: center; }
}
