/**
 * ReliefWeb Humanitarian Data Pin Styles
 * Styles for ReliefWeb disaster and report pins on the map
 */

/* ReliefWeb pin base styles */
.reliefweb-disaster-pin,
.reliefweb-climate-disaster-pin,
.reliefweb-report-pin {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.reliefweb-disaster-pin:hover,
.reliefweb-climate-disaster-pin:hover,
.reliefweb-report-pin:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

/* Disaster pin specific styles */
.reliefweb-disaster-pin {
  border-color: #ff4444;
}

.reliefweb-disaster-pin i {
  font-size: 12px;
  color: #ff4444;
}

/* Climate disaster pin specific styles */
.reliefweb-climate-disaster-pin {
  border-color: #ff8800;
}

.reliefweb-climate-disaster-pin i {
  font-size: 12px;
  color: #ff8800;
}

/* Report pin specific styles */
.reliefweb-report-pin {
  border-color: #4444ff;
}

.reliefweb-report-pin i {
  font-size: 12px;
  color: #4444ff;
}

/* ReliefWeb popup styles - styled like my-tooltip */
.reliefweb-popup {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 300px;
  padding: 0;
  background: #1a2740;
  color: #fff;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  overflow: hidden;
  font-size: 0.85rem;
  
  /* Mobile touch optimizations */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Light theme support */
body.light-theme .reliefweb-popup {
  background: var(--light-panel);
  color: var(--text-dark);
}

.reliefweb-popup h4 {
  margin: 0 0 10px 0;
  padding: 12px 12px 8px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--light-panel);
  background: #1a2740;
  border-bottom: none;
  border-left: 4px solid var(--primary-color);
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
}

body.light-theme .reliefweb-popup h4 {
  background: repeating-linear-gradient(135deg, var(--light-panel), var(--light-panel) 10px, var(--light-overlay) 10px, var(--light-overlay) 20px);
  color: var(--text-dark);
}

.reliefweb-popup h4 i {
  margin-right: 0;
  color: var(--primary-color);
  font-size: 0.9em;
}

body.light-theme .reliefweb-popup h4 i {
  color: var(--primary-color);
}

.reliefweb-popup p {
  margin: 6px 0;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #22325a;
  border-radius: 999px;
  padding: 3px 8px;
  border: none;
}

body.light-theme .reliefweb-popup p {
  background: var(--light-overlay);
  color: var(--text-dark);
}

.reliefweb-popup strong {
  color: var(--light-panel);
  font-weight: 600;
  min-width: 80px;
}

body.light-theme .reliefweb-popup strong {
  color: var(--primary-color);
}

.reliefweb-popup .btn {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 0.75rem;
  text-decoration: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
  box-shadow: none;
  transition: background 0.18s, transform 0.18s;
  outline: none;
}

body.light-theme .reliefweb-popup .btn {
  background: var(--primary-color);
  color: #fff;
}

.reliefweb-popup .btn:hover {
  background: #1976d2;
  transform: translateY(-1px) scale(1.02);
  text-decoration: none;
  color: white;
}

body.light-theme .reliefweb-popup .btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px) scale(1.02);
}

.reliefweb-popup .btn:active {
  background: #1565c0;
  transform: scale(0.98);
}

body.light-theme .reliefweb-popup .btn:active {
  background: var(--primary-active);
  transform: scale(0.98);
}

.reliefweb-popup .btn-secondary {
  background: #6c757d;
}

.reliefweb-popup .btn-secondary:hover {
  background: #545b62;
}

.reliefweb-popup .popup-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 8px 12px 6px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: inherit;
}

body.light-theme .reliefweb-popup .popup-actions {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.reliefweb-popup .popup-actions .btn {
  margin-top: 0;
  flex: 1;
  min-width: 80px;
  text-align: center;
}



/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .reliefweb-disaster-pin,
  .reliefweb-climate-disaster-pin,
  .reliefweb-report-pin {
    background: rgba(40, 40, 40, 0.9);
    border-color: #666;
  }
}

/* Animation for pin appearance */
@keyframes reliefwebPinAppear {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reliefweb-disaster-pin,
.reliefweb-climate-disaster-pin,
.reliefweb-report-pin {
  animation: reliefwebPinAppear 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .reliefweb-popup {
    max-width: min(90vw, 320px);
    min-width: 200px;
    padding: 0;
    font-size: 0.8rem;
    
    /* Mobile touch optimizations */
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    
    /* Prevent tooltip from blocking map interaction */
    pointer-events: auto;
  }
  
  .reliefweb-popup h4 {
    font-size: 0.9rem;
    padding: 10px 10px 6px 10px;
    gap: 4px;
  }
  
  .reliefweb-popup p {
    font-size: 0.75rem;
    margin-bottom: 4px;
    padding: 2px 6px;
  }
  
  .reliefweb-popup p strong {
    min-width: 60px;
  }
  
  .reliefweb-popup .btn {
    font-size: 0.6rem;
    padding: 4px 8px;
    gap: 2px;
    min-height: 28px;
    min-width: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(52, 152, 219, 0.3);
    border-radius: 4px;
  }
  
  .reliefweb-popup .popup-actions {
    gap: 4px;
    margin-top: 6px;
    padding-bottom: 3px;
    padding-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .reliefweb-popup {
    max-width: min(95vw, 280px);
    min-width: 180px;
    padding: 0;
    font-size: 0.75rem;
    margin: 5px;
  }
  
  .reliefweb-popup h4 {
    font-size: 0.85rem;
    padding: 8px 8px 5px 8px;
    gap: 3px;
  }
  
  .reliefweb-popup p {
    font-size: 0.7rem;
    margin-bottom: 3px;
    padding: 2px 5px;
  }
  
  .reliefweb-popup p strong {
    min-width: 50px;
  }
  
  .reliefweb-popup .btn {
    padding: 2px 4px;
    font-size: 0.5rem;
    gap: 1px;
    min-height: 20px;
    min-width: 40px;
    border-radius: 2px;
  }
  
  .reliefweb-popup .popup-actions {
    gap: 2px;
    margin-top: 3px;
    padding-bottom: 1px;
    padding-top: 2px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .reliefweb-disaster-pin,
  .reliefweb-climate-disaster-pin,
  .reliefweb-report-pin {
    border-width: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .reliefweb-disaster-pin,
  .reliefweb-climate-disaster-pin,
  .reliefweb-report-pin {
    transition: none;
    animation: none;
  }
  
  .reliefweb-disaster-pin:hover,
  .reliefweb-climate-disaster-pin:hover,
  .reliefweb-report-pin:hover {
    transform: none;
  }
} 