body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f7;
  color: #333;
}
#map {
  height: 40vh;
  width: 100%;
  position: relative;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
h1, h2 {
  color: #1a1a1a;
}
#bar-form {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}
input[type="text"], button {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
button {
  background-color: #007aff;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
button:hover {
  background-color: #0056b3;
}
.stats {
  display: flex;
  justify-content: space-between;
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}
.stats p {
  margin: 0;
  font-size: 14px;
}
.stats span {
  font-weight: 600;
  color: #007aff;
}
.filters {
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.filters-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#search-bar {
  flex: 1;
  min-width: 200px;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.sort-controls label {
  font-size: 14px;
  font-weight: 500;
}

.sort-controls select {
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
}

.sort-controls select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

#bar-list {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}
#bar-list tr {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#bar-list td {
  padding: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bar-list td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  width: 35%;
}
#bar-list td:nth-child(2) {
  width: 20%;
}
#bar-list td:nth-child(3) {
  width: 15%;
}
#bar-list td:nth-child(4),
#bar-list td:nth-child(5),
#bar-list td:last-child {
  width: 10%;
}
#bar-list td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Status indicators for mobile */
.status-indicator {
  font-size: 18px;
  font-weight: bold;
  display: inline-block;
  width: 20px;
  text-align: center;
}

.status-indicator.visited {
  color: #28a745;
}

.status-indicator.not-visited {
  color: #dc3545;
}

#add-bar-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  width: 300px;
}

/* Expanded Row Modal Styles */
#expanded-row-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.expanded-row-content {
  background-color: white;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.expanded-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

.expanded-row-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  word-break: break-word;
}

.expanded-row-body {
  padding: 20px;
}

.expanded-row-info {
  margin-bottom: 20px;
}

.expanded-row-info p {
  margin: 8px 0;
  font-size: 14px;
  color: #666;
}

.expanded-row-info strong {
  color: #1a1a1a;
}

.expanded-row-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  background-color: #007aff;
  color: white;
}

.action-btn:hover {
  background-color: #0056b3;
}

.action-btn.delete-btn {
  background-color: #dc3545;
}

.action-btn.delete-btn:hover {
  background-color: #c82333;
}

.action-btn i {
  font-size: 16px;
}

.tooltip {
  position: fixed;
  background-color: #fff;
  color: #333;
  padding: 5px;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  #map {
    height: 60vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: height 0.3s ease-out;
  }

  .container {
    padding: 10px;
  }

  .filters-container {
    flex-direction: column;
    align-items: stretch;
  }

  #search-bar {
    width: 100%;
    margin-bottom: 10px;
  }

  .filter-buttons {
    justify-content: center;
    margin-bottom: 10px;
  }

  .sort-controls {
    justify-content: center;
  }

  #bar-list {
    margin-top: 20px;
  }

  /* Mobile table layout - only show name and status */
  #bar-list td:first-child {
    width: 70%;
  }
  #bar-list td:nth-child(2) {
    width: 30%;
    text-align: center;
  }
  
  /* Hide action columns on mobile since we use expanded view */
  #bar-list td:nth-child(n+3) {
    display: none;
  }

  /* Mobile row hover effect */
  #bar-list tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
  }
}

/* Add this new CSS for the scrolling behavior */
@media (max-width: 768px) {
  body {
    scroll-padding-top: 40vh;
  }

  #map.scrolled {
    height: 40vh;
  }
}

@media (min-width: 769px) {
  #map {
    resize: vertical;
    overflow: hidden;
    min-height: 200px;
    max-height: 80vh;
  }

  #map-container {
    position: relative;
  }

  #map-resizer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1));
    cursor: ns-resize;
  }

  /* Desktop table layout */
  #bar-list td:first-child {
    width: 35%;
  }
  #bar-list td:nth-child(2) {
    width: 20%;
  }
  #bar-list td:nth-child(3) {
    width: 15%;
  }
  #bar-list td:nth-child(4),
  #bar-list td:nth-child(5),
  #bar-list td:last-child {
    width: 10%;
  }
}