/* ========================================
   INTRO SCREEN STYLES — PHINMA / Exsight360 Style
   Key approach:
   • One persistent white backdrop covers BOTH intro phases
   • Only the content panel fades/slides between phases
   • Background NEVER disappears during the transition
   ======================================== */

/* ── GLOBAL BACKDROP ─────────────────────────────────────────────────────────
   A single always-visible white layer that sits behind both intro layers.
   It only fades away after the user clicks "Start Tour" on phase 2.      */
#introBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9998; /* just below the intro layers */
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none; /* doesn't block clicks (layers handle that) */
}
#introBackdrop.phase2 {
  background: rgba(0, 0, 0, 0.85);
  transition:
    background 0.4s ease,
    opacity 0.6s ease;
}

#introBackdrop.hidden {
  opacity: 0;
}

/* ── LAYER SYSTEM ────────────────────────────────────────────────────────────
   Both layers share the same full-screen footprint.
   Each layer uses background: transparent so the backdrop shows through.  */
.intro-layer {
  font-family: "Roboto Slab", serif;
  position: fixed;
  inset: 0;
  background: transparent; /* backdrop handles the white */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.intro-layer.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Content-only fast fade (backdrop stays opaque) */
.intro-layer.content-fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Hide main tour UI while intro is active */
body.intro-active #sceneList,
body.intro-active #titleBar,
body.intro-active #autorotateToggle,
body.intro-active #fullscreenToggle,
body.intro-active #sceneListToggle,
body.intro-active .viewControlButton,
body.intro-active .burger-toggle,
body.intro-active #topLogoContainer {
  display: none !important;
}

/* ── Hide ALL hotspots during intro ─────────────────────────────────────── */
body.intro-active .hotspot,
body.intro-active .link-hotspot,
body.intro-active .info-hotspot,
body.intro-active [class*="hotspot"] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── INTRO CONTENT CONTAINER ────────────────────────────────────────────── */
.intro-content {
  text-align: center;
  max-width: 1000px;
  width: 92%;
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  opacity: 0;
  animation: introContentIn 0.7s ease 0.2s forwards;
}

@keyframes introContentIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════
   PHASE 1 — WELCOME SCREEN
   ═══════════════════════════════════════════════════ */

/* Logo */
.intro-logo-container {
  margin-bottom: 2px;
  flex-shrink: 0;
  opacity: 0;
  animation: logoScaleIn 0.55s ease 0.5s forwards;
}

@keyframes logoScaleIn {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.intro-logo {
  max-width: 750px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(255, 107, 0, 0.18));
}

/* Title */
.intro-title {
  font-family: "Roboto Slab", serif;
  font-size: 58px;
  font-weight: 400;
  margin: 4px 0 4px;
  letter-spacing: -0.5px;
  line-height: 1.05;
}

.intro-title .bella {
  color: #daa520;
}
.intro-title .vita {
  color: #6b8e23;
}
.intro-title .cabanatuan {
  font-family: "Archivo Black", sans-serif;
  color: #8b4513;
  display: inline;
  font-size: 48px;
  margin-top: 2px;
}

/* Subtitle — sits inline after "Cabanatuan" on the same line */
.intro-subtitle {
  font-family: "Archivo Black", sans-serif;
  font-size: 48px;
  font-weight: 400;
  color: #8b4513;
  margin: 0 0 8px;
  line-height: 1.3;
  display: inline;
}

/* Tour Label */
.intro-tour-label {
  font-family: "Roboto Slab", serif;
  font-size: 38px;
  font-weight: 500;
  color: #ff6b00;
  display: block;
  margin: 0 0 16px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   PHASE 2 — HOW TO NAVIGATE
   ═══════════════════════════════════════════════════ */

.intro-nav-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 44px;
  letter-spacing: -0.3px;
}

/* Navigation image wrapper — NO border, NO shadow, NO background */
.intro-nav-content {
  margin: 0 auto 48px;
  max-width: 680px;
  width: 100%;
  /* completely clean — no card styling */
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.intro-nav-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  /* explicitly strip any inherited shadow/border */
  border: none;
  box-shadow: none;
  outline: none;
}

/* Device-specific nav display */
.desktop-nav {
  display: none;
}
.mobile-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: block;
  }
}
@media (max-width: 767px) {
  .mobile-nav {
    display: block;
  }
}

/* ═══════════════════════════════════════════════════
   SHARED BUTTON
   ═══════════════════════════════════════════════════ */
.intro-button {
  background: #ff6b00;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  font-weight: 500;
  padding: 30px 50px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.28s ease;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.28);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0;
  animation:
    btnFadeIn 0.4s ease 1.1s forwards,
    subtlePulse 3s ease-in-out 2.2s infinite;
  position: relative;
  z-index: 10001;
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
}

@keyframes btnFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════
   LOADING INDICATOR (shown while first scene tiles load)
   ═══════════════════════════════════════════════════ */
#introLoadingBar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, #ff6b00, #ffa040);
  z-index: 10002;
  transition: width 0.3s ease;
  border-radius: 0 2px 2px 0;
}

#introLoadingText {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  font-family: "Roboto Slab", serif;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.45);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */

/* Small phones (< 360px) */
@media (max-width: 359px) {
  .intro-content {
    padding: 8px 10px;
  }
  .intro-logo {
    max-width: 200px;
  }
  .intro-title {
    font-size: 22px;
  }
  .intro-title .cabanatuan {
    font-size: 17px;
  }
  .intro-subtitle {
    font-size: 17px;
  }
  .intro-tour-label {
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 8px;
  }
  .intro-nav-title {
    font-size: 12px;
    margin-bottom: 14px;
  }
  .intro-nav-content {
    margin-bottom: 18px;
  }
  .intro-button {
    font-size: 12px;
    padding: 10px 28px;
  }
}

/* Mobile phones (360px – 767px) */
@media (max-width: 767px) {
  .intro-content {
    padding: 12px 14px;
  }
  .intro-logo {
    max-width: 300px;
  }
  .intro-logo-container {
    margin-bottom: 6px;
  }
  .intro-title {
    font-size: 30px;
    margin: 3px 0;
  }
  .intro-title .cabanatuan {
    font-size: 24px;
    margin-top: 2px;
  }
  .intro-subtitle {
    font-size: 24px;
    margin: 0 0 6px;
  }
  .intro-tour-label {
    font-size: 10px;
    letter-spacing: 3px;
    margin-bottom: 12px;
  }
  .intro-nav-title {
    font-size: 13px;
    margin-bottom: 18px;
  }
  .intro-nav-content {
    margin-bottom: 22px;
  }
  .intro-button {
    font-size: 14px;
    padding: 12px 34px;
  }
}

/* Landscape phones */
@media (max-width: 767px) and (orientation: landscape) {
  .intro-content {
    min-height: auto;
    padding: 6px 14px;
  }
  .intro-logo {
    max-width: 180px;
  }
  .intro-logo-container {
    margin-bottom: 3px;
  }
  .intro-title {
    font-size: 22px;
    margin: 2px 0;
  }
  .intro-title .cabanatuan {
    font-size: 17px;
  }
  .intro-subtitle {
    font-size: 17px;
    margin-bottom: 4px;
  }
  .intro-tour-label {
    font-size: 9px;
    margin-bottom: 8px;
  }
  .intro-nav-title {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .intro-nav-content {
    margin-bottom: 12px;
  }
  .intro-button {
    font-size: 12px;
    padding: 9px 26px;
  }
}

/* Tablets portrait (768px – 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .intro-logo {
    max-width: 520px;
  }
  .intro-logo-container {
    margin-bottom: 8px;
  }
  .intro-title {
    font-size: 44px;
  }
  .intro-title .cabanatuan {
    font-size: 34px;
  }
  .intro-subtitle {
    font-size: 34px;
  }
  .intro-tour-label {
    font-size: 24px;
  }
  .intro-nav-title {
    font-size: 19px;
    margin-bottom: 28px;
  }
  .intro-nav-content {
    margin-bottom: 32px;
  }
  .intro-button {
    font-size: 16px;
    padding: 16px 42px;
  }
}

/* Tablets landscape / small laptops (1025px – 1279px) */
@media (min-width: 1025px) and (max-width: 1279px) {
  .intro-logo {
    max-width: 680px;
  }
  .intro-title {
    font-size: 54px;
  }
  .intro-title .cabanatuan {
    font-size: 44px;
  }
  .intro-subtitle {
    font-size: 44px;
  }
  .intro-tour-label {
    font-size: 34px;
  }
  .intro-nav-title {
    font-size: 24px;
  }
  .intro-nav-content {
    margin-bottom: 38px;
  }
  .intro-button {
    font-size: 16px;
    padding: 18px 46px;
  }
}

/* Desktops (1280px+) */
@media (min-width: 1280px) {
  .intro-logo {
    max-width: 820px;
  }
  .intro-title {
    font-size: 66px;
  }
  .intro-title .cabanatuan {
    font-size: 54px;
  }
  .intro-subtitle {
    font-size: 54px;
  }
  .intro-tour-label {
    font-size: 44px;
  }
  .intro-nav-title {
    font-size: 28px;
  }
  .intro-nav-content {
    margin-bottom: 48px;
  }
  .intro-button {
    font-size: 18px;
    padding: 22px 56px;
  }
}

/* Short screens (height < 700px) */
@media (max-height: 700px) {
  .intro-content {
    min-height: auto;
    padding: 10px 14px;
  }
  .intro-logo {
    max-width: 300px;
  }
  .intro-logo-container {
    margin-bottom: 4px;
  }
  .intro-title {
    font-size: 32px;
    margin: 2px 0;
  }
  .intro-title .cabanatuan {
    font-size: 25px;
  }
  .intro-subtitle {
    font-size: 25px;
    margin-bottom: 4px;
  }
  .intro-tour-label {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .intro-nav-title {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .intro-nav-content {
    margin-bottom: 18px;
  }
  .intro-button {
    font-size: 13px;
    padding: 11px 32px;
  }
}

/* Very short screens (height < 600px) */
@media (max-height: 600px) {
  .intro-content {
    padding: 6px 12px;
  }
  .intro-logo {
    max-width: 200px;
  }
  .intro-logo-container {
    margin-bottom: 3px;
  }
  .intro-title {
    font-size: 24px;
    margin: 2px 0;
  }
  .intro-title .cabanatuan {
    font-size: 19px;
  }
  .intro-subtitle {
    font-size: 19px;
    margin-bottom: 3px;
  }
  .intro-tour-label {
    font-size: 10px;
    margin-bottom: 7px;
  }
  .intro-nav-title {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .intro-nav-content {
    margin-bottom: 12px;
  }
  .intro-button {
    font-size: 12px;
    padding: 9px 26px;
  }
}

/* 4K / large displays (1920px+) */
@media (min-width: 1920px) {
  .intro-logo {
    max-width: 1000px;
  }
  .intro-title {
    font-size: 80px;
  }
  .intro-title .cabanatuan {
    font-size: 65px;
  }
  .intro-subtitle {
    font-size: 65px;
  }
  .intro-tour-label {
    font-size: 52px;
  }
  .intro-nav-title {
    font-size: 34px;
  }
  .intro-button {
    font-size: 20px;
    padding: 26px 64px;
  }
}
