/* ==========================================================================
   KAVALON MAP - DESIGN SYSTEM & STYLES (PROFESSIONAL BLUE & WHITE)
   Minimalist, Enterprise-Grade UI with Crisp White Cards & Deep Navy Accents
   ========================================================================== */

:root {
  /* Brand Navy & Blue Palette */
  --navy-950: #040916;        /* Deepest Midnight Base */
  --navy-900: #08162E;        /* Midnight Sapphire Blue */
  --navy-850: #0D2246;        /* Rich Sapphire Blue */
  --navy-800: #122F5E;        /* Architectural Building Base */
  --navy-700: #1B4486;        /* Secondary Blue / Wall accents */
  
  --blue-primary: #1D4ED8;    /* Corporate Royal Blue (Action / Primary) */
  --blue-hover: #1E40AF;      /* Darker Blue on Hover */
  --blue-vibrant: #2563EB;    /* Vibrant Blue Highlight */
  --blue-soft: #EFF6FF;       /* Light Ice Blue (Badges / Icon backgrounds) */
  --blue-border: #BFDBFE;     /* Soft Blue Border */

  /* Neutral Crisp White & Slates */
  --white: #FFFFFF;           /* Crisp White Cards & Surfaces */
  --slate-50: #F8FAFC;        /* Sub-card backgrounds */
  --slate-100: #F1F5F9;       /* Input backgrounds & inactive pills */
  --slate-200: #E2E8F0;       /* Crisp divider lines & borders */
  --slate-300: #CBD5E1;       /* Subtle borders */
  --slate-400: #94A3B8;       /* Muted icons */
  --slate-500: #64748B;       /* Secondary text */
  --slate-700: #334155;       /* Regular text */
  --slate-800: #1E293B;       /* Dark text */
  --slate-900: #0F172A;       /* Primary bold headings on white */

  /* Functional Accents */
  --accent-green: #059669;    /* Start Point / Success */
  --accent-green-soft: #ECFDF5;
  --accent-red: #DC2626;      /* Destination / Warning */
  --accent-red-soft: #FEF2F2;
  --accent-amber: #D97706;    /* Parking / Alert */
  --accent-purple: #7C3AED;   /* Stairs / Elevators */
  --accent-orange: #EA580C;   /* Meetings */

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.18);
  --shadow-floating: 0 12px 36px rgba(0, 0, 0, 0.35);

  /* Fonts & Radius */
  --font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: 
    radial-gradient(ellipse 900px 700px at 50% 25%, #0e2954 0%, #081734 50%, #030712 100%),
    #030712;
  color: var(--slate-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 16px;
}

/* Studio Reference Preview Wrapper */
.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
}

/* Top Studio Bar for toggling view */
.studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  margin-bottom: 12px;
  padding: 8px 16px;
  background: rgba(10, 24, 52, 0.85);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.studio-brand i {
  color: #60A5FA;
}

.studio-brand span {
  color: #60A5FA;
  font-weight: 800;
}

.view-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.view-toggle-btn:hover {
  background: var(--blue-primary);
  color: var(--white);
  border-color: var(--blue-primary);
}

/* ==========================================================================
   SMARTPHONE FRAME (Mobile App Container)
   ========================================================================== */
.device-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 850px;
  background: #061124;
  border-radius: 46px;
  box-shadow: 
    0 0 0 10px #0b1a34,
    0 0 0 12px #18335e,
    0 0 45px rgba(29, 78, 216, 0.35),
    0 24px 60px rgba(2, 6, 14, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

/* Fullscreen mode toggle */
body.fullscreen-mode {
  padding: 0;
  background: 
    radial-gradient(ellipse at 50% 25%, #0F2A56 0%, #091A38 45%, #040914 100%),
    #040914;
}

body.fullscreen-mode .preview-container {
  max-width: 100%;
}

body.fullscreen-mode .studio-bar {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 1000;
  width: auto;
  max-width: none;
  background: rgba(10, 24, 52, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  margin-bottom: 0;
  display: flex;
}

body.fullscreen-mode .studio-bar .studio-brand {
  display: none;
}

body.fullscreen-mode .view-toggle-btn {
  background: var(--blue-primary);
  color: var(--white);
  border-color: var(--blue-primary);
  font-size: 11.5px;
  padding: 6px 14px;
}

body.fullscreen-mode .device-wrapper {
  max-width: 100%;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Hide mobile hardware elements in fullscreen desktop mode */
body.fullscreen-mode .device-notch {
  display: none !important;
}

body.fullscreen-mode .status-bar {
  display: none !important;
}

/* Mobile Hardware Elements (Speaker & Notch) */
.device-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 24px;
  background: #020617;
  border-radius: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-notch .camera-lens {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0F172A;
  border: 1px solid #1E293B;
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 8px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  z-index: 90;
  background: transparent;
  flex-shrink: 0;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

/* ==========================================================================
   APP MAIN CONTAINER & PAGES
   ========================================================================== */
.app-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(ellipse 380px 320px at 50% 150px, rgba(30, 64, 175, 0.45) 0%, rgba(29, 78, 216, 0.22) 45%, rgba(6, 17, 36, 0) 75%),
    linear-gradient(180deg, #071328 0%, #0C2144 32%, #081730 65%, #040914 100%);
  background-attachment: fixed;
}


.page {
  position: absolute;
  inset: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  padding-bottom: 96px;
}

.page.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.page > * {
  flex-shrink: 0;
}

/* Custom Scrollbar */
.page::-webkit-scrollbar {
  width: 4px;
}
.page::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ==========================================================================
   PAGE 1: HOME PAGE (หน้าหลัก - Professional Blue & White)
   ========================================================================== */
.home-page {
  padding: 16px 20px 100px 20px;
  gap: 16px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Header Brand (Centered Hero Presentation) */
.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0 8px 0;
  position: relative;
  z-index: 2;
}

.brand-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-wrapper h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #FFFFFF;
  line-height: 1.15;
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
}

.brand-wrapper p {
  font-size: 11px;
  color: #93C5FD;
  letter-spacing: 2.5px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 6px;
  text-shadow: 0 0 12px rgba(29, 78, 216, 0.5);
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--white);
  color: var(--blue-primary);
}

/* Current Location Card (Luxury Dark Sapphire Glass) */
.current-loc-card {
  background: rgba(12, 26, 54, 0.85);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-left: 5px solid #38BDF8;
}

.loc-badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #34D399;
  font-weight: 700;
  margin-bottom: 6px;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

.loc-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.loc-sub {
  font-size: 11px;
  color: #93C5FD;
  display: flex;
  align-items: center;
  gap: 5px;
}

.loc-sub i {
  color: #38BDF8;
}

.loc-action-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.btn-scan-again {
  flex: 1;
  background: rgba(29, 78, 216, 0.35);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #FFFFFF;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-scan-again:hover {
  background: var(--blue-primary);
  color: var(--white);
  border-color: #60A5FA;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.5);
}

/* Quick Scan Banner (Executive Deep Royal Blue) */
.quick-scan-banner {
  background: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.quick-scan-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.35);
}

.scan-banner-info h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 3px;
}

.scan-banner-info p {
  font-size: 11px;
  color: #BFDBFE;
  max-width: 220px;
  line-height: 1.35;
}

.scan-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 24px;
  flex-shrink: 0;
}

/* Section Titles */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
}

.section-title a, .section-title span {
  font-size: 11px;
  color: #93C5FD;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.section-title span:hover {
  color: var(--white);
}

/* Shortcuts Grid (Luxury Dark Sapphire Glass Cards) */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.shortcut-item {
  background: rgba(12, 26, 54, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
  text-align: center;
}

.shortcut-item:hover {
  transform: translateY(-3px);
  border-color: #38BDF8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  background: rgba(20, 42, 85, 0.9);
}

.shortcut-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(30, 64, 175, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #38BDF8;
  transition: var(--transition);
}

.shortcut-item:hover .shortcut-icon {
  background: var(--blue-primary);
  color: var(--white);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

.shortcut-item span {
  font-size: 11px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.2;
  white-space: nowrap;
}

/* Popular Destinations List (Luxury Dark Sapphire Glass Cards) */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dest-card {
  background: rgba(12, 26, 54, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}

.dest-card:hover {
  transform: translateX(3px);
  border-color: #38BDF8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.3);
  background: rgba(20, 42, 85, 0.9);
}

.dest-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dest-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(30, 64, 175, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}

.dest-details h4 {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.dest-details p {
  font-size: 11px;
  color: #93C5FD;
}

.dest-go-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #93C5FD;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition);
}

.dest-card:hover .dest-go-btn {
  background: var(--blue-primary);
  color: var(--white);
  border-color: #60A5FA;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

/* ==========================================================================
   PAGE 2: MAP PAGE (แผนที่ - Clean Architectural Background + White Overlays)
   ========================================================================== */
.map-page {
  padding: 0;
  position: absolute;
  inset: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--navy-950);
}

/* Search Header overlay on Map (Luxury Dark Sapphire Floating Card) */
.map-search-header {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 24, 52, 0.94);
  backdrop-filter: blur(20px);
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(29, 78, 216, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Search Input Rows */
.search-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 36, 74, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: var(--transition);
}

.search-input-row:focus-within {
  border-color: #38BDF8;
  background: rgba(20, 44, 90, 0.9);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.search-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-dot.start {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.5);
}

.search-dot.dest {
  background: var(--accent-red);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.5);
}

.search-select {
  flex: 1;
  min-width: 0;
  width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.search-select option {
  background: #08162E;
  color: #FFFFFF;
}

.scan-qr-btn-inline {
  flex-shrink: 0;
  white-space: nowrap;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
}

.scan-qr-btn-inline:hover {
  background: var(--blue-hover);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.6);
}

/* Floor Switcher & Action Controls Floating on Map */
.map-floating-controls {
  position: absolute;
  top: 132px;
  right: 14px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floor-pill-group {
  display: flex;
  flex-direction: column;
  background: rgba(10, 24, 52, 0.92);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.floor-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #93C5FD;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.floor-btn.active {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: var(--white);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
}

.map-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 24, 52, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.map-action-btn:hover {
  background: var(--blue-soft);
  color: var(--blue-primary);
  border-color: var(--blue-border);
}

/* SVG Map Viewport */
.map-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, #0d2247 0%, #071328 65%, #040914 100%);
  overflow: hidden;
  cursor: grab;
  z-index: 1;
}

.map-viewport:active {
  cursor: grabbing;
}

#indoor-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   FLOATING MAP EXPLORER DRAWER (Crisp White Sheet like Mockup Screen 2)
   ========================================================================== */
.map-explorer-card {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  background: rgba(10, 24, 52, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 12px 16px 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.map-explorer-card.collapsed {
  max-height: 52px;
  overflow: hidden;
  padding-bottom: 12px;
}

.map-explorer-card.collapsed .explorer-chips,
.map-explorer-card.collapsed .explorer-list {
  display: none;
}

.explorer-handle-bar {
  display: flex;
  justify-content: center;
  margin-bottom: -4px;
  cursor: pointer;
  padding: 4px;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(96, 165, 250, 0.4);
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.explorer-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.explorer-header p {
  font-size: 10px;
  color: #93C5FD;
}

.explorer-badge {
  background: rgba(29, 78, 216, 0.35);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #38BDF8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.explorer-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.explorer-chips::-webkit-scrollbar {
  display: none;
}

.exp-chip {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.exp-chip.active, .exp-chip:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: var(--white);
  border-color: #60A5FA;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

.explorer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 145px;
  overflow-y: auto;
  scrollbar-width: none;
  padding-right: 2px;
}
.explorer-list::-webkit-scrollbar {
  display: none;
}

.exp-item-card {
  background: rgba(16, 36, 74, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.exp-item-card:hover {
  background: rgba(26, 54, 106, 0.9);
  border-color: #38BDF8;
  transform: translateX(3px);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.exp-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exp-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(30, 64, 175, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.exp-item-info h4 {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.exp-item-info p {
  font-size: 10px;
  color: #93C5FD;
}

.exp-item-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #93C5FD;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: var(--transition);
}

.exp-item-card:hover .exp-item-btn {
  background: var(--blue-primary);
  color: var(--white);
  border-color: #60A5FA;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

/* Route Guidance Bottom Drawer (When route is active) */
.route-guidance-card {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  background: rgba(10, 24, 52, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.guidance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.guidance-stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stat-time {
  font-size: 20px;
  font-weight: 800;
  color: #38BDF8;
}

.stat-dist {
  font-size: 13px;
  font-weight: 600;
  color: #93C5FD;
}

.btn-clear-route {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-clear-route:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: var(--white);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.5);
}

.turn-step-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 36, 74, 0.7);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.turn-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(29, 78, 216, 0.35);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.turn-text {
  font-size: 12px;
  color: #FFFFFF;
  font-weight: 600;
  line-height: 1.35;
}

/* Room Quick Info Modal Bottom Sheet */
.room-bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 520px;
  background: rgba(10, 24, 52, 0.96);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(59, 130, 246, 0.35);
  border-left: 1px solid rgba(59, 130, 246, 0.35);
  border-right: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 28px 28px 0 0;
  padding: 16px 20px 92px 20px;
  z-index: 60;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
}

.room-bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-room-name {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.sheet-room-cat {
  font-size: 12px;
  color: #38BDF8;
  font-weight: 600;
  margin-bottom: 8px;
}

.sheet-room-desc {
  font-size: 12px;
  color: #CBD5E1;
  line-height: 1.4;
  margin-bottom: 14px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.sheet-btn-navigate {
  flex: 1;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
  transition: var(--transition);
}

.sheet-btn-navigate:hover {
  background: var(--blue-hover);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.7);
}

.sheet-btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   PAGE 3: ROOMS & DIRECTORY (ห้อง - Crisp White Cards)
   ========================================================================== */
.rooms-page {
  padding: 16px 20px 100px 20px;
  gap: 14px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.rooms-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 2px;
}

.rooms-header p {
  font-size: 11px;
  color: #93C5FD;
}

/* Search bar in Rooms */
.rooms-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 26, 54, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.rooms-search-box:focus-within {
  border-color: #38BDF8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  background: rgba(18, 38, 76, 0.95);
}

.rooms-search-box i {
  color: #38BDF8;
}

.rooms-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
}

.rooms-search-box input::placeholder {
  color: #93C5FD;
  opacity: 0.6;
}

/* Floor Tabs (ชั้น 1 / ชั้น 2) */
.floor-tab-switch {
  display: flex;
  background: rgba(10, 24, 52, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: #93C5FD;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.tab-btn.active {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

/* Category Filter Pills */
.category-filter-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.category-filter-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cat-pill:hover, .cat-pill.active {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: #FFFFFF;
  border-color: #60A5FA;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

/* Room Items List */
.room-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-dir-card {
  background: rgba(12, 26, 54, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}

.room-dir-card:hover {
  border-color: #38BDF8;
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.3);
  background: rgba(20, 42, 85, 0.9);
}

.dir-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dir-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(30, 64, 175, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #38BDF8;
}

.dir-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.dir-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #93C5FD;
}

.tag-badge.floor {
  background: rgba(29, 78, 216, 0.35);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #38BDF8;
}

.btn-dir-navigate {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
}

.btn-dir-navigate:hover {
  background: var(--blue-hover);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.65);
}

/* ==========================================================================
   PAGE 4: QR SCANNER MODAL / VIEW
   ========================================================================== */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(16px);
  z-index: 999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.qr-modal.open {
  display: flex;
  opacity: 1;
}

.qr-modal-content {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.qr-modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qr-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
}

.qr-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* Viewfinder Camera Box */
.viewfinder-box {
  width: 240px;
  height: 240px;
  position: relative;
  border-radius: 20px;
  background: #0B172E;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(29, 78, 216, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Viewfinder Reticle Corners */
.reticle-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #60A5FA;
  border-style: solid;
}
.corner-tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; border-top-left-radius: 6px; }
.corner-tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; border-top-right-radius: 6px; }
.corner-bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; border-bottom-left-radius: 6px; }
.corner-br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; border-bottom-right-radius: 6px; }

/* Laser Scanner Beam */
.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38BDF8, transparent);
  box-shadow: 0 0 12px #38BDF8;
  animation: laserScan 2.2s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 12%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 88%; opacity: 0.3; }
}

.viewfinder-tech-bg {
  opacity: 0.12;
  font-size: 64px;
  color: #60A5FA;
}

.scanner-hint {
  text-align: center;
  font-size: 12px;
  color: var(--slate-400);
}

/* Simulated Checkpoints Buttons */
.simulated-qr-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulated-qr-title {
  font-size: 11px;
  font-weight: 700;
  color: #93C5FD;
  text-align: center;
  letter-spacing: 0.5px;
}

.qr-presets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}

.qr-preset-item {
  background: rgba(12, 26, 54, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.qr-preset-item:hover {
  border-color: #38BDF8;
  transform: translateX(3px);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
  background: rgba(20, 42, 85, 0.9);
}

.qr-preset-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-code-icon {
  font-size: 18px;
  color: #38BDF8;
}

.qr-preset-info h5 {
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
}

.qr-preset-info p {
  font-size: 10px;
  color: #93C5FD;
}

.qr-tap-badge {
  background: rgba(29, 78, 216, 0.35);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #38BDF8;
}

/* ==========================================================================
   FLOATING BOTTOM NAVIGATION BAR (Luxury Dark Sapphire Pill)
   ========================================================================== */
.bottom-dock-nav {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 360px;
  height: 62px;
  background: rgba(10, 22, 46, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(29, 78, 216, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  z-index: 80;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94A3B8;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  position: relative;
}

.dock-icon {
  font-size: 18px;
  transition: var(--transition);
}

.dock-item.active {
  color: #38BDF8;
}

.dock-item.active .dock-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: #38BDF8;
  box-shadow: 0 0 8px #38BDF8;
}

/* Center Prominent Scan Button */
.dock-scan-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%);
  border: 3px solid rgba(10, 22, 46, 0.9);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.65), 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: translateY(-6px);
  transition: var(--transition);
}

.dock-scan-btn:hover {
  transform: translateY(-9px) scale(1.05);
  box-shadow: 0 0 26px rgba(59, 130, 246, 0.8), 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-notice {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-900);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.toast-icon {
  color: var(--accent-green);
  font-size: 16px;
}
