/**
 * VR360 Blind Tour Layer — Styles
 * © 2026 Gabriel Acoca — VR360 Productions
 */

/* Screen reader only */
.sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* Toggle button */
#vr360-blind-overlay {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  z-index: 99999;
}

.vr360-blind-btn {
  position: fixed;
  top: 12px; left: 12px;
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 100000;
  transition: all 0.3s ease;
}
.vr360-blind-btn:hover,
.vr360-blind-btn:focus {
  background: rgba(0,0,0,0.9);
  border-color: #f0c040;
  outline: 2px solid #f0c040;
  outline-offset: 2px;
}
.vr360-blind-btn.active {
  background: #1a5276;
  border-color: #f0c040;
}
.vr360-blind-btn svg {
  width: 22px; height: 22px;
}

/* Main panel */
.vr360-blind-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 55vh;
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e8e8e8;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 10px;
  z-index: 99999;
  overflow-y: auto;
  border-top: 2px solid rgba(240, 192, 64, 0.4);
}
.vr360-blind-panel:focus {
  outline: none;
}

/* Scene info */
.vr360-blind-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.vr360-blind-scene {
  font-size: 18px;
  font-weight: 700;
  color: #f0c040;
}
.vr360-blind-dir {
  font-size: 13px;
  color: #a0b8d0;
  white-space: nowrap;
}

/* Description */
.vr360-blind-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #c8d8e8;
  max-height: 80px;
  overflow-y: auto;
}

/* POI */
.vr360-blind-poi {
  background: rgba(240, 192, 64, 0.12);
  border-left: 3px solid #f0c040;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}
.vr360-blind-poi-name {
  font-weight: 700;
  color: #f0c040;
  margin-bottom: 4px;
}
.vr360-blind-poi-desc {
  font-size: 13px;
  color: #d0d8e0;
  line-height: 1.4;
}

/* Navigation */
.vr360-blind-nav {
  background: rgba(26, 82, 118, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
}
.vr360-blind-nav-label {
  font-size: 12px;
  color: #a0b8d0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#vr360-blind-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.vr360-blind-nav-btn {
  background: rgba(240, 192, 64, 0.15);
  border: 1px solid rgba(240, 192, 64, 0.4);
  color: #f0c040;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.vr360-blind-nav-btn:hover,
.vr360-blind-nav-btn:focus {
  background: rgba(240, 192, 64, 0.3);
  outline: 2px solid #f0c040;
}

/* Controls bar */
.vr360-blind-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vr360-blind-controls button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #e0e0e0;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
}
.vr360-blind-controls button:hover,
.vr360-blind-controls button:focus {
  background: rgba(240, 192, 64, 0.25);
  border-color: #f0c040;
  color: #fff;
  outline: 2px solid #f0c040;
  outline-offset: 1px;
}

/* AI Chat */
.vr360-blind-aichat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(26, 82, 118, 0.2);
  padding: 10px;
  border-radius: 6px;
}
#vr360-blind-ai-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  min-height: 44px;
}
#vr360-blind-ai-input:focus {
  outline: 2px solid #f0c040;
  border-color: #f0c040;
}
#vr360-blind-ai-input::placeholder {
  color: rgba(255,255,255,0.4);
}
#vr360-blind-ai-send {
  background: #1a5276;
  border: 1px solid #f0c040;
  color: #f0c040;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  align-self: flex-end;
  min-height: 44px;
}
#vr360-blind-ai-send:hover,
#vr360-blind-ai-send:focus {
  background: #f0c040;
  color: #1a1a2e;
  outline: 2px solid #fff;
}
#vr360-blind-ai-response {
  font-size: 14px;
  line-height: 1.5;
  color: #c8d8e8;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
}

/* Help dialog */
.vr360-blind-help {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 15, 30, 0.97);
  border: 2px solid #f0c040;
  border-radius: 12px;
  padding: 24px 28px;
  color: #e8e8e8;
  z-index: 100001;
  max-width: 480px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vr360-blind-help h2 {
  color: #f0c040;
  font-size: 18px;
  margin: 0;
}
.vr360-blind-help table {
  width: 100%;
  border-collapse: collapse;
}
.vr360-blind-help td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
}
.vr360-blind-help td:first-child {
  white-space: nowrap;
  width: 100px;
}
.vr360-blind-help kbd {
  background: rgba(240, 192, 64, 0.2);
  border: 1px solid rgba(240, 192, 64, 0.4);
  color: #f0c040;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: monospace;
}
.vr360-blind-help button {
  background: #f0c040;
  color: #1a1a2e;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  align-self: center;
  min-height: 44px;
}
.vr360-blind-help button:hover,
.vr360-blind-help button:focus {
  background: #ffd866;
  outline: 2px solid #fff;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .vr360-blind-panel {
    max-height: 65vh;
    padding: 12px 14px;
  }
  .vr360-blind-scene { font-size: 16px; }
  .vr360-blind-controls { gap: 4px; }
  .vr360-blind-controls button { padding: 6px 8px; font-size: 12px; }
}

/* ============================================================
   TTS OVERLAY — sous-titres plein écran pour malvoyants
   ============================================================ */

#vr360-tts-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200000;
  align-items: center;
  justify-content: center;
  padding: 6vw 8vw;
  pointer-events: none;
}
#vr360-tts-overlay.visible {
  display: flex;
}

.vr360-tts-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.6;
  text-align: center;
  max-width: 920px;
  width: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.vr360-tts-text span {
  display: inline;
  padding: 0 3px;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}

.vr360-tts-text span.current {
  background: #f0c040;
  color: #1a1a2e;
}

@media (min-width: 1200px) {
  .vr360-tts-text { font-size: clamp(48px, 5vw, 80px); }
}

@media (max-width: 640px) {
  .vr360-tts-text { font-size: clamp(28px, 7vw, 48px); }
  #vr360-tts-overlay { padding: 8vw 6vw; }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .vr360-blind-panel { background: #000; border-top: 3px solid #ff0; }
  .vr360-blind-scene { color: #ff0; }
  .vr360-blind-desc { color: #fff; }
  .vr360-blind-controls button { border: 2px solid #fff; color: #fff; }
  .vr360-blind-controls button:focus { outline: 3px solid #ff0; }
}
