.location-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.location-modal {
  background: linear-gradient(135deg, #1a1a2e, #2a1a4a);
  border: 2px solid #d946ef;
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  text-align: center;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.location-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.location-modal h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: white;
}

.location-modal p {
  color: #aaa;
  margin-bottom: 15px;
  line-height: 1.6;
}

.location-benefit {
  background: rgba(217, 70, 239, 0.2);
  padding: 15px;
  border-radius: 10px;
  color: #d946ef !important;
  font-weight: 500;
}

.location-buttons {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.btn-location-accept {
  flex: 1;
  padding: 15px 25px;
  background: linear-gradient(135deg, #d946ef, #a855f7);
  border: none;
  border-radius: 30px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-location-accept:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(217, 70, 239, 0.4);
}

.btn-location-reject {
  flex: 1;
  padding: 15px 25px;
  background: transparent;
  border: 2px solid #666;
  border-radius: 30px;
  color: #999;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-location-reject:hover {
  border-color: #999;
  color: white;
}

.location-privacy {
  font-size: 12px;
  color: #666 !important;
  margin-top: 20px;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loader-content {
  text-align: center;
  color: white;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #333;
  border-top-color: #d946ef;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.nearby-panel {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 320px;
  background: linear-gradient(135deg, #1a1a2e, #2a1a4a);
  border: 2px solid #d946ef;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 1500;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.nearby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #333;
}

.nearby-header h4 {
  margin: 0;
  font-size: 14px;
  color: #d946ef;
}

.close-nearby {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
}

.nearby-list {
  max-height: 400px;
  overflow-y: auto;
}

.nearby-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #222;
}

.nearby-item:hover {
  background: rgba(217, 70, 239, 0.1);
}

.nearby-avatar {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #d946ef, #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.nearby-info {
  flex: 1;
}

.nearby-name {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}

.nearby-location {
  font-size: 12px;
  color: #888;
}

.nearby-status {
  font-size: 11px;
  color: #22c55e;
}

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: #1a1a2e;
  border: 2px solid #d946ef;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: linear-gradient(135deg, #d946ef, #a855f7);
  border-radius: 14px 14px 0 0;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.chat-name {
  display: block;
  font-weight: 600;
}

.chat-location {
  font-size: 12px;
  opacity: 0.9;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0 5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
}

.message-sent {
  background: linear-gradient(135deg, #d946ef, #a855f7);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-received {
  background: #2a2a4a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message p {
  margin: 0;
  line-height: 1.4;
}

.message-time {
  font-size: 10px;
  opacity: 0.7;
  display: block;
  margin-top: 5px;
}

.chat-typing {
  padding: 5px 15px;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #333;
}

.chat-input-area input {
  flex: 1;
  padding: 12px 18px;
  background: #2a2a4a;
  border: 1px solid #444;
  border-radius: 25px;
  color: white;
  font-size: 14px;
}

.chat-input-area input:focus {
  outline: none;
  border-color: #d946ef;
}

.btn-send {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #d946ef, #a855f7);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-send:hover {
  transform: scale(1.1);
}

.location-notification {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a4a;
  border: 1px solid #d946ef;
  padding: 15px 30px;
  border-radius: 10px;
  color: white;
  z-index: 3000;
  animation: fadeInOut 4s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

/* Map Panel Styles */
.nearby-panel-map {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  background: linear-gradient(135deg, #1a1a2e, #2a1a4a);
  border: 2px solid #d946ef;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 1500;
  animation: slideInRight 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.location-map {
  width: 100%;
  height: 300px;
  border-radius: 0;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 15px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid #333;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #ccc;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.nearby-category {
  display: block;
  font-size: 11px;
  color: #d946ef;
  margin-bottom: 2px;
}

.no-results {
  text-align: center;
  padding: 30px;
  color: #888;
}

/* Custom Map Markers */
.custom-marker {
  background: transparent;
}

.marker-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  border: 2px solid white;
}

.marker-pin span {
  transform: rotate(45deg);
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.user-marker .marker-pin {
  width: 40px;
  height: 40px;
}

.user-marker .marker-pin span {
  font-size: 16px;
}

.marker-popup {
  text-align: center;
  min-width: 150px;
}

.marker-popup strong {
  display: block;
  margin-bottom: 5px;
  color: #1a1a2e;
}

.popup-chat-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #d946ef, #a855f7);
  border: none;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}

.popup-chat-btn:hover {
  transform: scale(1.05);
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.leaflet-popup-content {
  margin: 12px 15px;
}

@media (max-width: 600px) {
  .chat-widget {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  
  .nearby-panel {
    width: 100%;
    right: 0;
    top: auto;
    bottom: 0;
    border-radius: 16px 16px 0 0;
  }
  
  .nearby-panel-map {
    width: 100%;
    max-width: 100%;
    top: 60px;
    left: 0;
    transform: none;
    border-radius: 0;
    max-height: calc(100vh - 60px);
  }
  
  .location-map {
    height: 200px;
  }
  
  .map-legend {
    justify-content: center;
  }
  
  .location-modal {
    margin: 20px;
    padding: 30px;
  }
  
  .location-buttons {
    flex-direction: column;
  }
}
