@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbWmT.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWub2bWmT.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYjammT.ttf') format('truetype');
}

:root,
body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  color-scheme: light; /* hint extensions to keep light mode */
  background-color: #ffffff;
  color: #0f1e22;
}

.ui-btn,
#search-input,
#search-results,
.search-result-item,
.info-popup,
.popup-actions button,
.loading-text,
.floor-ui-container {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
}

/* Floor UI styles */
.floor-ui-container {
  color-scheme: light;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px; /* Gap between rows */
  
  width: 90%;
  max-width: 450px;
  
  background: rgba(255, 255, 255, 0.5);
  padding: 10px;
  border-radius: 4px;
  z-index: 10;
  transition: opacity 0.3s ease;
}

/* Base style for all buttons */
.ui-btn {
  padding: 10px 8px;
  border-radius: 8px;
  border: none;
  background: #9EBCC2; /* Inactive color */
  color: #212529;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Active state for buttons */
.ui-btn.active {
  background: #317A85; /* Active color */
  color: #FFFFFF;
}

/* Layout for the button bars */
#buildings-bar,
#floor-bar,
#search-bar,
#datetime-bar {
  display: grid;
  gap: 6px;
  width: 100%;
}

/* Specific grid layouts for each row */
#buildings-bar {
  grid-template-columns: repeat(4, 1fr);
}

#floor-bar {
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

#search-bar {
  grid-template-columns: 1fr auto; /* Input | Button */
  position: relative;
  overflow: visible; /* allow dropdown to render outside */
}

#datetime-bar {
  grid-template-columns: 1fr 1fr;
}

/* Style the search input to match the buttons */
#search-input {
  padding-left: 12px;
  text-align: left;
  cursor: text;
}

/* Style the filter icon button */
#filter-btn {
  width: 50px;
  font-size: 18px;
  padding: 8px;
}

#search-results {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: rgba(143, 167, 173, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  backdrop-filter: blur(6px);
}

.search-result-item {
  padding: 9px 14px;
  color: #000000ff;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

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

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-result-item.no-results {
  color: #b5b5b5;
  cursor: default;
}


.info-popup {
  color-scheme: light;
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 80%;
  max-height: 70vh; /* allow growth but not too tall */
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s ease-out;
  overflow-y: auto; /* allow scroll if needed */
  max-width: min(420px, 90vw);
}

@media (min-width: 480px) {
  .info-popup {
    width: 360px;
  }
}

@media (min-width: 768px) {
  .info-popup {
    width: 500px;
  }
}

.popup-close {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.info-popup h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.status-tag {
  background-color: #4caf50;
  color: white;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.info-popup ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.info-popup li {
  margin-bottom: 4px;
}

.popup-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.popup-actions button {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.popup-actions .reserve-btn {
  background-color: #1976d2;
  color: white;
}

.popup-actions .details-btn {
  background-color: #e0e0e0;
  color: black;
}

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

.popup-header h2 {
  font-size: 18px;
  margin: 0;
}

.pin-label {
  font: 600 12px 'Roboto', sans-serif;
  padding: 8px 5px;
  height: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #549ba8;
  border-radius: 3px;
  white-space: pre-line;
  line-height: 1.2;
  transform: translateX(-50%) translateY(-100%);
  position: absolute;
  will-change: transform;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Stats panels (debug) */
.stats-panel {
  position: absolute;
  top: 0;
  z-index: 10000;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 2000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

#loading-screen .loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 26px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
}

#loading-screen .loading-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

#loading-screen .loading-text {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #264d55;
}
