/* Nearby Users Styles */
.nearby-users-page {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1005;
  overflow-y: auto;
}

.nearby-users-page.active {
  display: block;
}

.nearby-users-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.nearby-users-back {
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  background: #f5f5f5;
  transition: all 0.3s ease;
}

.nearby-users-back:hover {
  background: #e0e0e0;
  transform: translateX(-3px);
}

.nearby-users-back i {
  font-size: 20px;
  color: #333;
}

.nearby-users-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
  flex-grow: 1;
}

.nearby-users-filters {
  background: white;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.filter-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.radius-slider {
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
}

.radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.radius-value {
  display: inline-block;
  margin-left: 10px;
  font-weight: 600;
  color: #667eea;
}

.filter-select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.refresh-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nearby-users-content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.nearby-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.nearby-user-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.nearby-user-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.user-card-header {
  position: relative;
  padding: 20px 20px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  margin-bottom: 15px;
  object-fit: cover;
}

.user-card-header h4 {
  margin: 0 0 5px 0;
  font-size: 18px;
  font-weight: 700;
}

.user-username {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.distance-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.distance-badge i {
  color: #667eea;
}

.user-card-body {
  padding: 20px;
}

.user-location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: #666;
  font-size: 14px;
}

.user-location i {
  color: #667eea;
}

.user-pets {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 14px;
}

.user-pets i {
  color: #ff6b6b;
}

.user-pets span {
  font-weight: 600;
  color: #333;
}

.user-bio {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-card-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-membership {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.membership-basic {
  background: #e3f2fd;
  color: #1976d2;
}

.membership-premium {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #8b6b00;
}

.user-actions {
  display: flex;
  gap: 10px;
}

.btn-add-friend,
.btn-view-profile,
.btn-message {
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-add-friend {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-view-profile {
  background: #f5f5f5;
  color: #333;
}

.btn-message {
  background: #4caf50;
  color: white;
}

.btn-add-friend:hover,
.btn-view-profile:hover,
.btn-message:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.friend-status-pending {
  background: #ff9800;
  color: white;
}

.friend-status-accepted {
  background: #4caf50;
  color: white;
}

.no-users-found {
  text-align: center;
  padding: 50px 20px;
  color: white;
}

.no-users-found i {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-users-found h3 {
  margin: 0 0 10px 0;
  font-size: 24px;
}

.no-users-found p {
  margin: 0;
  opacity: 0.8;
}

.loading-nearby {
  text-align: center;
  padding: 50px 20px;
  color: white;
}

.loading-nearby .loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Map View Styles */
.map-view-container {
  height: 400px;
  margin-bottom: 20px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.view-toggle {
  display: flex;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  width: fit-content;
}

.view-toggle-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nearby-users-grid {
    grid-template-columns: 1fr;
  }

  .filter-controls {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .user-actions {
    flex-wrap: wrap;
  }

  .btn-add-friend,
  .btn-view-profile,
  .btn-message {
    flex: 1;
    justify-content: center;
    min-width: 120px;
  }
}

/* Animation for new users */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nearby-user-card {
  animation: fadeInUp 0.5s ease forwards;
}

/* Emergency fix untuk testing */
.nearby-users-page {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: white !important;
  z-index: 9999 !important;
  overflow-y: auto !important;
}

.nearby-users-page.active {
  display: block !important;
}

/* Style untuk tombol di header */
.header-icon#openNearbyUsers {
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  background: #f0f0f0;
  transition: all 0.3s ease;
}

.header-icon#openNearbyUsers:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.header-icon#openNearbyUsers i {
  color: #667eea;
  font-size: 18px;
}
