/* ==========================================================================
   BEYOND THE DOOR: 3D MIDNIGHT ARCHIVE STYLES
   ========================================================================== */

/* ⚪ Navbar Text Color White */
.navbar .nav-link,
.navbar-nav .nav-link {
  color: #ffffff !important;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.navbar .nav-link:hover,
.navbar-nav .nav-link:hover,
.navbar .nav-link.active,
.navbar-nav .nav-link.active {
  color: #ff9d42 !important;
  opacity: 1;
}

/* 🚪 Mysterious Navbar Door Button */
.secret-door-btn {
  background: rgba(255, 120, 40, 0.15);
  border: 1px solid rgba(255, 140, 50, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  z-index: 1050;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(255, 120, 40, 0.25);
  margin-right: 12px;
}

.secret-door-btn:hover {
  background: rgba(255, 140, 50, 0.3);
  border-color: rgba(255, 180, 80, 0.8);
  box-shadow: 0 0 20px rgba(255, 140, 50, 0.6), 0 0 40px rgba(255, 100, 0, 0.3);
  transform: translateY(-2px) scale(1.05);
}

.secret-door-btn .door-icon {
  font-size: 1.3rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 0 6px rgba(255, 160, 50, 0.8));
}

.secret-door-btn:hover .door-icon {
  transform: rotateY(-30deg) scale(1.15);
}

.secret-door-btn .door-label {
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffd8a8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* 🌀 Portal Vignette Overlay Transition */
#portal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(5, 8, 20, 0.95) 70%, #050814 100%);
  backdrop-filter: blur(0px);
  transition: opacity 0.8s ease, backdrop-filter 0.8s ease;
}

#portal-overlay.active {
  opacity: 1;
  backdrop-filter: blur(15px);
}

/* 🌌 3D Canvas Viewport Container */
#three-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background-color: #0f172a;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

#three-canvas-container.visible {
  display: block;
  opacity: 1;
}

#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1;
  display: block;
}

/* ⏳ 3D Scene Loading Screen */
#three-loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #0e1428 0%, #04060f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  color: #ffffff;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  transition: opacity 0.6s ease;
}

#three-loading-screen.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  display: none !important;
  visibility: hidden !important;
}

.loader-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff9d42;
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(255, 157, 66, 0.5);
  letter-spacing: 1px;
}

.loader-subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 24px;
}

.loader-progress-bg {
  width: 280px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 157, 66, 0.3);
}

.loader-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff7828, #00f0ff, #b000ff);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
}

.loader-status {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* 🕹️ HUD Top Controls Bar */
#three-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

.hud-top-bar {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: auto;
}

.hud-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hud-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.hud-badge {
  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 157, 66, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  color: #ffb870;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hud-badge-dot {
  width: 8px;
  height: 8px;
  background-color: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00f0ff;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

/* 🌤️ Live Weather HUD Badge */
.hud-weather-badge {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  color: #38bdf8;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 🔘 Base HUD Glassmorphic Pill Buttons */
.hud-btn {
  height: 38px !important;
  padding: 8px 18px !important;
  margin: 0 4px !important;
  border-radius: 25px !important;
  font-family: var(--font-code), 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

/* 🎨 3D Model Credits Button (Indigo Neon Pill) */
.hud-btn-credits {
  background: rgba(99, 102, 241, 0.22) !important;
  border: 1px solid rgba(129, 140, 248, 0.45) !important;
  color: #c7d2fe !important;
  border-radius: 25px !important;
  padding: 8px 18px !important;
  margin: 0 4px !important;
}

.hud-btn-credits:hover {
  background: rgba(99, 102, 241, 0.55) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.7), 0 6px 20px rgba(0, 0, 0, 0.4) !important;
  transform: translateY(-2px) scale(1.04) !important;
}

/* 🚪 Exit 3D Button (Crimson Neon Pill) */
.hud-btn-exit {
  background: rgba(225, 29, 72, 0.22) !important;
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
  color: #fecdd3 !important;
  border-radius: 25px !important;
  padding: 8px 18px !important;
  margin: 0 4px !important;
}

.hud-btn-exit:hover {
  background: rgba(225, 29, 72, 0.6) !important;
  border-color: #f43f5e !important;
  color: #ffffff !important;
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.7), 0 6px 20px rgba(0, 0, 0, 0.4) !important;
  transform: translateY(-2px) scale(1.04) !important;
}

/* 💭 Random Thoughts, Quotes & Jokes Floating Pop-up Card */
.hud-thought-card {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100001;
  max-width: 320px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 18px;
  padding: 14px 18px;
  color: #f1f5f9;
  font-family: var(--font-body), 'Inter', sans-serif;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.2);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: auto;
}

.hud-thought-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.thought-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.thought-category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.thought-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 4px;
}

.thought-close-btn:hover {
  color: #ffffff;
}

.thought-body-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #e2e8f0;
}


/* 🎵 Spotify-Style Glassmorphic Radio Player Widget */
.hud-spotify-player {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 14px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
  pointer-events: auto;
}

.spotify-art {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.spotify-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.spotify-eq span {
  width: 3px;
  background: #10b981;
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.spotify-eq.playing span:nth-child(1) { animation: eq-bounce 0.8s infinite ease-in-out alternate; }
.spotify-eq.playing span:nth-child(2) { animation: eq-bounce 1.1s infinite ease-in-out alternate; }
.spotify-eq.playing span:nth-child(3) { animation: eq-bounce 0.7s infinite ease-in-out alternate; }
.spotify-eq.playing span:nth-child(4) { animation: eq-bounce 0.9s infinite ease-in-out alternate; }

@keyframes eq-bounce {
  0% { height: 4px; }
  100% { height: 14px; }
}

.spotify-track-info {
  display: flex;
  flex-direction: column;
  min-width: 130px;
}

.spotify-station-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
}

.spotify-song-title {
  font-size: 0.68rem;
  color: #94a3b8;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
}

.spotify-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spotify-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.spotify-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #ffffff;
  transform: scale(1.08);
}

.spotify-btn-play {
  background: #10b981;
  border-color: #10b981;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.spotify-btn-play:hover {
  background: #34d399;
  transform: scale(1.12);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.8);
}

.spotify-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  color: #94a3b8;
  font-size: 0.75rem;
}

.spotify-volume-slider {
  width: 50px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.spotify-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

/* 🎯 Bottom Center Interaction Prompt */
.hud-interaction-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 10px 24px;
  border-radius: 30px;
  color: #e0f2fe;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  pointer-events: auto;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: float-hint 3s infinite ease-in-out;
}

@keyframes float-hint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

/* 📍 Floating Mouse Cursor 3D Coordinate Badge */
#cursor-coord-badge {
  position: fixed;
  pointer-events: none;
  z-index: 100002;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 240, 255, 0.6);
  padding: 4px 10px;
  border-radius: 12px;
  color: #00f0ff;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.4);
  transform: translate(14px, 14px);
  display: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

/* 🪟 Interactive Content Modals (Glassmorphism) */
.three-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 20, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.three-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* 📜 Vintage Kyoto Travel Diary Modal Theme (Kertas Diary Estetis) */
.three-modal-card {
  width: 90%;
  max-width: 650px;
  max-height: 82vh;
  background: #fdfbf7;
  background-image: 
    linear-gradient(rgba(235, 225, 210, 0.45) 1px, transparent 1px),
    radial-gradient(circle at 12px 12px, rgba(180, 150, 120, 0.12) 2px, transparent 2px);
  background-size: 100% 28px, 100% 100%;
  border: 2px solid #d4b896;
  border-radius: 14px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85), inset 0 0 40px rgba(210, 180, 140, 0.25);
  color: #2c2416;
  overflow-y: auto;
  padding: 32px 32px 32px 48px;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Vintage Diary Red/Gold Left Margin Line */
.three-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 36px;
  width: 2px;
  height: 100%;
  background: rgba(220, 100, 80, 0.3);
}

/* Decorative Stamp Ribbon */
.diary-stamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(180, 80, 60, 0.12);
  border: 1.5px dashed #b85c40;
  color: #9e4328;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.three-modal-backdrop.active .three-modal-card {
  transform: scale(1) translateY(0);
}

.three-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed rgba(180, 150, 120, 0.4);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.three-modal-title {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-optical-sizing: auto;
  font-size: 1.4rem;
  font-weight: 700;
  color: #5c3a1e;
  display: flex;
  align-items: center;
  gap: 10px;
}

.three-modal-close {
  background: rgba(180, 150, 120, 0.18);
  border: 1px solid rgba(180, 150, 120, 0.4);
  color: #5c3a1e;
  font-size: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.three-modal-close:hover {
  background: #b85c40;
  color: #ffffff;
}

.three-modal-body {
  font-family: var(--font-body), 'Inter', sans-serif;
  font-optical-sizing: auto;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #3d3122;
}

/* Handwritten Narrative Highlight Quote Box */
.diary-story-quote {
  background: rgba(255, 250, 240, 0.95);
  border-left: 4px solid #b85c40;
  border-radius: 0 8px 8px 0;
  padding: 12px 18px;
  margin: 14px 0 18px 0;
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  font-weight: 700;
  color: #4a2c11;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.diary-personal-note {
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  font-weight: 700;
  color: #8c4a27;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed rgba(180, 150, 120, 0.35);
}

/* 🍞 Toast Notification */
.three-toast {
  position: absolute;
  top: 80px;
  right: 20px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 12px;
  padding: 12px 20px;
  color: #ecfdf5;
  font-family: var(--font-code), 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.3);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  z-index: 100010;
}

.three-toast.show {
  transform: translateX(0);
}

/* 📱 Responsive Mobile Tweaks */
@media (max-width: 768px) {
  .hud-top-bar {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  
  .hud-badge {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .hud-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .hud-interaction-hint {
    bottom: 20px;
    font-size: 0.8rem;
    padding: 8px 16px;
  }

  .three-modal-card {
    padding: 20px;
    width: 95%;
  }
}
