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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f3f4f6;
  color: #444;
}

header {
  background-color: #394240;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

header input, header select {
  padding: 0.4rem;
  border-radius: 8px;
  border: none;
}

main {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  position: relative;
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-6px);
}

.card .name {
  font-size: 1.35rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  transition: color 0.2s;
}

.card .total-rating {
  font-size: 1.6rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 0.7rem;
}

.ratings {
  display: flex;
  justify-content: space-around;
}

.rating {
  position: relative;
  text-align: center;
}

.rating-label {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.rating-value {
  font-size: 1rem;
  font-weight: 600;
}

.bar-chart {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: white;
  border-radius: 8px;
  padding: 0.75rem;
  opacity: 0;
  visibility: hidden;
  width: 140px;
  font-size: 0.8rem;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 70px;
  margin-bottom: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bar-chart::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #2d3748;
}

.bar {
  flex: 1;
  background-color: #43a047;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  border-radius: 2px;
  min-height: 5px;
}

.bar span {
  font-size: 0.65rem;
  padding-bottom: 2px;
}

.rating:hover .bar-chart {
  visibility: visible;
  opacity: 1;
}

.bar span {
  font-size: 0.6rem;
}

.rating:hover .bar-chart {
  visibility: visible;
  opacity: 1;
}

.date, .visitors {
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.8;
}

.visitors-date {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.tags {
  margin-top: 0.5rem;
  text-align: center;
}

.tag {
  display: inline-block;
  background-color: #ddebf7;
  color: #00529B;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.75rem;
  margin: 2px;
}

@media (max-width:700px) {
  header {
    flex-direction: column;
    gap: 1rem;
  }
  .header-controls {
    width: 100%;
  }
  header input, header select {
    width: 50%;
    flex: 1;
  }
}

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

.maps-link {
  color: #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.maps-link:hover {
  background-color: #e7f3ff;
  transform: scale(1.1);
}
