/* Ensure pointer events enabled to avoid blocking location prompt */
.map-container,
.map-wrapper,
#dog-waste-map {
  pointer-events: auto !important;
}

/* Ensure map and its elements never overlap mobile navigation, toast, or other UI elements */
.map-container,
.map-wrapper,
#dog-waste-map,
.leaflet-container,
.leaflet-pane,
.leaflet-overlay-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
  z-index: 1 !important;
}

/* Ensure Leaflet popups and tooltips don't overlap UI elements */
.leaflet-popup,
.leaflet-popup-content-wrapper,
.leaflet-popup-tip,
.leaflet-tooltip,
.leaflet-tooltip-content {
  z-index: 50 !important;
}

/* Main container for the entire map section */
.map-container {
  padding: 30px 16px;
  background-color: var(--main-color);
  margin: 40px auto;
}

/* Responsive margin-top for map-container to prevent navbar overlap */
@media (max-width: 1200px) {
  .map-container {
    margin-top: 60px;
  }
}

@media (max-width: 1024px) {
  .map-container {
    margin-top: 70px;
  }
}

@media (max-width: 768px) {
  .map-container {
    margin-top: 95px;
  }
}

@media (max-width: 480px) {
  .map-container {
    margin-top: 90px;
  }
}

/* Inner wrapper to align text and map together */
.map-container-inner {
  max-width: 85%;
  margin: 0 auto;
  text-align: left;
}

/* Heading */
.map-container h1 {
  margin-top: 3rem;
  font-weight: 700;
  font-size: 35px;
  color: var(--primary-color);
  margin-bottom: 5px;
  font-family: var(--secondary-font);
}

/* Paragraph text */
.map-container p {
  color: #666;
  font-size: 15px;
  margin-bottom: 5px;
  margin-top: 0;
  max-width: 100%;
}

/* Wrapper to allow floating button */
.map-wrapper {
  position: relative;
}

/* Map styling */
#dog-waste-map {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: block;
}

/* Ensure map controls don't appear above navbar */
.leaflet-control-zoom,
.leaflet-control-zoom.leaflet-bar.leaflet-control,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-zoom a,
.leaflet-control-zoom a.leaflet-control-zoom-in,
.leaflet-control-zoom a.leaflet-control-zoom-out {
  z-index: 1 !important;
}

.location-button {
  position: absolute;
  top: 102px;
  right: 11px;
  z-index: 50;
  color: white;
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.location-button:hover {
  background-color: var(--primary-color-hover);
}

.location-button.disabled {
  background-color: #ccc !important;
  color: #666 !important;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

/* Nearest bin box styling - desktop */
.nearest-bin-box {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: #333;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nearest-bin-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

/* Nearest bin distance text */
#nearest-bin-info {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 5px 0;
  color: #333;
}

/* Toggle reference button styling */
.nearest-bin-toggle {
  font-size: 12px;
  background: none;
  border: none;
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-align: left;
  display: none;
}

/* Show Me button styling */
.nearest-bin-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: none;
  white-space: nowrap;
  margin-left: 15px;
}

.nearest-bin-button i {
  margin-right: 5px;
}

.nearest-bin-button:hover {
  background-color: var(--primary-color-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nearest-bin-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

#show-nearest-bin.disabled {
  background-color: #ccc !important;
  color: #666 !important;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

/* Search form styling */
.postcode-search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 600px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #999;
  font-size: 16px;
  z-index: 1;
}

.voice-search-icon {
  position: absolute;
  right: 12px;
  color: var(--primary-color);
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
  transition: color 0.3s ease;
}

.voice-search-icon:hover {
  color: var(--primary-color-hover);
}

.voice-search-icon.listening {
  color: #b22222;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

#postcode-input {
  flex: 1;
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.3s ease;
  outline: none;
}

#postcode-input:focus {
  border-color: var(--primary-color);
}

#postcode-input::placeholder {
  color: #999;
}

.postcode-search button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
  white-space: nowrap;
}

.postcode-search button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.postcode-search button:disabled:hover {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.postcode-search button:hover {
  background-color: var(--primary-color-hover);
}

.postcode-search button:active {
  transform: scale(0.95);
}

.map-layer-toggle-button {
  width: 36px;
  height: 36px;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  z-index: 50;
  transition: all 0.3s ease;
  right: 11px;
}

.bin-layer-toggle-button {
  width: 36px;
  height: 36px;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  z-index: 50;
  transition: all 0.3s ease;
  right: 11px;
}

.bin-layer-toggle-button {
  top: 56px;
}

.map-layer-toggle-button {
  top: 10px;
}

.bin-layer-toggle-button:hover,
.map-layer-toggle-button:hover {
  background-color: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bin-layer-toggle-button i,
.map-layer-toggle-button i {
  color: var(--primary-color);
  font-size: 18px;
  transition: color 0.3s ease;
}

/* Safari z-index stacking fix: z-index 1000 ensures popups appear above mobile nav and search */
.bin-layer-toggle-menu,
.map-layer-toggle-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--main-color);
  border: none;
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 2rem 2rem 0 2rem;
  margin-top: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.bin-layer-toggle-menu[style*="display: block"],
.map-layer-toggle-menu[style*="display: block"] {
  display: flex;
}

.bin-layer-toggle-menu label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  margin: 0.375rem 0;
  color: #374151;
  font-size: 0.95rem;
  font-family: var(--primary-font);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid #e5e7eb;
  background: #fff;
  flex-direction: row-reverse;
}

.bin-layer-toggle-menu input[type="checkbox"] {
  margin-left: 0.75rem;
  transform: scale(1.2);
  cursor: pointer;
  accent-color: var(--primary-color);
  align-self: center;
}

.map-layer-option {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  margin: 0.75rem 0;
  color: #374151;
  font-family: var(--primary-font);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
  border: 2px solid #e5e7eb;
  background: #fff;
  width: 100%;
  text-align: left;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bin-layer-toggle-menu label:hover,
.map-layer-option:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-layer-option {
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  background-color: #fff;
}

.map-layer-option.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 3px 8px rgba(46, 74, 125, 0.25);
}

/* Map Preview Styles */
.map-preview {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.map-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.map-option-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: inherit;
  margin-bottom: 0.125rem;
}

.map-option-description {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
  font-weight: 400;
}

.map-layer-option.active .map-option-description {
  color: rgba(255, 255, 255, 0.8);
}

.popup-title {
  color: #333;
  font-family: var(--secondary-font);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-top: 2.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: #6b7280;
  font-size: 1.75rem;
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1rem;
  transition: background-color 0.15s ease-out, color 0.15s ease-out,
    transform 0.15s ease-out;
}

.close-btn:hover,
.close-btn:focus {
  background-color: #f3f4f6;
  color: #374151;
  transform: scale(1.05);
}

.close-btn::before {
  content: "\f00d";
  font-family: "FontAwesome";
  font-size: 1.75rem;
  color: inherit;
}

.popup-footer {
  display: flex;
  justify-content: space-between;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--main-color);
  padding: 1rem 2rem;
  gap: 1rem;
  border-top: 1px solid #e5e7eb;
  z-index: 1001;
}

.reset-btn {
  padding: 0.6rem 1.25rem;
  background: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--primary-font);
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background-color: #f8f9fa;
  border-color: var(--primary-color-hover);
}

.apply-btn {
  padding: 0.6rem 1.25rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--primary-font);
  transition: all 0.2s ease;
}

.apply-btn:hover {
  background: var(--primary-color-hover);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  /* Heading */
  .map-container h1 {
    margin-top: 2.1rem;
    font-size: 30px;
  }

  .bin-layer-toggle-button,
  .map-layer-toggle-button {
    width: 32px;
    height: 32px;
  }

  .bin-layer-toggle-button i,
  .map-layer-toggle-button i {
    font-size: 16px;
  }

  .bin-layer-toggle-menu,
  .map-layer-toggle-menu {
    min-width: 140px;
  }

  .location-button {
    width: 32px;
    height: 32px;
  }

  /* Map preview responsive adjustments */
  .map-preview {
    width: 60px;
    height: 45px;
  }

  .map-option-title {
    font-size: 0.95rem;
  }

  .map-option-description {
    font-size: 0.8rem;
  }
}

/* Responsive layout adjustments */
@media (max-width: 1024px) {
  .map-container-inner {
    max-width: 90%;
  }
}

@media (max-width: 950px) {
  .nearest-bin-box {
    position: static;
    transform: none;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
  }

  .nearest-bin-content {
    width: 85%;
    margin: 0 auto 15px auto;
    text-align: center;
    display: block;
  }

  .nearest-bin-toggle {
    width: 85%;
    margin: 0 auto 15px auto;
    text-align: center;
  }

  .nearest-bin-button {
    width: 85%;
    display: block;
    margin: 0 auto;
    padding: 10px 14px;
    font-size: 18px;
  }

  #nearest-bin-info {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .location-button {
    position: absolute;
    bottom: 110px;
    right: 11px;
    pointer-events: auto;
  }

  .map-wrapper {
    position: relative;
  }

  #dog-waste-map {
    padding-bottom: 100px;
    height: 500px;
  }

  .map-container-inner {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .location-button {
    position: absolute;
    bottom: 110px;
    right: 11px;
    pointer-events: auto;
  }

  .map-wrapper {
    position: relative;
  }

  #dog-waste-map {
    height: 300px;
  }

  .postcode-search {
    flex-direction: column;
    gap: 12px;
  }

  .postcode-search button {
    width: 100%;
    padding: 14px 24px;
  }

  .nearest-bin-box {
    width: 100%;
    padding: 10px 12px;
    bottom: 10px;
  }

  .nearest-bin-content {
    width: 100%;
    margin-bottom: 8px;
  }

  #nearest-bin-info {
    font-size: 12px;
    margin-bottom: 3px;
  }

  .nearest-bin-toggle {
    font-size: 10px;
  }

  .nearest-bin-button {
    padding: 6px 12px;
    font-size: 18px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Heartbeat animation for nearest bin */
.nearest-bin-marker {
  position: relative;
  z-index: 1;
}

.nearest-bin-marker::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  left: 35%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(46, 74, 125, 0.5);
  border-radius: 50%;
  animation: heartbeat 1.2s ease-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes heartbeat {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

.bin-layer-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 60%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
}

.map-layer-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
  padding-bottom: 1.5rem;
  padding-top: 0.5rem;
}

.map-layer-option {
  margin: 0;
  border-bottom: none;
  position: relative;
}

/* Submit a Bin Section */
.submit-bin-section {
  margin-top: 20px;
  text-align: center;
  padding: 0 20px 20px;
}

.submit-bin-button {
  background-color: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  padding: 8px 16px;
  /* smaller padding */
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: auto;
  /* allows it to shrink to fit content */
}

.submit-bin-button i {
  margin-right: 8px;
}

.submit-bin-button:hover {
  background-color: #f0f0f0;
  /* slightly darker than white */
}

/* Submit Bin Popup */
/* Safari z-index stacking fix: z-index 1000 ensures popups appear above mobile nav and search */
.submit-bin-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.submit-bin-popup.show {
  opacity: 1;
  visibility: visible;
}

.submit-bin-content {
  background-color: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Desktop and larger screens - increase width */
@media (min-width: 1024px) {
  .submit-bin-content {
    max-width: 550px;
    width: 85%;
    max-height: 95dvh;
  }
}

@media (min-width: 1200px) {
  .submit-bin-content {
    max-width: 600px;
    width: 80%;
    max-height: 95dvh;
  }
}

/* Tablet and mobile - increase height to avoid scrolling */
@media (max-width: 1023px) {
  .submit-bin-content {
    max-height: 95dvh;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  .submit-bin-content {
    max-height: 95dvh;
    -webkit-overflow-scrolling: touch;
    padding: 25px;
  }
}

.submit-bin-content .popup-title {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #1f2937;
  font-family: var(--primary-font);
  font-size: 1.5rem;
  font-weight: 600;
}

.submit-bin-content p {
  margin-bottom: 1.5rem;
  color: #6b7280;
  line-height: 1.6;
  font-family: var(--primary-font);
}

.bin-submission-form .form-group {
  margin-bottom: 1.25rem;
}

.bin-submission-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
  font-family: var(--primary-font);
  font-size: 0.875rem;
}

.bin-submission-form input,
.bin-submission-form select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--primary-font);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Improved dropdown select for iOS and better chevron */
.bin-submission-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color: #333;
  background-color: white;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c3c26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  margin-left: 0;
  border-radius: 8px;
  text-overflow: ellipsis;
}

.bin-submission-form input:focus,
.bin-submission-form select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 74, 125, 0.1);
}

.form-footer {
  margin-top: 25px;
  text-align: right;
}

/* Base button */
.submit-bin-form-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* space between text and icon */
  position: relative;
  overflow: hidden;
}

/* Hover effect for normal state */
.submit-bin-form-btn:hover {
  background-color: var(--primary-color-hover);
}

/* Icon slide on hover */
.submit-bin-form-btn:hover i.bi {
  transform: translateX(4px);
  transition: transform 0.3s ease;
}

/* Smooth icon transition always */
.submit-bin-form-btn i.bi {
  transition: transform 0.3s ease;
}

/* Disabled style */
.submit-bin-form-btn.disabled {
  background-color: #ccc;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

.submit-bin-form-btn.loading {
  position: relative;
  color: transparent !important;
}

.submit-bin-form-btn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spinner 0.8s linear infinite;
}

@keyframes button-spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.separator-with-text {
  display: flex;
  align-items: center;
  margin: 20px 0;
  font-size: 14px;
  color: #666;
}

.separator-line {
  flex-grow: 1;
  height: 1px;
  background-color: #e5e5e5;
}

.separator-text {
  padding: 0 12px;
  white-space: nowrap;
  color: #999;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Use My Location Button */
.location-btn-container {
  text-align: center;
  margin-bottom: 20px;
}

.use-my-location-btn {
  background-color: #f9f9f9;
  color: #111;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.use-my-location-btn:hover {
  background-color: #f2f2f2;
  border-color: #bbb;
}

.use-my-location-btn i {
  margin-right: 8px;
  color: var(--primary-color);
}

.use-my-location-btn.loading {
  background-color: #e0e0e0;
  color: #888;
  cursor: not-allowed;
  position: relative;
}

.use-my-location-btn.loading i {
  color: #888;
}

.use-my-location-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  right: 15px;
  border: 2px solid transparent;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: location-button-spinner 0.8s linear infinite;
}

@keyframes location-button-spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.bin-submission-form input:disabled {
  background-color: #f5f5f5;
  color: #888;
  cursor: not-allowed;
}

.consent-message {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.45);
  /* lighter text */
  margin-top: -0.25rem;
  /* pulls message closer */
  transition: font-size 0.3s ease, margin-top 0.3s ease;
}

/* Smaller screens */
@media (max-width: 480px) {
  .consent-message {
    font-size: 0.7rem;
    margin-top: -0.2rem;
  }
}

/* Larger screens */
@media (min-width: 1024px) {
  .consent-message {
    font-size: 0.8rem;
    margin-top: -0.3rem;
  }
}

.toggle-section {
  margin-top: 10px;
}

.toggle-btn {
  font-size: 14px;
  padding: 4px 0;
  color: var(--primary-color);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;

  display: flex;
  justify-content: space-between;
  /* text left, icon right */
  align-items: center;
  /* vertically center */
  width: 100%;
  /* full container width */
}

.toggle-btn:hover {
  text-decoration: underline;
}

.toggle-icon i {
  font-size: 20px;
  /* bigger icon */
  color: var(--primary-color);
  /* use your brand color */
  transition: transform 0.3s ease;
  /* smooth rotation when toggling */
}

/* Rotate icon when active/open - optional */
.toggle-btn.active .toggle-icon i {
  transform: rotate(45deg);
  /* plus → looks like an "x" or minus */
}

.toggle-content {
  margin-top: 12px;
  /* or 16px for more space */
}

.toggle-content input {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  font-size: 15px;
  transition: border-color 0.2s ease;
}

.toggle-content input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.location-section {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0;
  /* Remove inner padding to keep alignment */
  margin: 10px 0 30px;
  overflow: hidden;
  /* Ensures clean corner clipping for children */
}

/* Wrap the inner content to handle padding inside without shifting alignment */
.location-section-inner {
  padding: 20px;
}

.section-heading.bin-location {
  margin-bottom: 2px;
}

.section-heading {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 10px;
  color: #333;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Location Preview Styles */
.location-preview-container {
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.location-preview-map {
  width: 100%;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .location-preview-map {
    height: 200px;
  }
}
