﻿:root {
  --accent-color: #0d6efd;
  --accent-color-contrast: #fff;
}

.googleMapsSettingButton-container {
  margin: 10px;
  text-align: right;
  z-index: 1000 !important;
}

.googleMapsSettingButton-button {
  border-radius: 3px;
  box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px;
  cursor: pointer;
  background: #fff;
}

.googleMapsSettingButton-options__hidden {
  display: none;
}

.googleMapsSettingButton-options {
  margin-top: 2px;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
}

.googleMapsSettingButton-option {
  padding: 10px 15px;
  background-color: #ffffff;
  border-top: 1px #e6e6e6 solid;
  cursor: pointer;
  font-family: "Libre Franklin", sans-serif;
  transition: background-color 0.2s ease-in-out;
}

.googleMapsSettingButton-option:first-of-type {
  border-top: none;
}

.googleMapsSettingButton-option:hover {
  background-color: #f5f8fa;
}
.map-poll {
  margin-bottom: 15px;
}
.map-poll .dropdown {
  top: 100%;
}
.map-poll .btn.btn-default {
  background: #fff !important;
}
.mapPoll-drawLineButton {
  margin: 10px;
}
/*.mapPoll-guideOverlay {
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    padding: 8px 0;
    background-color: #FFFFFF;
    border-radius: 5px 5px 0 0;
    font-size: 16px;
    text-align: center;
    color: #000000;
    opacity: 0.85;
}*/
.mapPoll-drawPointButton {
  margin: 10px;
}
.btn.add-point {
  opacity: 1;
}
.btn.use-my-location {
  opacity: 1;
}

.mapPoll-drawPointButton .fa {
  margin-right: 4px;
  font-size: 14px;
}

/*.mapPoll-drawLineButton {
    position: absolute;
    top: 10px;
    right: 110px;
}*/

.mapPoll-drawLineButton .fa {
  margin-right: 4px;
  font-size: 14px;
}

.mapPoll-importKmlButton {
  position: absolute;
  top: 10px;
  right: 212px;
}

.mapPoll-importKmlButton .fa {
  margin-right: 4px;
  font-size: 14px;
}
.mapPoll-guideOverlay,
.mapPoll-drawPointGuideOverlay,
.mapPoll-drawLineGuideOverlay {
  padding: 12px;
  background-color: #333;
  font-size: 16px;
  text-align: center;
  color: #fff;
  opacity: 0.95;
  font-family: "Open Sans", sans-serif;
  position: absolute;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%);
  border-radius: 0 0 12px 12px;
  bottom: unset !important;
}
.map-poll .gm-style-cc {
  display: none;
}

.mapPoll-drawPointGuideOverlay .fa,
.mapPoll-drawLineGuideOverlay .fa {
  margin-right: 4px;
  font-size: 14px;
}

.mapPoll-commentsPopup {
  position: absolute;
  /*top: 12% !important; temp change to align popup with pin on map*/
  left: 0;
  right: 0;
  width: 55%;
  max-height: 300px;
  background-color: #fff;
  padding: 20px;
  border-radius: 12px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow-y: scroll;
  z-index: 5;
}

.mapPoll-commentsPopup:before {
  content: " ";
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #fff;
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -10px;
}

.mapPoll-commentsPopup-content {
  display: flex;
  flex-flow: column nowrap;
}

.mapPoll-commentsPopup-content .comment-div {
  padding: 0;
  background: none;
}

.mapPoll-commentsPopup-content .comment-inner {
  display: flex;
  flex-flow: column nowrap;
  width: 100%;
  padding: 0;
}

.mapPoll-commentsPopup-content .comment-children {
  margin-top: 15px;
  margin-left: 20px;
  margin-bottom: 0;
}

.mapPoll-commentsPopup-content .comment-children .comment-children {
  margin-left: 0;
}

.mapPoll-commentsPopup-content .comment-left {
  padding: 0;
  display: none;
}

.mapPoll-commentsPopup-content .comment-right {
  margin-bottom: 15px;
}
.mapPoll-commentsPopup-content .comment-div:last-child .comment-right {
  margin-bottom: 0;
}

.mapPoll-commentsPopup-content .comment-attachments {
  margin: 0;
  margin-bottom: 20px;
}

.mapPoll-commentsPopup-content .comment-attachments img {
  display: block;
  height: auto;
  border-radius: 18px;
  max-width: 100%;
  max-height: 150px;
}

.mapPoll-commentsPopup-content .comment-map-display img {
  display: none;
}

.mapPoll-commentsPopup-content .comment-text-body {
  padding: 0;
  background: none;
}

.mapPoll-commentsPopup-content .comment-text {
  margin: 0;
  margin-bottom: 5px;
  font-size: 14px;
  color: #1c1c1c;
}

.mapPoll-commentsPopup-content .comment-actions {
  margin: 0;
  margin-bottom: 20px;
}

.mapPoll-commentsPopup-content .comment-time {
  margin: 0;
}

.mapPoll-commentsPopup-content .comment-actions > a,
.mapPoll-commentsPopup-content .comment-time {
  color: #666666;
  text-transform: uppercase;
}

.mapPoll-notAllowedPopup {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  margin-left: -150px;
  padding: 20px 26px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  color: #333;
}

.mapPoll-notAllowedPopup-message {
  font-size: 16px;
  text-align: center;
  font-family: "Libre Franklin", sans-serif;
  line-height: 24px;
}

.mapPoll-editMarker {
  position: absolute;
  top: 10%;
  left: 50%;
  font-size: 0;
  color: black;
  margin: -32px 0 0 -10px;
}

.mapPoll-editMarker .fa {
  font-size: 36px;
}

.mapPoll-editPopup {
  width: 100%;
  max-width: min(400px, 95%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  border: none;
  border-radius: 12px;
  margin: 0;
  color: #333;
  background-color: var(--accent-color-contrast);
  overflow: hidden;
  font-size: 16px;
  font-family: "Open Sans", sans-serif;
  z-index: 5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.mapPoll-editPopup:before {
  content: " ";
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid rgba(255, 255, 255, 0.8);
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -10px;
}

.mapPoll-editPopup-postNowButton {
  display: inline-block;
  margin: 0;
  font-weight: 500;
  padding: 5px 10px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-image: none;
  margin-right: 10px;
}

a.mapPin {
  text-decoration: none !important;
  padding-left: 10px;
}
.map-icons-display .fa-chevron-right {
  font-weight: 400;
  font-size: 13px;
  margin-left: 10px;
  color: #cccccc;
}

ul#map-icons-display {
  padding-bottom: 0;
}

.mapPoll-editPopup-title {
  display: inline-block;
  font-size: 14px;
  color: #333;
  padding: 0;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
}

.map-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  color: #696868;
  transition: color 0.2s ease-in-out;
}

.map-close:hover {
  color: #333;
}

.mapPoll-editPopup-commentText {
  width: 100%;
  resize: none;
  border-radius: 8px;
  background-color: #f5f8fa;
  padding: 12px;
  margin: 15px 0 10px;
  border: 1px solid #e6e6e6;
  font-size: 16px;
  font-family: "Libre Franklin", sans-serif;
  color: #333;
}
.comment-info-img {
  padding: 0 0 10px;
}

.comment-info-img img {
  max-width: 250px;
  max-height: 200px;
}

.mapPoll-editPopup-postButton {
  float: right;
  font-size: 16px;
  margin: 0;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: #fff;
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.mapPoll-editPopup-postButton:hover {
  background-color: var(--accent-color-contrast);
  border-color: var(--accent-color-contrast);
  color: var(--accent-color);
}

.mapPoll-editPopup-postButton[disabled] {
  background-color: #e6e6e6;
  color: #696868;
  border-color: #e6e6e6;
  cursor: not-allowed;
}

.mapPoll-editPopup .mapPoll-editPopup-content {
  top: 0;
  width: 100%;
  z-index: 99;
  transition: top linear 0.35s;
}

.mapPoll-attachmentsSlide {
  display: none;
  font-size: 14px;
  top: 100%;
  width: 100%;
}

.mapPoll-attachmentsSlide .uploader-container {
  display: block;
  height: 124px;
  background-color: #eee;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 0.5em;
  margin: 20px 0 15px;
  position: relative;
}

.mapPoll-attachmentsSlide .uploader-container:empty::after {
  content: "Drop files here or click here to upload.";
  position: absolute;
  top: 40%;
  color: #000;
  display: block;
  text-align: center;
  width: 100%;
}

.mapPoll-attachmentsSlide
  .uploader-container
  + input#mapPollCommentAttachmentIinput {
  display: none;
}

.mapPoll-attachmentsSlide .attachment-thumbnails {
  display: block;
  height: 124px;
  background-color: #eee;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 0.5em;
  margin-top: 1.5em;
  position: relative;
}

.attachment-row {
  overflow: hidden;
  max-height: 50px;
}
.attachment-label {
  font-size: 11px;
  display: inline-block;
}
.attachment-delete {
  float: right;
  font-size: 1.8em;
  font-weight: 600;
  padding: 0.3em;
}
.attachment-row img {
  max-width: 50px;
  max-height: 50px;
  display: inline-block;
  margin-right: 1em;
}
.map-search-wrapper {
  margin: 10px;
  opacity: 0.95;
}
.map-search-toggle {
  margin-right: 10px;
}

.googleMapsSettingButton-button {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  color: #333 !important;
  width: 40px;
  background: #fff;
  font-size: 1.3em;
  padding-top: 9px;
  padding-bottom: 6px;
  border: none;
  transition: all 0.2s ease-in-out;
}

.googleMapsSettingButton-button:hover {
  background: #f5f8fa;
}

.googleMapsSettingButton-options__hidden {
  display: none;
}

.googleMapsSettingButton-options {
  margin-top: 2px;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  overflow: hidden;
}

.googleMapsSettingButton-option {
  padding: 10px 15px;
  background-color: #ffffff;
  border-top: 1px #e6e6e6 solid;
  cursor: pointer;
  font-family: "Libre Franklin", sans-serif;
  transition: background-color 0.2s ease-in-out;
}

.googleMapsSettingButton-option:first-of-type {
  border-top: none;
}

.kml-upload-ui-outer {
  position: absolute;
  bottom: 25%;
  left: 15%;
  width: 70%;
  height: 50%;
  z-index: -1;
}

.mapPollEditor-drawGuideOverlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  padding: 8px 0;
  background-color: #ffffff;
  border-radius: 5px 5px 0 0;
  font-size: 16px;
  text-align: center;
  color: #000000;
  opacity: 0.85;
}

.mapPollEditor-drawButton {
  position: absolute;
  top: 10px;
  right: 10px;
}

.mapPollEditor-deleteButton {
  position: absolute;
  top: 10px;
  right: 10px;
}

.mapPollEditor-cancelButton {
  position: absolute;
  top: 10px;
  right: 10px;
}

.project-on-map-options .overviewMapEditor-drawLineButton,
.project-on-map-options .overviewMapEditor-drawPointButton,
.project-on-map-options .overviewMapEditor-cancelButton {
  display: none !important;
}

.overview-map-buttons-container
  .btn-group
  > button.btn.overviewMapEditor-drawShapeButton {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Legacy positioning for old button layout - only apply when NOT in button container */
.overviewMapEditor-cancelButton:not(.btn-group *) {
  position: absolute;
  bottom: 50px;
  right: 50%;
}

.overviewMapEditor-drawPointButton:not(.btn-group *) {
  position: absolute;
  top: 10px;
  right: 10px;
}

.overviewMapEditor-drawLineButton:not(.btn-group *) {
  position: absolute;
  top: 10px;
  right: 104px;
}

.overviewMapEditor-drawShapeButton:not(.btn-group *) {
  position: absolute;
  top: 10px;
  right: 200px;
}

.overviewMapEditor-uploadKmlButton:not(.btn-group *) {
  position: absolute;
  top: 10px;
  right: 315px;
}

.overviewMapEditor-deleteButton:not(.btn-group *) {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* New button container styles */
.overview-map-buttons-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 10px;
  width: 100%;
  clear: both;
}

.overview-map-buttons-container .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.overview-map-buttons-container .btn {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0;
}

.overviewMapEditor-drawLineGuideOverlay,
.overviewMapEditor-drawShapeGuideOverlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  padding: 8px 0;
  background-color: #ffffff;
  border-radius: 5px 5px 0 0;
  font-size: 16px;
  text-align: center;
  color: #000000;
  opacity: 0.85;
}

.map-poll.closed a.reply,
.map-poll.closed a.toggleVote {
  display: none;
}

/*Extra small devices (portrait phones, less than 576px)*/
@media (max-width: 575.98px) {
  .mapPoll-commentsPopup {
    width: 90%;
  }
}

/* === PublicInput MapPoll custom tweaks === */
/* Pin overlay container - positioned on top of map */
.map-pin-overlay-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  max-width: 250px;
  background: transparent; /* background handled by inner list */
  border-radius: 4px;
  box-shadow: none;
}

/* Pin bar layout tweaks - reduced padding */
.map-marker-container {
  padding: 4px 8px; /* reduced from 6px 12px */
}

/* More compact padding on mobile */
@media (max-width: 1023px) {
  .map-marker-container {
    padding: 2px 6px; /* even more compact for mobile */
  }
}
#map-icons-display {
  margin: 0 !important; /* remove default top margin */
  line-height: 1;
  color: #333;
  font-weight: 400;
  font-size: 1.3em;
}
#map-icons-display li {
  vertical-align: middle;
  padding: 1px 4px; /* reduced from 2px 6px */
  display: flex;
  align-items: center;
  min-height: 40px; /* consistent row height regardless of pin size */
}

#map-icons-display li a.mapPin {
  user-select: none; /* Prevent text selection on both icon and text */
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  cursor: grab; /* Use grab cursor for the whole link */
}

#map-icons-display li a.mapPin img {
  flex-shrink: 0; /* prevent image from shrinking */
}

/* Ensure pin images maintain aspect ratio and consistent display */
.pin-image-consistent {
  object-fit: contain;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Ensure consistent sizing within pin size categories */
#map-icons-display img.pin-image-consistent {
  display: inline-block;
  vertical-align: middle;
  max-width: 50px; /* limit max size on desktop for consistency */
  max-height: 50px;
}

/* Style for add point button in overlay */
.map-pin-overlay-container .mapPoll-drawPointButton {
  margin: 0;
  width: 100%;
  text-align: center;
}
/* Legend adjustments */
#mapLegend {
  margin-left: 0; /* align with map edge */
  max-width: 260px;
}
#mapLegend .close-button-outer {
  right: 2px;
}
@media (max-width: 600px) {
  #mapLegend {
    max-width: 180px;
  }
}

/* Align search and my-location buttons */
.map-search-toggle.btn,
.use-my-location.btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px; /* consistent spacing between buttons */
}
.map-search-toggle.btn i,
.use-my-location.btn i {
  font-size: 18px;
}

/* My location button icon color */
.use-my-location.btn i {
  color: #007bff;
}

/*--------------------------------------------------
  Map-pin cursor UX
  --------------------------------------------------*/
.map-marker-container .mapPin,
#mapPinImage.mapPin {
  /* normal state = open hand */
  cursor: url(https://maps.google.com/mapfiles/openhand.cur), grab;
  cursor: grab;
}

.map-marker-container .mapPin:active,
#mapPinImage.mapPin:active {
  /* mouse-down state = closed hand */
  cursor: url(https://maps.google.com/mapfiles/closedhand.cur), grabbing;
  cursor: grabbing;
}

/* === Mobile Map Pin List Styles === */
@media (max-width: 1023px) {
  /* Mobile pin overlay adjustments */
  .map-pin-overlay-container {
    top: 10px;
    left: 10px;
    right: 10px; /* overlay spans nearly full width */
    max-width: none;
    background: transparent;
  }

  /* Base container and list styles for mobile */
  ul#map-icons-display {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
  }
  ul#map-icons-display li a.mapPin {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    min-height: 60px; /* consistent row height for mobile */
  }
  ul#map-icons-display li:last-child a.mapPin {
    border-bottom: none;
  }
  ul#map-icons-display li a.mapPin img {
    margin-right: 12px;
    max-width: 40px; /* limit max size on mobile for consistency */
    max-height: 40px;
  }
  ul#map-icons-display li:first-child {
    padding: 12px 15px;
    font-weight: bold;
    background-color: #f7f7f7;
  }

  /* Two-column layout styles for mobile */
  ul#map-icons-display.mobile-pin-list-two-col {
    display: flex;
    flex-wrap: wrap;
  }
  ul#map-icons-display.mobile-pin-list-two-col li {
    box-sizing: border-box;
  }
  ul#map-icons-display.mobile-pin-list-two-col li:first-child {
    width: 100%;
  }
  ul#map-icons-display.mobile-pin-list-two-col li:not(:first-child) {
    width: 50%;
  }
  /* Vertical divider for the left column items */
  ul#map-icons-display.mobile-pin-list-two-col
    li:nth-child(2n):not(:first-child)
    a.mapPin {
    border-right: 1px solid #eee;
  }
  /* Override the single-column last-child rule to ensure all items have a bottom border */
  ul#map-icons-display.mobile-pin-list-two-col li:last-child a.mapPin {
    border-bottom: 1px solid #eee;
  }
}

/* === Desktop Pin Picker Full-Width Layout === */
@media (min-width: 1024px) {
  .map-pin-overlay-container {
    left: 10px;
    right: 10px; /* span nearly entire map width */
    max-width: none;
    top: 10px;
  }
  /* Remove extra left padding and stretch row */
  .map-marker-container {
    padding: 4px 8px 4px 8px; /* uniform left/right */
    width: 100%;
  }

  #map-icons-display {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping if needed */
    align-items: center;
    gap: 12px;
  }

  #map-icons-display li {
    width: auto;
    flex-shrink: 0; /* Don't allow items to shrink */
  }

  /* Prevent text selection on the "Drag and drop" helper text */
  #map-icons-display li:first-child {
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    font-weight: bold;
    color: #555;
  }
}

/* === Control Button Spacing Refinement === */
.map-search-toggle.btn,
.use-my-location.btn {
  margin: 3px 0; /* vertical stack spacing */
}

@media (max-width: 1023px) {
  .map-search-toggle.btn,
  .use-my-location.btn {
    margin: 2px 0; /* tighter on mobile */
  }
  #map-icons-display li a {
    /* Let the parent glass backdrop show through on mobile */
    background: transparent;
  }
}

/* Adjust inner container & two-column anchor width */
.map-pin-overlay-container .map-marker-container {
  background: transparent !important;
  border: none !important;
}

ul#map-icons-display.mobile-pin-list-two-col > li > a.mapPin {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px;
}

/* Base list background */
#map-icons-display {
  border-radius: 4px;
}

/* Two-column base (for both desktop+mobile when list gets this class) */
ul#map-icons-display.mobile-pin-list-two-col {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

ul#map-icons-display.mobile-pin-list-two-col > li {
  width: 50%;
  list-style: none;
}

ul#map-icons-display.mobile-pin-list-two-col > li > a.mapPin {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px;
}

/* Shared style for right-side map control buttons */
.map-control-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 6px 2px 0; /* right margin consistent */
}
@media (max-width: 1023px) {
  .map-control-btn {
    margin: 1px 4px 1px 0;
  }
}

/* === Hide default Google Maps camera controls === */
.gm-control-active[aria-label="Map camera controls"] {
  display: none !important;
}

.map-pin-overlay-close {
  padding: 4px;
}

.map-search-wrapper {
  width: 85vw; /* responsive width */
  max-width: 300px; /* avoid oversize on tablets */
}

@media (max-width: 600px) {
  /* Make the map search input occupy most of the screen width on mobile */
  .map-search-wrapper {
    width: 85vw; /* responsive width */
    max-width: 300px; /* avoid oversize on tablets */
  }
  .map-search-wrapper .map-search-input {
    width: 100%;
  }
}

/* === Utility Classes === */
.bg-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}

/* === Accessibility: Focus Indicators === */
/* Focus indicators aligned with design kit (Hub.css) */

/* General button and interactive element focus */
.map-poll button:focus-visible,
.map-poll a:focus-visible,
.map-poll input:focus-visible,
.map-poll textarea:focus-visible,
.map-poll [tabindex="0"]:focus-visible,
.mapPoll-drawPointButton:focus-visible,
.mapPoll-drawLineButton:focus-visible,
.map-search-toggle:focus-visible,
.use-my-location:focus-visible,
.btn:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
}

/* Pin selector focus */
a.mapPin:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
  background-color: #e0f2ff !important;
}

/* Close button focus */
.map-close:focus-visible,
.mapPoll-commentsPopup-closeButton:focus-visible,
.mapPoll-editPopup-closeButton:focus-visible,
.mapPoll-notAllowedPopup-closeButton:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
}

/* Input and textarea focus */
.map-search-input:focus-visible,
.mapPoll-editPopup-commentText:focus-visible,
.map-poll input:focus-visible,
.map-poll textarea:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
  border-color: var(--accent-color) !important;
}

/* Map control buttons focus */
.map-control-btn:focus-visible,
.googleMapsSettingButton-button:focus-visible,
.map-type-toggle:focus-visible,
.toggle-button:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
}

/* Menu items focus */
.googleMapsSettingButton-option:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: -2px !important;
  background-color: #e0f2ff !important;
}

/* Focusable title in edit popup */
.mapPoll-editPopup-title:focus-visible {
  outline: 3px solid var(--accent-color) !important;
  outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  .mapPin:focus-visible {
    outline: 4px solid #000 !important;
    outline-offset: 2px !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Location Input Dialog === */
.mapPoll-locationDialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: none;
  font-family: "Open Sans", sans-serif;
}

.mapPoll-locationDialog-content {
  position: relative;
}

.mapPoll-locationDialog-closeButton {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  font-size: 18px;
  cursor: pointer;
  color: #696868;
  background: transparent;
  border: none;
  z-index: 1;
}

.mapPoll-locationDialog-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #333;
  font-family: "Montserrat", sans-serif;
}

.mapPoll-locationDialog-description {
  margin-bottom: 20px;
  color: #696868;
  font-size: 16px;
  line-height: 24px;
  font-family: "Libre Franklin", sans-serif;
}

.mapPoll-locationDialog .form-group {
  margin-bottom: 20px;
}

.mapPoll-locationDialog label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

.mapPoll-locationDialog input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  font-size: 16px;
  background-color: #f5f8fa;
  font-family: "Libre Franklin", sans-serif;
}

.mapPoll-locationDialog input:focus-visible {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
  border-color: #0d6efd;
}

.mapPoll-locationDialog .row {
  margin-left: -5px;
  margin-right: -5px;
}

.mapPoll-locationDialog .col-sm-6 {
  padding-left: 5px;
  padding-right: 5px;
}

.mapPoll-locationDialog-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.mapPoll-locationDialog-buttons .btn {
  flex: 1;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 16px;
}

.mapPoll-locationDialog-buttons .btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-color-contrast);
}

.mapPoll-locationDialog-buttons .btn-primary:hover {
  background-color: var(--accent-color-contrast);
  border-color: var(--accent-color-contrast);
  color: var(--accent-color);
}

.mapPoll-locationDialog-buttons .btn-default {
  background-color: #f5f8fa;
  border-color: #e6e6e6;
  color: #333;
}

.mapPoll-locationDialog-buttons .btn-default:hover {
  background-color: #e0f2ff;
}

.mapPoll-locationDialog-error {
  margin-top: 15px;
  padding: 12px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
  font-size: 14px;
}

@media (max-width: 600px) {
  .mapPoll-locationDialog {
    width: 95%;
    padding: 20px;
  }

  .mapPoll-locationDialog-buttons {
    flex-direction: column;
  }
}

/* Google Places Autocomplete styling in location dialog */
.pac-container {
  font-family: "Open Sans", sans-serif;
  border-radius: 8px;
  border-top: 1px solid #e6e6e6;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  margin-top: 2px;
  background-color: #fff;
}

.pac-item {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 16px;
  border-top: 1px solid #f5f5f5;
  font-family: "Libre Franklin", sans-serif;
}

.pac-item:first-child {
  border-top: none;
}

.pac-item:hover {
  background-color: #f5f8fa;
}

.pac-item-selected,
.pac-item-selected:hover {
  background-color: #e0f2ff;
}

.pac-matched {
  font-weight: 600;
  color: #333;
}

.pac-icon {
  margin-right: 8px;
}

/* Ensure autocomplete dropdown appears above other elements */
.pac-container {
  z-index: 10001 !important;
}

.pac-item:focus-visible {
  outline: 3px solid #0d6efd;
  outline-offset: -2px;
  background-color: #e0f2ff;
}

/* Screen reader only text for keyboard instructions */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
