@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Common Variables */
  --font-title: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Section Accent Colors (Dynamic & Vibrant) */
  --color-sec-a: #10b981; /* Emerald */
  --color-sec-b: #06b6d4; /* Cyan */
  --color-sec-c: #f59e0b; /* Amber */
  --color-sec-d: #6366f1; /* Indigo */
  --color-sec-e: #8b5cf6; /* Violet */
  --color-sec-f: #ec4899; /* Rose */
  --color-sec-g: #14b8a6; /* Teal */
  --color-sec-h: #0ea5e9; /* Sky Blue */
  --color-sec-special: #f43f5e; /* Coral */
  --color-star: #eab308; /* Star Gold */

  /* Default Theme (Dark Mode) */
  --bg-app: #09090b;
  --bg-card: rgba(24, 24, 27, 0.65);
  --bg-card-hover: rgba(39, 39, 42, 0.8);
  --border-color: rgba(63, 63, 70, 0.4);
  --border-color-glow: rgba(99, 102, 241, 0.4);
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-contrast: #ffffff;
  --glass-bg: rgba(9, 9, 11, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --input-bg: rgba(39, 39, 42, 0.5);
  --btn-secondary: rgba(63, 63, 70, 0.5);
  --btn-secondary-hover: rgba(82, 82, 91, 0.8);
  --map-grid-color: rgba(63, 63, 70, 0.15);
  --scrollbar-thumb: rgba(161, 161, 170, 0.3);
}

[data-theme="light"] {
  /* Light Mode Overrides */
  --bg-app: #f4f4f5;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(228, 228, 231, 0.8);
  --border-color-glow: rgba(99, 102, 241, 0.2);
  --text-main: #18181b;
  --text-muted: #71717a;
  --text-contrast: #09091b;
  --glass-bg: rgba(244, 244, 245, 0.6);
  --glass-border: rgba(0, 0, 0, 0.06);
  --shadow-main: 0 8px 32px 0 rgba(24, 24, 27, 0.08);
  --input-bg: rgba(228, 228, 231, 0.6);
  --btn-secondary: rgba(228, 228, 231, 0.8);
  --btn-secondary-hover: rgba(212, 212, 216, 0.9);
  --map-grid-color: rgba(228, 228, 231, 0.6);
  --scrollbar-thumb: rgba(113, 113, 122, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Header Container */
header {
  padding: 1.25rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

header h1 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header h1 span {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Premium Buttons */
.btn {
  background-color: var(--btn-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn:hover {
  background-color: var(--btn-secondary-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: var(--text-contrast);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.theme-toggle-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 1fr 400px;
  flex: 1;
  overflow: hidden;
  position: relative;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 400px;
  }
}

/* Left panel: Map Area */
.map-panel {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
  border-right: 1px solid var(--border-color);
}

@media (max-width: 1024px) {
  .map-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.map-title-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
}

.map-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.map-controls {
  display: flex;
  gap: 0.5rem;
}

.map-viewport {
  flex: 1;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden; /* Prevent scrollbars from breaking custom pan transform */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
}

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

/* SVG Map Render styling */
svg.exhibition-map {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -480px; /* - (svgWidth / 2) */
  margin-top: -320px;  /* - (svgHeight / 2) */
  background-color: var(--bg-card);
  box-shadow: var(--shadow-main);
  border-radius: var(--radius-md);
  transform-origin: center center;
  transition: transform 0.1s ease-out;
}

/* Map Grid Pattern */
.map-grid {
  fill: none;
  stroke: var(--map-grid-color);
  stroke-width: 1;
}

/* Booth Graphics styling */
.booth-rect {
  cursor: pointer;
  rx: 4px;
  ry: 4px;
  stroke-width: 1.5;
  transition: filter var(--transition-fast), stroke-width var(--transition-fast), stroke var(--transition-fast);
}

.booth-rect[data-section="A"] { fill: rgba(16, 185, 129, 0.12); stroke: var(--color-sec-a); }
.booth-rect[data-section="B"] { fill: rgba(6, 182, 212, 0.12); stroke: var(--color-sec-b); }
.booth-rect[data-section="C"] { fill: rgba(245, 158, 11, 0.12); stroke: var(--color-sec-c); }
.booth-rect[data-section="D"] { fill: rgba(99, 102, 241, 0.12); stroke: var(--color-sec-d); }
.booth-rect[data-section="E"] { fill: rgba(139, 92, 246, 0.12); stroke: var(--color-sec-e); }
.booth-rect[data-section="F"] { fill: rgba(236, 72, 153, 0.12); stroke: var(--color-sec-f); }
.booth-rect[data-section="G"] { fill: rgba(20, 184, 166, 0.12); stroke: var(--color-sec-g); }
.booth-rect[data-section="H"] { fill: rgba(14, 165, 233, 0.12); stroke: var(--color-sec-h); }
.booth-rect[data-section="SPECIAL"] { fill: rgba(244, 63, 94, 0.15); stroke: var(--color-sec-special); }

/* Unassigned Empty Booth styling */
.booth-rect.unassigned {
  fill: rgba(161, 161, 170, 0.05) !important;
  stroke: rgba(161, 161, 170, 0.25) !important;
  stroke-width: 1;
  stroke-dasharray: 3, 3;
}

.booth-rect.unassigned:hover {
  fill: rgba(161, 161, 170, 0.12) !important;
  stroke: rgba(161, 161, 170, 0.5) !important;
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.booth-label.unassigned {
  fill: var(--text-muted);
  opacity: 0.35;
  font-weight: 400;
  font-size: 9px;
}

/* Pillar Styling */
.map-pillar {
  fill: #3f3f46;
  stroke: #18181b;
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

[data-theme="light"] .map-pillar {
  fill: #d4d4d8;
  stroke: #71717a;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Facility Styling (Entrances, Exits, Registration) */
.booth-rect.facility {
  fill: rgba(30, 41, 59, 0.4) !important;
  stroke: #475569 !important;
  stroke-width: 1.5;
  stroke-dasharray: 2, 2;
}

.booth-label.facility {
  fill: #94a3b8;
  font-weight: 700;
  font-size: 8px !important;
  font-family: var(--font-title);
  opacity: 0.9;
}

[data-theme="light"] .booth-rect.facility {
  fill: rgba(241, 245, 249, 0.6) !important;
  stroke: #94a3b8 !important;
}

[data-theme="light"] .booth-label.facility {
  fill: #475569;
}

/* Booth label name text */
.booth-label-name {
  font-family: var(--font-body);
  font-size: 6.2px;
  font-weight: 500;
  fill: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
  user-select: none;
}

[data-theme="light"] .booth-label-name {
  fill: rgba(24, 24, 27, 0.75);
}

.booth-label-name.special {
  font-size: 8px;
  font-weight: 700;
  fill: var(--color-sec-special);
}

[data-theme="light"] .booth-label-name.special {
  fill: var(--color-sec-special);
}

/* Hover state */
.booth-rect:hover {
  filter: brightness(1.25) drop-shadow(0 0 6px var(--border-color-glow));
  stroke-width: 2.5;
}

/* Active Selected Booth State */
.booth-rect.active {
  stroke: var(--color-star) !important;
  stroke-width: 3.5;
  filter: brightness(1.3) drop-shadow(0 0 12px var(--color-star));
  animation: pulse-border 1.5s infinite alternate;
}

@keyframes pulse-border {
  from {
    filter: brightness(1.3) drop-shadow(0 0 6px var(--color-star));
  }
  to {
    filter: brightness(1.5) drop-shadow(0 0 16px var(--color-star));
  }
}

/* Starred Booth map highlight */
.booth-rect.starred {
  fill-opacity: 0.35;
}

/* Visited Booth Map dimming */
.booth-rect.visited {
  fill-opacity: 0.05;
  stroke-dasharray: 4, 3;
}

/* Booth labels text */
.booth-label {
  font-family: var(--font-title);
  font-size: 8.5px;
  font-weight: 800;
  fill: var(--text-main);
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
  user-select: none;
}

.booth-label-bg {
  fill: var(--bg-app);
  opacity: 0.7;
  rx: 2px;
  ry: 2px;
  pointer-events: none;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid transparent;
}

/* Right Panel: Sidebar Planner & Directory */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--glass-bg);
  backdrop-filter: blur(10px);
}

/* Settings Panel (Default hidden) */
.settings-panel {
  display: none;
}

/* Sidebar Header & Search */
.sidebar-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.search-box {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1rem 0.75rem 2.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Tabs */
.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.85rem 0.5rem;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: #818cf8;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

/* Category Filters Scrollable Bar */
.filter-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.filter-scroll::-webkit-scrollbar {
  display: none; /* Hide scrollbar for category tag slider */
}

.tag-btn {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  background-color: var(--btn-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.tag-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: var(--text-contrast);
}

/* Selected Detail Card */
.detail-card-container {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(99, 102, 241, 0.03);
  display: none; /* Show only when active */
}

.detail-card-container.active {
  display: block;
  animation: slide-down 0.3s ease-out;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.detail-booth-badge {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-contrast);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.detail-controls {
  display: flex;
  gap: 0.4rem;
}

.detail-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.detail-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background-color: var(--btn-secondary);
  color: var(--text-muted);
}

/* Memo Display Box inside Detail Panel */
.detail-memo-box {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  position: relative;
  margin-top: 0.75rem;
}

.detail-memo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-memo-text {
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
}

.detail-memo-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Exhibitor Scroll List */
.exhibitors-list {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  gap: 0.75rem;
}

.empty-state svg {
  opacity: 0.4;
}

.exhibitor-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.exhibitor-card:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-color-glow);
}

.exhibitor-card.active {
  border-color: #6366f1;
  background-color: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.1);
}

.exhibitor-card.starred::before {
  content: '★';
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  color: var(--color-star);
  font-size: 1.1rem;
  filter: drop-shadow(0 0 4px rgba(234, 179, 8, 0.3));
}

.exhibitor-card.visited {
  opacity: 0.55;
  background-color: rgba(24, 24, 27, 0.3);
}

.exhibitor-card.visited .exhibitor-card-title {
  text-decoration: line-through;
}

.exhibitor-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.booth-badge {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: var(--text-contrast);
}

.exhibitor-card-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 82%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exhibitor-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.exhibitor-card-memo-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border-left: 2px solid #8b5cf6;
  margin-top: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modals & Dialogs styling */
dialog {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  color: var(--text-main);
  margin: auto;
  max-width: 480px;
  width: 90%;
  padding: 1.75rem;
  outline: none;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog-header {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dialog-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-textarea {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-textarea:focus {
  border-color: #6366f1;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast Notifications styling */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid #6366f1;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  color: var(--text-main);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

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

/* Mobile Bottom Navigation Tab Bar Styling */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 0.35rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  z-index: 999;
  gap: 0.4rem;
  width: auto;
  max-width: 95%;
  justify-content: space-around;
}

[data-theme="light"] .mobile-nav-bar {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.nav-tab {
  background: none;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border-radius: 100px;
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap; /* Prevent vertical text wrapping */
}

.nav-tab svg {
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.nav-tab.active {
  background: var(--btn-primary);
  color: #ffffff;
}

.nav-tab.active svg {
  opacity: 1;
  transform: scale(1.1);
}

/* Close detail button styling */
.close-detail-btn {
  background: none !important;
  border: none !important;
  font-size: 1.15rem !important;
  padding: 0.25rem 0.5rem !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  line-height: 1;
}

.close-detail-btn:hover {
  color: var(--text-main) !important;
}

/* Responsive Media Queries */

/* Tablet Viewport (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr 320px; /* Slimmer sidebar */
  }
  .sidebar-panel {
    width: 320px;
    min-width: 320px;
  }
  header h1 {
    font-size: 1.15rem;
  }
}

/* Mobile Viewport (< 768px) */
@media (max-width: 768px) {
  /* Header adjustments */
  header {
    padding: 0.75rem 1.25rem;
    justify-content: center; /* Center header content */
    gap: 0.5rem;
  }
  
  header h1 {
    font-size: 1.15rem;
  }
  
  .header-controls {
    display: none !important; /* Hide desktop header controls, moved to mobile Settings tab */
  }

  /* Split layout behaves as full-screen tabs on mobile */
  .app-container {
    display: block;
    height: calc(100vh - 50px - 4rem); /* dynamic fit minus footer */
    position: relative;
  }
  
  /* Conditionally show panels based on body state */
  body.show-map-view .map-panel {
    display: flex;
  }
  body.show-map-view .sidebar-panel,
  body.show-map-view .settings-panel {
    display: none;
  }
  
  body.show-list-view .sidebar-panel {
    display: flex;
    width: 100%;
    height: 100%;
  }
  body.show-list-view .map-panel,
  body.show-list-view .settings-panel {
    display: none;
  }

  body.show-settings-view .settings-panel {
    display: flex;
    width: 100%;
    height: 100%;
  }
  body.show-settings-view .map-panel,
  body.show-settings-view .sidebar-panel {
    display: none;
  }

  .map-panel {
    height: 100%;
    padding: 0.75rem;
    border-bottom: none;
  }

  .map-toolbar {
    margin-bottom: 0.5rem;
  }
  
  .map-title-bar {
    display: none; /* Hide map subtitle/title on mobile for spacing */
  }

  .map-viewport {
    height: calc(100% - 40px); /* Leave room for toolbar */
  }

  .sidebar-panel {
    padding: 0; /* Let inner elements control padding for better fit */
    border-top: none;
    height: 100%;
    overflow-y: auto;
    backdrop-filter: none !important; /* Disable to prevent stacking context trap */
    background-color: var(--bg-main) !important; /* Ensure solid background without backdrop filter */
  }

  /* Compact Search & Tabs inside mobile */
  .sidebar-header {
    padding: 0.65rem 0.75rem 0.4rem 0.75rem;
  }
  .search-box {
    margin-bottom: 0.25rem;
  }
  .search-input {
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-size: 0.85rem;
  }
  .tab-btn {
    padding: 0.65rem 0.25rem;
    font-size: 0.8rem;
  }

  /* Floating details panel styling (sits above mobile tab bar) */
  .detail-card-container {
    position: fixed;
    bottom: 5.8rem; /* Sits directly above floating mobile-nav-bar */
    left: 4%;
    width: 92%;
    margin: 0;
    border-radius: 16px; /* Rounded corners on all sides */
    border: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1005 !important;
    transform: translateY(calc(100% + 7rem)); /* Completely hidden below viewport */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    max-height: 55vh; /* Keep it compact so it doesn't cover top header */
    overflow-y: auto;
    padding: 1.25rem 1.25rem 1.5rem 1.25rem; /* Regular padding, no massive bottom padding needed */
  }

  [data-theme="light"] .detail-card-container {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  }

  .detail-card-container.active {
    transform: translateY(0);
  }

  /* Mobile bottom sheet drag handle look */
  .detail-card-container::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 0.25rem auto 0.75rem auto;
  }

  /* Scrollable Dialog Modals when Keyboard is Open */
  dialog {
    max-height: 82vh;
    overflow-y: auto;
    width: 92%;
    padding: 1.25rem;
    margin: 8vh auto auto auto;
  }

  /* Adjust list items card sizes for touch targets */
  .exhibitors-list {
    padding: 0 0.75rem;
    margin-bottom: 5.5rem; /* leave space for floating nav bar */
  }

  .exhibitor-card {
    padding: 0.75rem;
  }

  .exhibitor-card-title {
    font-size: 0.85rem;
  }

  /* Mobile Settings Panel Layout */
  .settings-panel {
    display: none; /* hidden by default, shown via body.show-settings-view */
    flex-direction: column;
    padding: 1.25rem;
    height: 100%;
    overflow-y: auto;
    background-color: var(--bg-main);
  }
  
  .settings-header h2 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
  }
  
  .settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  
  .settings-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }
  
  .settings-card-title {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
  }
  
  .settings-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
  }
  
  .settings-actions-row {
    display: flex;
    gap: 0.75rem;
  }
  
  .btn-settings {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: var(--btn-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  
  .btn-settings:active {
    background-color: var(--border-color-glow);
    transform: scale(0.98);
  }
  
  #mobile-theme-btn {
    align-self: flex-start;
    padding: 0.75rem 1.25rem;
    flex: none;
    width: auto;
  }

  /* Display bottom nav bar on mobile */
  .mobile-nav-bar {
    display: flex;
  }
  
  .map-legend {
    display: none; /* Hide legend on mobile to maximize map viewport */
  }
  
  .toast {
    bottom: 6.5rem;
  }

}

/* Card Flash Highlight Animation */
@keyframes card-flash-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.8);
    border-color: #6366f1;
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 24px 10px rgba(99, 102, 241, 0.5);
    border-color: #6366f1;
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    border-color: var(--border-color);
    transform: scale(1);
  }
}

.exhibitor-card.flash-highlight {
  animation: card-flash-glow 1.2s ease-in-out;
  border-color: #6366f1 !important;
  z-index: 10;
}

