/* ====================
   BEDROOM NAVIGATION CSS
   Multi-view system with hotspots
   ==================== */

:root {
  --hotspot-glow: #33ff33;
  --hotspot-hover: rgba(51, 255, 51, 0.3);
  --hotspot-border: rgba(51, 255, 51, 0.5);
  --portal-glow: #00f3ff;
  --secret-glow: #bc13fe;
  --unlock-glow: #ffd700;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

/* ============================
   BASE LAYOUT
   ============================ */
/* Only apply to standalone bedroom page, not index.html */
.bedroom-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
  font-family: 'Press Start 2P', 'Courier New', monospace;
}

/* Don't override game-container or room-container sizing - let style.css handle it */
/* Only add transition for view switching animation */
#bedroom-view {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* ============================
   HOTSPOTS CONTAINER
   ============================ */
#hotspots-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ============================
   HOTSPOT BASE STYLES
   ============================ */
.hotspot {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.3s ease;
  background: transparent;
}

/* Debug mode - show all hotspots */
.bedroom-container.debug .hotspot {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.5);
}

/* Hover effect - green terminal glow */
.hotspot:hover {
  border-color: var(--hotspot-border);
  background: var(--hotspot-hover);
  box-shadow:
    0 0 10px var(--hotspot-glow),
    0 0 20px var(--hotspot-glow),
    inset 0 0 10px rgba(51, 255, 51, 0.1);
}

/* ============================
   HOTSPOT TYPES
   ============================ */
.hotspot-portal:hover {
  border-color: var(--portal-glow);
  box-shadow:
    0 0 15px var(--portal-glow),
    0 0 30px var(--portal-glow);
}

.hotspot-secret:hover {
  border-color: var(--secret-glow);
  box-shadow:
    0 0 15px var(--secret-glow),
    0 0 30px var(--secret-glow);
}

.hotspot-unlock:hover {
  border-color: var(--unlock-glow);
  box-shadow:
    0 0 15px var(--unlock-glow),
    0 0 30px var(--unlock-glow);
}

.hotspot-game:hover {
  border-color: #ff6b6b;
  box-shadow:
    0 0 10px #ff6b6b,
    0 0 20px #ff6b6b;
}

/* ============================
   HOTSPOT LABELS
   ============================ */
.hotspot-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: var(--hotspot-glow);
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  border: 1px solid var(--hotspot-glow);
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: none;
}

.hotspot:hover .hotspot-label {
  opacity: 1;
}

/* ============================
   NAVIGATION ARROWS
   ============================ */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 200;
  border: 1px solid rgba(51, 255, 51, 0.2);
  border-radius: 4px;
  opacity: 0.5;
}

.nav-arrow:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--hotspot-glow);
  box-shadow: 0 0 15px rgba(51, 255, 51, 0.3);
}

.nav-arrow.left {
  left: 10px;
}

.nav-arrow.right {
  right: 10px;
}

.nav-arrow-icon {
  font-size: 24px;
  color: rgba(51, 255, 51, 0.7);
  transition: all 0.3s ease;
}

.nav-arrow:hover .nav-arrow-icon {
  color: var(--hotspot-glow);
  text-shadow: 0 0 10px var(--hotspot-glow);
}

/* ============================
   VIEW TRANSITIONS
   ============================ */
#bedroom-view.slide-left {
  animation: slideOutLeft 0.3s ease-out forwards;
}

#bedroom-view.slide-right {
  animation: slideOutRight 0.3s ease-out forwards;
}

#bedroom-view.slide-in-from-left {
  animation: slideInFromLeft 0.3s ease-out forwards;
}

#bedroom-view.slide-in-from-right {
  animation: slideInFromRight 0.3s ease-out forwards;
}

/* Exit animations - where the current view goes */
@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100px); opacity: 0; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100px); opacity: 0; }
}

/* Enter animations - where the new view comes from */
@keyframes slideInFromRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromLeft {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================
   VIEW LABEL
   ============================ */
#view-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: var(--hotspot-glow);
  padding: 8px 16px;
  border: 1px solid var(--hotspot-glow);
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 2px;
  z-index: 200; /* Above scanlines (z-index 15) */
  pointer-events: none; /* Don't block clicks */
}

/* ============================
   MODAL STYLES (enhancements for bedroom)
   Base modal styles are in style.css
   ============================ */
#bedroom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#bedroom-modal.hidden {
  display: none;
}

/* Modal body text styling */
.modal-body {
  margin: 0 0 20px 0;
  line-height: 1.8;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
}

.modal-body p {
  margin: 0 0 12px 0;
}

.modal-body em {
  color: #888;
  font-style: italic;
}

/* Modal choices container */
.modal-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
.bedroom-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.9);
  color: var(--hotspot-glow);
  padding: 12px 24px;
  border: 1px solid var(--hotspot-glow);
  border-radius: 2px;
  font-size: 11px;
  font-family: 'Press Start 2P', monospace;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.bedroom-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================
   COORDINATE HELPER STYLES
   ============================ */
.coord-helper-active .hotspot {
  pointer-events: none;
}

.coord-helper-active #bedroom-view {
  cursor: crosshair;
}

#coord-helper-ui {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.coord-helper-panel {
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid var(--hotspot-glow);
  padding: 16px;
  width: 350px;
  color: var(--hotspot-glow);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

.coord-helper-panel h3 {
  margin: 0 0 12px 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  border-bottom: 1px solid var(--hotspot-glow);
  padding-bottom: 8px;
}

.coord-helper-panel p {
  margin: 0 0 12px 0;
  line-height: 1.5;
  color: #aaa;
}

.coord-display {
  background: #111;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #333;
}

.coord-display div {
  margin: 4px 0;
}

.coord-output {
  background: #0a0a0a;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #333;
  max-height: 200px;
  overflow-y: auto;
}

.coord-output pre {
  margin: 8px 0 0 0;
  white-space: pre-wrap;
  font-size: 10px;
  color: #33ff33;
}

.coord-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coord-buttons button {
  background: transparent;
  border: 1px solid var(--hotspot-glow);
  color: var(--hotspot-glow);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  transition: all 0.2s;
}

.coord-buttons button:hover {
  background: var(--hotspot-glow);
  color: #000;
}

.coord-instructions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.coord-instructions p {
  margin: 4px 0;
  font-size: 10px;
}

.coord-point-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--hotspot-glow);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 0 10px var(--hotspot-glow);
}

.coord-preview-rect {
  position: absolute;
  border: 2px dashed var(--hotspot-glow);
  background: rgba(51, 255, 51, 0.1);
  pointer-events: none;
  z-index: 99;
}

/* ============================
   NIGHT MODE
   ============================ */
.night-mode #bedroom-view {
  filter: brightness(0.4) contrast(1.2);
}

.night-mode .hotspot:hover {
  box-shadow:
    0 0 15px var(--hotspot-glow),
    0 0 30px var(--hotspot-glow),
    0 0 45px var(--hotspot-glow);
}

/* Reveal hidden elements in night mode */
.night-mode .hotspot[data-id="tamagotchi"] {
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px var(--secret-glow); }
  50% { box-shadow: 0 0 20px var(--secret-glow), 0 0 30px var(--secret-glow); }
}

/* ============================
   CRT EFFECTS (OVERLAY)
   ============================ */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 500;
}

.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 40%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: 499;
}

/* ============================
   HOUSE MAP MODAL
   ============================ */
.house-map {
  font-family: 'IBM Plex Mono', monospace;
}

.house-map p {
  padding: 8px;
  border: 1px solid #333;
  margin: 4px 0;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .nav-arrow {
    width: 30px;
    height: 80px;
  }

  .nav-arrow-icon {
    font-size: 18px;
  }

  #view-label {
    font-size: 10px;
    padding: 6px 12px;
  }

  .modal-content {
    padding: 16px;
    max-width: 95%;
  }

  .modal-title {
    font-size: 12px;
  }

  .modal-text {
    font-size: 10px;
  }

  .choice-btn, .retro-btn, .modal-choice-btn, .modal-close {
    padding: 8px 12px;
    font-size: 8px;
    min-width: auto;
    flex: 1 1 45%;
  }

  #coord-helper-ui {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
  }

  .coord-helper-panel {
    width: auto;
  }
}
