/* mobile-first simple styling */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

body,
html,
#app {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #f6f7fb;
  color: #111;
}

/* Fade-in animation for the app */
#app {
  opacity: 0;
  animation: fadeInApp 0.5s ease forwards;
}

@keyframes fadeInApp {
  to {
    opacity: 1;
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

h1 {
  font-size: 18px;
  margin: 0;
}

#map-container {
  position: relative;
  display: inline-block;
}


#map-img {
  display: block;
  width: 100%;
  height: auto;
}



#markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Hover effect for markers */
.marker:hover {
  transform: translate(-50%, -50%) scale(1.2); /* Enlarge the marker */
  transition: transform 0.2s ease;
}

/* Click effect for markers */
.marker:active {
  transform: translate(-50%, -50%) scale(1.1); /* Slightly shrink the marker */
  transition: transform 0.1s ease;
}

.marker.open {
  background: #2ecc71;
}

.marker.closed {
  background: #e74c3c;
}

.marker.queue {
  background: #f1c40f;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

#modal-card {
  width: 92%;
  max-width: 420px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  position: relative;
}

#closeModal {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: transparent;
  font-size: 20px;
}

#queue-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

button {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: #000000;
}

button[disabled] {
  opacity: .6
}

/* Button click animation */
button:active {
  transform: scale(0.95); /* Slightly shrink the button */
  transition: transform 0.1s ease;
}

/* Hover effect for buttons */
button:hover {
  background: #2563eb; /* Darker blue on hover */
  transition: background 0.2s ease, transform 0.2s ease;
  transform: translateY(-2px); /* Slightly lift the button */
}

footer {
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  color: #666;
}

#admin-area {
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

@media(min-width:700px) {
  #map-img {
    max-height: 80vh;
  }
}

/* New container for the bathroom list */
#bathroom-list {
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.bathroom-item {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

/* Hover effect for bathroom items */
.bathroom-item:hover {
  transform: translateY(-2px); /* Slightly lift the item */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a shadow */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bathroom-item.open {
  border-left: 4px solid #2ecc71;
}

.bathroom-item.closed {
  border-left: 4px solid #e74c3c;
}

.bathroom-item.queue {
  border-left: 4px solid #f1c40f;
}

.bathroom-item.expanded {
  background: #f9f9f9;
  border-color: #bbb;
  transform: scale(1.02); /* Slightly enlarge the expanded item */
  transition: transform 0.3s ease, background 0.3s ease;
}

/* Fade-in animation for bathroom details */
.bathroom-details {
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bathroom-details {
  margin-top: 10px;
  padding: 10px;
  border-top: 1px solid #eee;
  font-size: 14px;
  color: #555;
}

.queue-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.queue-actions button {
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
}

.queue-actions button.hidden {
  display: none;
}

#admin-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

#admin-controls button {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
}

#admin-controls button.hidden {
  display: none;
}

/* Loading spinner */
#refreshBtn.loading {
  position: relative;
  pointer-events: none;
}

#refreshBtn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top: 2px solid #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

#user-queue-status {
  margin: 10px 0;
  padding: 10px;
  background: #f1f8ff;
  border: 1px solid #cce7ff;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
}

#user-queue-status.hidden {
  display: none;
}