:root {
  --header-height: 5rem;
  --panel-top: 6rem;
  /* PGCC brand palette */
  --pgcc-blue: #003d82;            /* PGCC Blue */
  --pgcc-blue-light: #0066cc;      /* Light Blue */
  --pgcc-blue-dark: #002a5c;        /* Dark Blue */
  --pgcc-accent: #00b4d8;           /* Accent Blue */
  --pgcc-gold: #ffb700;             /* PGCC Gold */
  --mc-red: #F92329;                /* Red for contrast */
  --black: #111111;                 /* Brand black for strong text */
  --mc-purple: #51237F;
  --mc-blue: #0095C8;
  --mc-blue-light: #3DA5E6;
  --mc-gold: #FBA93E;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-hover: #f1f5f9;
  --text-primary: #1f2937;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #d0d7e2;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* --- MAP & LOADING --- */
#map-container, #map {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

/* --- 3D PREVIEW PANEL --- */
.preview-panel {
  display: none;
  position: fixed;
  left: 50%;
  top: 10%;
  transform: translateX(-50%);
  width: min(560px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 30;
}
.preview-panel.active { display: block; }
.preview-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.preview-content { padding: 1rem; }
.preview-actions { display: flex; gap: 0.75rem; padding: 1rem; border-top: 1px solid var(--border); }
.preview-actions .action-btn.primary { background: var(--pgcc-blue); }
.preview-actions .action-btn.primary:hover { background: var(--pgcc-blue-light); }

#mapLoading {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--pgcc-blue-dark) 0%, var(--pgcc-blue) 100%);
  display: flex; align-items: center; justify-content: center; z-index: 10001;
}
.loading-content { text-align: center; color: white; }
.loading-content h3 { margin: 1rem 0 0.5rem; font-size: 1.5rem; }
.spinner { width: 48px; height: 48px; border: 4px solid rgba(255, 255, 255, 0.2); border-left-color: white; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- FLOATING HEADER & SEARCH --- */
.main-header {
  position: fixed;
  top: calc(0.75rem + var(--safe-area-top));
  left: calc(0.75rem + var(--safe-area-left));
  right: calc(0.75rem + var(--safe-area-right));
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  transform: translateY(0);
  opacity: 1;
}
.main-header.header-hidden {
  transform: translateY(-150%);
  opacity: 0;
  pointer-events: none;
}
.header-content {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.logo { height: 20px; }
.mobile-nav-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    transition: var(--transition);
    border-radius: var(--radius);
    margin-right: 0.5rem;
}
.mobile-nav-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.search-container { flex: 1; position: relative; }
#searchInput {
  width: 100%;
  padding: 0.75rem 2.5rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
}
.search-container .fa-search { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.clear-btn { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-tertiary); cursor: pointer; padding: 0.5rem; font-size: 1rem; }
.search-suggestions { 
    position: absolute; 
    top: calc(100% + 0.5rem); 
    left: 0; 
    right: 0; 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: var(--radius-lg); 
    max-height: 350px; 
    overflow-y: auto; 
    z-index: 10000; 
    display: none; 
    box-shadow: var(--shadow-xl); 
}

.search-suggestion-item { 
    padding: 0.875rem 1rem; 
    cursor: pointer; 
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-suggestion-item:last-child { border-bottom: none; }

.search-suggestion-item:hover, 
.search-suggestion-item.active { 
    background: var(--pgcc-blue); 
    color: white;
}

.search-suggestion-item:hover .suggestion-type,
.search-suggestion-item.active .suggestion-type {
    color: rgba(255, 255, 255, 0.9);
}

.suggestion-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.search-suggestion-item:hover .suggestion-text,
.search-suggestion-item.active .suggestion-text {
    color: white;
}

.suggestion-type {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-suggestion-item.no-results {
    cursor: default;
    text-align: center;
    padding: 1.5rem 1rem;
}

.search-suggestion-item.no-results:hover {
    background: var(--surface);
}

/* --- MAP CONTROLS (FABS) --- */
.map-controls-group {
  position: fixed;
  right: calc(1rem + var(--safe-area-right));
  bottom: calc(6rem + var(--safe-area-bottom));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.map-fab {
  width: 52px; height: 52px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.map-fab:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.map-fab:active { transform: scale(0.95); }
.map-fab.zoom-out:active { background: var(--mc-red); color: white; }
.map-fab.zoom-in:active { background: var(--pgcc-blue); color: white; }
.location-btn.active { background: var(--pgcc-blue); color: white; animation: pulse 2s infinite; }
.zoom-controls { display: flex; flex-direction: column; background: var(--surface-elevated); border-radius: var(--radius-full); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.zoom-controls .map-fab { width: 52px; height: 52px; border: none; border-radius: 0; box-shadow: none; }
.zoom-controls .zoom-in { border-bottom: 1px solid var(--border); }
.layers-control { position: relative; }
.layers-options { display: none; position: absolute; bottom: 100%; right: 0; margin-bottom: 0.5rem; flex-direction: column; gap: 0.5rem; }
.layers-control.expanded .layers-options { display: flex; }
.layers-options .control-btn { width: 44px; height: 44px; background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 1.125rem; box-shadow: var(--shadow); }
.layers-options .control-btn.active { background: var(--pgcc-blue); color: white; }

/* --- DESKTOP NAVIGATION --- */
.desktop-nav {
  position: fixed;
  left: calc(1rem + var(--safe-area-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.desktop-nav .nav-btn {
  width: 52px; height: 52px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
}
.desktop-nav .nav-btn span { font-size: 0.6rem; font-weight: 500; display: none; } /* Hide text by default */
.desktop-nav .nav-btn:hover { background: var(--background); color: var(--pgcc-blue); }
.desktop-nav .nav-btn.active { background: var(--pgcc-blue-dark); color: white; }

/* --- MOBILE BOTTOM NAVIGATION --- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border);
  padding: 0.375rem 0 calc(0.375rem + var(--safe-area-bottom));
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  height: 56px;
}

/* Ensure bottom sheets do not hide behind the bottom nav */
.side-panel.active, .info-panel.active { padding-bottom: calc(56px + var(--safe-area-bottom)); }
.panel-content { 
  padding-bottom: 1rem; 
}
/* Add extra padding on mobile to prevent bottom nav overlap */
@media (max-width: 768px) {
  .panel-content { 
    padding-bottom: calc(4rem + var(--safe-area-bottom)); 
  }
}
.mobile-bottom-nav .mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0;
  background: none; 
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  transition: var(--transition);
}
.mobile-bottom-nav .mobile-nav-item i { 
  color: #9ca3af;
  font-size: 1.125rem;
}
.mobile-bottom-nav .mobile-nav-item span { 
  font-size: 0.625rem; 
  font-weight: 500; 
  color: #9ca3af; 
}
.mobile-bottom-nav .mobile-nav-item.active i { 
  color: var(--pgcc-blue) !important; 
}
.mobile-bottom-nav .mobile-nav-item.active span { 
  color: var(--pgcc-blue) !important; 
}

/* --- PANELS (MOBILE FIRST - BOTTOM SHEETS) --- */
.side-panel, .info-panel {
  position: fixed;
  z-index: 15;
  bottom: 0; left: 0; right: 0;
  background: var(--surface-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  max-height: calc(85vh - var(--safe-area-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}
.side-panel.active, .info-panel.active {
  transform: translateY(0);
  visibility: visible;
}
.panel-handle {
  width: 40px; height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  cursor: grab;
}
.panel-header {
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.panel-header h2 { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.minimize-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.125rem;
  transition: var(--transition);
  border-radius: var(--radius);
}
.minimize-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.close-panel-btn { 
  background: none; 
  border: none; 
  color: var(--text-tertiary); 
  cursor: pointer; 
  padding: 0.5rem; 
  font-size: 1.25rem;
  transition: var(--transition);
  border-radius: var(--radius);
}
.close-panel-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.panel-content { 
  flex: 1; 
  overflow-y: auto; 
  overflow-x: hidden;
  padding: 1rem; 
}

/* --- INFO PANEL SPECIFIC --- */
.info-panel { z-index: 16; }

.info-header { 
    padding: 1.25rem 1rem; 
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
}

.info-title { 
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-right: 1rem;
}

.info-title h3 { 
    font-size: 1.375rem; 
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.building-type-badge { 
    display: inline-block; 
    width: fit-content;
    padding: 0.375rem 0.875rem; 
    border-radius: var(--radius-full); 
    font-size: 0.75rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    background: var(--pgcc-blue); 
    color: white;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.building-type-badge.academic { background: #2563eb; }
.building-type-badge.administrative { background: #dc2626; }
.building-type-badge.dining { background: #16a34a; }
.building-type-badge.recreational { background: #9333ea; }
.building-type-badge.parking { background: #6b7280; }
.building-type-badge.library { background: #ea580c; }
.building-type-badge.student-services { background: #0891b2; }
.building-type-badge.facilities { background: #64748b; }

.info-content {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.info-content p {
    line-height: 1.6;
}

.info-actions { 
    padding: 1rem; 
    padding-bottom: calc(1rem + var(--safe-area-bottom)); 
    border-top: 1px solid var(--border); 
    display: flex; 
    gap: 0.75rem; 
    background: var(--surface);
    flex-shrink: 0;
}

/* Action Buttons */
.action-btn { flex: 1; padding: 0.875rem 1rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 0.5rem; border: 1px solid transparent; }
.action-btn.primary { background: var(--pgcc-blue); color: white; }
.action-btn.primary:hover { background: var(--pgcc-blue-light); }
.action-btn.secondary { background: var(--background); color: var(--text-secondary); border-color: var(--border); }
.action-btn.secondary:hover { background: var(--surface-hover); border-color: var(--text-secondary); }

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablet styles (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .logo {
    height: 45px !important;
    width: auto;
  }
  
  .header-content {
    padding: 0.625rem;
  }
  
  #searchInput {
    font-size: 1.125rem;
    padding: 0.875rem 3rem;
  }
  
  .search-container .fa-search {
    font-size: 1.125rem;
    left: 1rem;
  }
  
  .clear-btn {
    font-size: 1.125rem;
    padding: 0.625rem;
  }
}

/* Hide mobile nav, show desktop nav */
@media (min-width: 769px) {
  .mobile-bottom-nav { display: none; }
  .main-header { 
    left: 50%; 
    transform: translateX(-50%); 
    max-width: 600px;
  }
  
  .logo {
    height: 50px !important;
    width: auto;
  }
  
  .header-content {
    padding: 0.75rem 1rem;
  }
  
  #searchInput {
    font-size: 1.25rem;
    padding: 1rem 3.5rem;
  }
  
  .search-container .fa-search {
    font-size: 1.25rem;
    left: 1.25rem;
  }
  
  .clear-btn {
    font-size: 1.25rem;
    padding: 0.75rem;
    right: 0.75rem;
  }
  
  .side-panel {
      top: var(--panel-top);
      left: calc(6rem + var(--safe-area-left));
      bottom: auto; right: auto;
      width: 380px;
      max-height: calc(100vh - var(--panel-top) - 1rem);
      transform: translateX(-150%);
      border-radius: var(--radius-lg);
  }
  .info-panel {
      top: var(--panel-top);
      left: calc(6rem + var(--safe-area-left));
      bottom: auto; right: auto;
      width: 380px;
      max-height: calc(100vh - var(--panel-top) - 1rem);
      transform: translateX(-150%);
      border-radius: var(--radius-lg);
  }
  .side-panel.active, .info-panel.active {
      transform: translateX(0);
  }
  .panel-handle { display: none; }
  .map-controls-group { bottom: calc(1rem + var(--safe-area-bottom)); }
}

/* Hide desktop nav on mobile */
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  
  /* Hide mobile nav toggle - removed hamburger menu */
  .mobile-nav-toggle {
    display: none !important;
  }
  
  /* Fix map controls positioning to avoid overlap with bottom nav */
  .map-controls-group {
    bottom: calc(5rem + var(--safe-area-bottom));
  }
  
  /* Fix dropdown overflow on mobile */
  .select-input {
    font-size: 0.875rem;
    max-width: 100%;
  }
  
  /* Ensure panels don't overflow */
  .side-panel {
    width: 100%;
    left: 0;
    right: 0;
  }
  
  .panel-content {
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  /* Better mobile styling for directions form */
  .directions-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .input-group {
    width: 100%;
    max-width: 100%;
  }
  
  /* Ensure travel buttons fit on mobile */
  .travel-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .travel-btn i {
    font-size: 1rem;
  }
}

/* Buildings List Specific Styles */
.building-list { display: flex; flex-direction: column; gap: 0.5rem; }
.building-card { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.building-card:hover { border-color: var(--pgcc-blue); box-shadow: var(--shadow); transform: translateY(-1px); }
.list-controls { margin-bottom: 1rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.filter-chip { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 0.75rem; cursor: pointer; }
.filter-chip.active { background: var(--pgcc-blue); color: white; }
.custom-marker { 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  align-items: center;
}
.custom-marker .marker-pin { width: 32px; height: 32px; border-radius: 50% 50% 50% 0; position: relative; transform: rotate(-45deg); border: 2px solid white; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.custom-marker .marker-pin i { transform: rotate(45deg); color: white; }
.custom-marker .marker-label { 
  display: block;
  background: #fff; 
  color: var(--text-primary); 
  border: 1px solid var(--border); 
  border-radius: 6px; 
  padding: 4px 8px; 
  font-size: 0.75rem; 
  font-weight: 600;
  margin-top: 6px; 
  white-space: nowrap; 
  box-shadow: var(--shadow-sm);
}
.marker-label-visible { display: block !important; }
/* Add colors for markers */
.custom-marker.academic .marker-pin { background-color: var(--pgcc-blue); }
.custom-marker.administrative .marker-pin { background-color: var(--mc-red); }
.custom-marker.dining .marker-pin { background-color: #16a34a; }
.custom-marker.recreational .marker-pin { background-color: #9333ea; }
.custom-marker.parking .marker-pin { background-color: #6b7280; }
.custom-marker.library .marker-pin { background-color: var(--pgcc-gold); }
.custom-marker.student-services .marker-pin { background-color: var(--pgcc-blue); }
.custom-marker.facilities .marker-pin { background-color: #64748b; }

/* === AI CAMPUS GUIDE PANEL === */

/* Direction start/end markers */
.enhanced-direction-marker { 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  align-items: center;
  width: 40px;
  height: 60px;
}
.enhanced-direction-marker .marker-icon { 
  width: 40px; 
  height: 40px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #fff; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
}
.start-marker .marker-icon { background: #16a34a; }
.end-marker .marker-icon { background: #ef4444; }
.enhanced-direction-marker .marker-pulse { 
  position: absolute; 
  top: 0; 
  left: 50%;
  transform: translateX(-50%);
  width: 40px; 
  height: 40px; 
  border-radius: 50%; 
  border: 2px solid rgba(0,0,0,0.08); 
  animation: pulseRing 2s infinite;
  z-index: 1;
}
.enhanced-direction-marker .marker-label { 
  display: block !important;
  background: #fff; 
  color: var(--text-primary); 
  border: 1px solid var(--border); 
  border-radius: 6px; 
  padding: 4px 8px; 
  font-size: 0.75rem; 
  font-weight: 600;
  margin-top: 4px; 
  white-space: nowrap; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: absolute;
  top: 100%;
  z-index: 3;
}
@keyframes pulseRing { 
  0% { 
    transform: translateX(-50%) scale(0.9); 
    opacity: 0.7;
  } 
  70% { 
    transform: translateX(-50%) scale(1.2); 
    opacity: 0;
  } 
  100% { 
    opacity: 0; 
  } 
}

/* AI Panel Header */
.ai-guide-panel .ai-panel-header { 
    background: linear-gradient(135deg, var(--pgcc-blue-dark) 0%, var(--pgcc-blue) 100%); 
    color: white; 
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; 
    padding: 1.25rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.ai-title h2 { 
    font-size: 1.125rem; 
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.ai-subtitle { 
    font-size: 0.8rem; 
    opacity: 0.9;
    display: block;
    margin-top: 0.125rem;
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.95rem;
}

.ai-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-guide-panel .close-panel-btn { 
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.ai-guide-panel .close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* AI Panel Body */
.ai-guide-panel .ai-panel-body { 
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--background);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: 100%;
}

/* Welcome Section */
.ai-welcome-section {
    padding: 1.5rem 1rem;
    text-align: center;
}

.welcome-content {
    margin-bottom: 1.5rem;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--pgcc-blue-dark), var(--pgcc-blue));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.welcome-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Capabilities Grid */
.ai-capabilities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.capability-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    transition: var(--transition);
}

.capability-item:hover {
    border-color: var(--pgcc-blue);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.capability-item i {
    font-size: 1.5rem;
    color: var(--pgcc-blue);
}

.capability-item span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tutorial Button */
.tutorial-actions {
    display: flex;
    justify-content: center;
}

.tutorial-action-btn {
    background: var(--pgcc-blue);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.tutorial-action-btn:hover {
    background: var(--pgcc-blue-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* Chat Messages Container */
.ai-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 200px;
}

.chat-message { 
    padding: 0.875rem 1.125rem; 
    border-radius: var(--radius-lg); 
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
    animation: slideIn 0.3s ease-out;
}

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

.chat-message.user { 
    background: var(--pgcc-blue); 
    color: white; 
    margin-left: auto; 
    border-bottom-right-radius: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.chat-message.ai { 
    background: var(--surface); 
    color: var(--text-primary);
    margin-right: auto; 
    border-bottom-left-radius: 0.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.chat-message.ai strong {
    color: var(--pgcc-blue);
}

/* AI Action Chips / Buttons */
.ai-action-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-chip {
    background: var(--pgcc-blue);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.ai-chip:hover {
    background: var(--pgcc-blue-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.ai-chip:active {
    transform: translateY(0);
}

.ai-chip i {
    font-size: 0.875rem;
}

/* AI Expand/Collapse Button */
.ai-expand-btn {
    background: var(--background);
    color: var(--pgcc-blue);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.75rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ai-expand-btn:hover {
    background: var(--pgcc-blue);
    color: white;
    border-color: var(--pgcc-blue);
}

.ai-collapsible {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.ai-collapsible::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--surface));
    pointer-events: none;
}

/* Message timestamp */
.message-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Typing Indicator */
.ai-typing-indicator {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.typing-avatar {
    width: 32px;
    height: 32px;
    background: var(--pgcc-blue-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.typing-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--pgcc-blue);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* AI Panel Footer */
.ai-guide-panel .ai-panel-footer { 
    padding: 1rem; 
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.ai-input-wrapper { 
    display: flex; 
    align-items: center; 
    background: var(--background); 
    border: 2px solid var(--border); 
    border-radius: var(--radius-full); 
    padding: 0.375rem 0.75rem;
    transition: var(--transition);
}

.ai-input-wrapper:focus-within {
    border-color: var(--pgcc-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.1);
}

#chat-input { 
    flex: 1; 
    border: none; 
    background: transparent; 
    padding: 0.625rem; 
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
}

#chat-input::placeholder {
    color: var(--text-tertiary);
}

.ai-input-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-voice-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.95rem;
}

.ai-voice-btn:hover {
    background: var(--pgcc-blue);
    color: white;
    border-color: var(--pgcc-blue);
}

.ai-voice-btn.recording {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.ai-send-btn { 
    width: 36px; 
    height: 36px; 
    border-radius: var(--radius-full); 
    background: var(--pgcc-blue); 
    color: white; 
    border: none; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.ai-send-btn:hover:not(:disabled) {
    background: var(--pgcc-blue-light);
    box-shadow: var(--shadow);
    transform: scale(1.05);
}

.ai-send-btn:disabled { 
    background: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Mobile Optimizations for AI Guide */
@media (max-width: 768px) {
    .ai-guide-panel .ai-panel-header {
        padding: 1rem 0.875rem;
    }
    
    .ai-guide-panel .ai-panel-body {
        max-height: calc(85vh - 180px); /* Subtract header and footer heights */
    }
    
    .ai-messages-container {
        min-height: 150px;
        max-height: calc(85vh - 350px);
    }
    
    .ai-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .ai-title h2 {
        font-size: 1rem;
    }
    
    .ai-subtitle {
        font-size: 0.75rem;
    }
    
    .ai-capabilities {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }
    
    .capability-item {
        padding: 0.75rem 0.5rem;
    }
    
    .capability-item i {
        font-size: 1.25rem;
    }
    
    .capability-item span {
        font-size: 0.75rem;
    }
}

/* Directions Panel (adapted) */
.directions-form { display: flex; flex-direction: column; gap: 1rem; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { 
    font-size: 0.875rem; 
    font-weight: 500; 
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.input-group label .start { color: var(--pgcc-blue); }
.input-group label .end { color: var(--pgcc-blue-dark); }
.select-input { 
    padding: 0.875rem; 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    background: var(--surface);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    color: var(--text-primary);
}

.select-input:focus { 
    outline: none; 
    border-color: var(--pgcc-blue); 
    box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.1);
}

.select-input option {
    padding: 0.75rem;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.select-input option:checked {
    background: var(--pgcc-blue);
    color: white;
    font-weight: 600;
}
.travel-modes { display: flex; gap: 0.5rem; }
.travel-btn { 
    flex: 1; 
    padding: 0.875rem; 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    background: var(--surface); 
    cursor: pointer; 
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.travel-btn:hover { 
    background: var(--surface-hover); 
    border-color: var(--pgcc-blue);
}
.travel-btn.active { 
    background: var(--pgcc-blue); 
    color: white; 
    border-color: var(--pgcc-blue);
}
.route-step { 
    border-left: 3px solid var(--pgcc-blue); 
    padding: 0.75rem; 
    margin-bottom: 0.5rem; 
    background: var(--background); 
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.875rem;
    line-height: 1.5;
}
.route-info {
    margin-top: 1rem;
}
.route-summary {
    color: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.directions-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Directions: swap + disclaimer */
.swap-row { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.swap-btn { 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    padding: 0.5rem 0.75rem; 
    cursor: pointer; 
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.swap-btn:hover { 
    background: var(--surface-hover); 
    border-color: var(--text-primary);
}
.directions-disclaimer { 
    color: var(--text-secondary); 
    font-size: 0.8rem; 
    margin-top: 0.75rem; 
    line-height: 1.5;
    padding: 0.875rem 1rem;
    background: linear-gradient(0deg, var(--surface) 0%, var(--background) 100%);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* --- EVENTS PANEL STYLING --- */
#events-container {
  padding: 0;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.events-month {
  padding: 0.75rem 1rem;
  background: var(--background);
  border-bottom: 2px solid var(--pgcc-blue);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.events-month:first-child {
  margin-top: 0;
}

.events-month span {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.event-row {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.event-row:hover {
  background: var(--surface-hover);
}

.event-date-badge {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--pgcc-blue) 0%, var(--pgcc-blue-light) 100%);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow);
}

.event-date-day {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.event-date-mon {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 0.2rem;
}

.event-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.event-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--pgcc-blue);
}

.event-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.event-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.event-meta-line i {
  color: var(--pgcc-blue);
}

.event-meta-line .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.event-location {
  cursor: pointer;
  color: var(--pgcc-blue);
  transition: var(--transition);
}

.event-location:hover {
  color: var(--pgcc-blue-dark);
  text-decoration: underline;
}

.event-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.event-chip i {
  font-size: 0.7rem;
  color: var(--pgcc-blue);
}

.event-actions {
  margin-top: 0.5rem;
}

.event-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--pgcc-blue);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.event-nav-btn:hover {
  background: var(--pgcc-blue-light);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.event-nav-btn:active {
  transform: translateY(0);
}

.event-nav-btn i {
  font-size: 0.875rem;
}

.events-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.events-empty i {
  font-size: 3rem;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.events-empty p {
  font-size: 1rem;
  margin: 0.5rem 0;
}

/* Event skeleton loading */
.event-skeleton {
  opacity: 0.6;
}

.event-skeleton .shimmer {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Mobile optimizations for events */
@media (max-width: 768px) {
  .event-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .event-date-badge {
    width: 25%;
    height: 50px;
    flex-direction: row;
    justify-content: center;
    padding: 0 1rem;
    gap: 1rem;
  }
  
  .event-date-day {
    font-size: 1.25rem;
  }
  
  .event-date-mon {
    margin-top: 0;
    font-size: 0.875rem;
  }
  
  .event-card {
    padding: 1rem;
  }
  
  .event-nav-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Voice navigation buttons */
.voice-navigation-controls { 
    display: flex; 
    gap: 0.5rem; 
    margin-top: 0.75rem; 
}
.voice-nav-btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    padding: 0.6rem 0.9rem; 
    border-radius: var(--radius-full); 
    border: 1px solid var(--border); 
    background: var(--surface); 
    color: var(--text-primary); 
    cursor: pointer; 
    transition: var(--transition); 
    box-shadow: var(--shadow-sm); 
    font-size: 0.85rem; 
    font-weight: 600;
}
.voice-nav-btn:hover { 
    background: var(--pgcc-blue); 
    color: #fff; 
    border-color: var(--pgcc-blue); 
}
.voice-nav-btn.active { 
    background: var(--pgcc-blue-dark); 
    color: #fff; 
    border-color: var(--pgcc-blue-dark);
}
.voice-nav-btn i { font-size: 0.95rem; }

/* Building short code badge */
.building-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.building-code { background: var(--background); color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 0.15rem 0.5rem; font-size: 0.7rem; font-weight: 600; }

/* Minimized Directions Panel */
.directions-minimized {
    position: fixed;
    bottom: calc(6rem + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: none;
    max-width: 90vw;
}

.directions-minimized.active {
    display: block;
}

.minimized-content {
    padding: 0.75rem 1rem;
}

.route-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.route-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.minimized-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-btn,
.close-minimized-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.875rem;
}

.expand-btn:hover {
    background: var(--pgcc-blue);
    color: white;
    border-color: var(--pgcc-blue);
}

.close-minimized-btn:hover {
    background: var(--mc-red);
    color: white;
    border-color: var(--mc-red);
}

/* Mobile responsive for minimized panel */
@media (max-width: 768px) {
    .directions-minimized {
        bottom: calc(5rem + var(--safe-area-bottom));
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: none;
    }
}

/* User Location Indicator */
.user-location-indicator {
    position: fixed;
    z-index: 5;
    pointer-events: none;
}

.location-pulse {
    width: 20px;
    height: 20px;
    background: var(--pgcc-blue);
    border-radius: 50%;
    animation: locationPulse 2s infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.location-dot {
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid var(--pgcc-blue);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.location-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pgcc-blue);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

@keyframes locationPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.tutorial-overlay.active {
    display: flex;
}

.tutorial-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tutorial-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--pgcc-blue-dark), var(--pgcc-blue));
    color: white;
}

.tutorial-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.skip-tutorial-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.skip-tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tutorial-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tutorial-step {
    display: none;
    text-align: center;
}

.tutorial-step.active {
    display: block;
}

.tutorial-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--pgcc-blue-dark), var(--pgcc-blue));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.tutorial-step h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tutorial-step p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tutorial-step ul {
    text-align: left;
    color: var(--text-secondary);
    margin: 1rem 0;
}

.tutorial-step li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-highlight {
    position: absolute;
    border: 3px solid var(--pgcc-blue);
    border-radius: var(--radius);
    background: rgba(0, 61, 130, 0.1);
    pointer-events: none;
    z-index: 10001;
    animation: highlightPulse 2s infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.tutorial-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--background);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-progress {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tutorial-navigation {
    display: flex;
    gap: 0.75rem;
}

.tutorial-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.tutorial-btn.primary {
    background: var(--pgcc-blue);
    color: white;
}

.tutorial-btn.primary:hover {
    background: var(--pgcc-blue-light);
}

.tutorial-btn.secondary {
    background: var(--background);
    color: var(--text-secondary);
    border-color: var(--border);
}

.tutorial-btn.secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Navigation Menu (Legacy - kept for compatibility) */
.mobile-nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(4px);
}

.mobile-nav-menu.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    transition: var(--transition);
    border-radius: var(--radius);
}

.close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.mobile-nav-menu .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: none;
    border: none;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius);
}

.mobile-nav-menu .mobile-nav-item:hover {
    background: var(--surface-hover);
}

.mobile-nav-menu .mobile-nav-item i {
    font-size: 1rem;
    color: var(--pgcc-blue);
    width: 24px;
}

.mobile-nav-menu .mobile-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Hide Google Maps UI elements */
.gm-style .gm-style-cc,
.gm-style .gm-style-moc,
.gm-style .gm-style-pbc,
.gm-style .gm-style-cc a,
.gm-style .gm-style-mtc,
.gm-style .gm-style-iw,
.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw-d,
.gm-style .gm-style-iw-t,
.gm-style .gm-style-iw-t::after,
.gm-style .gm-style-iw-t::before {
    display: none !important;
}

/* Additional responsive optimizations */
@media (max-width: 480px) {
    .main-header {
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .header-content {
        padding: 0.375rem;
    }
    
    .logo {
        height: 36px;
        width: 100%;
        border-radius: 10px;
    }
    
    .map-controls-group {
        right: 0.5rem;
        bottom: calc(5rem + var(--safe-area-bottom));
    }
    
    .map-fab {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
    }
    
    .zoom-controls .map-fab {
        width: 48px;
        height: 48px;
    }
    
    .desktop-nav {
        left: 0.5rem;
    }
    
    .desktop-nav .nav-btn {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --background: var(--hc-background);
        --surface: var(--hc-surface);
        --text-primary: var(--hc-text);
        --border: var(--hc-border);
        --pgcc-blue: var(--hc-accent);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === ANALYTICS DASHBOARD === */
.analytics-panel {
    z-index: 25;
}

.analytics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.last-updated {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.icon-btn.danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

.analytics-grid {
    display: grid;
    gap: 1rem;
}

.analytics-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.analytics-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: linear-gradient(135deg, var(--pgcc-blue-dark), var(--pgcc-blue));
    color: white;
    border: none;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.analytics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analytics-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.analytics-list li:last-child {
    border-bottom: none;
}

.analytics-list .count {
    background: var(--surface-hover);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.analytics-list .empty-state {
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}