/* ====================================================
   Pollination Map Page Styles (Specific to Page/Post 4827)
   ==================================================== */
   .page-id-4827 .container {
    max-width: 2000px;
    width: 100%;
  }
  
  .post-4827 {
    padding-top: 40px;
  }
  
  /* Retain the !important margin from the first snippet */
  #farm-address-input-container {
    margin-bottom: 0px !important;
  }
  
  .header-buttons {
    line-height: 27px;
  }
  
  .header-buttons #beehive-share-btn {
    height: 51px;
  }
  
  #beehive-map-title {
    margin: 0;
  }
  
  .beehive-map-header {
    /* Merged: gap from first snippet with flex layout defined below */
    gap: 15px;
  }
  
  .beehive-add-hive-section {
    text-align: center;
  }
  
  @media screen and (max-width: 991px) {
    .beehive-map-content {
      grid-template-columns: 1fr !important; /* Single column layout */
      grid-template-rows: auto auto auto auto; /* Stack everything */
    }
    .beehive-map-header {
    flex-direction: column-reverse;	
    }
    .header-buttons {
      width: 100% !important;
      justify-content: center;
	  margin-bottom: 15px;
    }
    .farm-address-section {
      width: 100% !important;
    }
    #farm-address-display {
      justify-content: flex-end;
		width: 100%;
    }
    #beehive-invite-container input[type="email"] {
      max-width: 100% !important;	
    }
  }

@media screen and (max-width: 480px) {
	.farm-address-section {
		flex-direction: column;
	}
	#beehive-add-farm-btn {
		width: 100%;
	}
}
  
  /* ====================================================
     Global Styles & Layout (Merged from Second Block)
     ==================================================== */
  
  /* Ensure consistent box-sizing */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  /* Overall wrapper as a vertical flex container */
  .beehive-map-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
      Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    padding: 15px;
    color: #333;
    background: #fdfdfd; /* Slightly off-white for a cleaner, modern look */
  }
  
  /* Header: display farm address, share and add farm buttons on one row */
  .beehive-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 5px;
    gap: 15px;
  }
  
  #beehive-save-map-title-btn {
    white-space: nowrap;
    height: 51px;
  }
  
  #beehive-delete-map-address-btn {
    height: 51px;
    line-height: 18px;
    word-break: keep-all;
  }
  
  /* Farm address section (left side) */
  .farm-address-section {
    flex: 1;
    width: 50%;
	  display: flex;
	  gap: 8px;
  }
  
  /* Header buttons (right side) */
  .header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 27px;
    width: 50%;
    justify-content: end;
  }
  
  /* Share button styling */
  #beehive-share-btn {
    padding: 6px 12px;
    background-color: #e7e7e7 !important;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    height: 51px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
  }
  #beehive-share-btn:hover {
    background-color: #97d0eb !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
  
  /* Add Another Farm button (small and inline) */
  #beehive-add-farm-btn {
    padding: 6px 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    line-height: 18px;
    height: 51px;
	  flex: 0 0 auto;
  }
  #beehive-add-farm-btn:hover {
    background: #005f8d;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
  
  /* -----------------------------------------------
    Invitation Field + Button Container
  ------------------------------------------------- */
  #beehive-invite-container {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center; /* added for vertical centering */
  }

  /* Base styles for the email input (hidden by default) */
  #beehive-invite-container input[type="email"] {
    width: 0;
    opacity: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 0;
    padding: 0;
    transition: width 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
	height: 0px;
  }

  /* When the container is active, reveal the email input */
  #beehive-invite-container.active input[type="email"] {
    max-width: 400px;  /* adjust as needed */
	width: 100%;
    opacity: 1;
    padding: 6px;  /* restore padding */
	height: 51px;
  }

  /* On mobile, let the input appear in full width stacking underneath */
  @media (max-width: 600px) {
    #beehive-invite-container {
      flex-direction: column;
      align-items: stretch;
	  gap: 0;
    }
	#beehive-invite-container.active {
      gap: 8px; 
	}
    #beehive-invite-container.active input[type="email"] {
      width: 100%;
    }
	#beehive-invite-container.active ~ #beehive-share-btn-container #beehive-share-btn {
	  height: 110px !important;
	}
  }

  /* Button styling remains unchanged */
  #beehive-send-invite-btn {
    padding: 6px 12px;
    background: #006599;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
	  height: 51px;
  }
  #beehive-send-invite-btn:hover {
    background: #004e77;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }

    
  /* New Farm input container */
  #new-farm-input-container {
    display: none;
    margin-left: 10px;
    gap: 8px;
	  margin-top: 0px !important;
  }
	#new-farm-input-container {
		display: flex;
		flex-direction: row;
		width: 100%;
	}
  #new-farm-input-container input[type="text"] {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
	  margin-bottom: 0px;
  }
  #new-farm-input-container button {
    padding: 6px 12px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
	  height: 51px;
	  white-space: nowrap;
  }
  #new-farm-input-container button:hover {
    background: #429e46;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }

@media screen and (max-width: 600px) {
	#new-farm-input-container {
	  display: flex;
	  flex-wrap: wrap;
	}

	#new-farm-address {
	  flex-basis: 100%; /* Force the input to take the full row */
	}

	#save-new-farm-btn,
	#cancel-new-farm-btn {
	  flex: 0 0 auto; /* They will appear on the next row side by side */
	}

}
  
  /* Content: grid with map and controls side by side */
  .beehive-map-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    position: relative;
  }
  
  /* Map Container (left column) */
  .beehive-map-container {
    border: 1px solid #eee;
    height: 600px;
    position: relative;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }
  
  /* Controls (right column) */
  .beehive-map-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    max-height: 600px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }
  
  /* Counters row */
  .beehive-counters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .beehive-counters .counter-item {
    background: #f5f5f5;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    box-shadow: none;
    text-align: center;
    flex: 0 0 auto;
    transition: background 0.2s ease;
  }
  .beehive-counters .counter-item:hover {
    background: #ebebeb;
  }
  
  /* Farm address container */
  #farm-address-container {
    margin-bottom: 10px;
  }
  #farm-address-display {
    font-size: 16px;
    font-weight: 600;
    color: #333;
  }
  #farm-address-display a {
    margin-left: 8px;
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
    white-space: nowrap;
  }
  #farm-address-display a:hover {
    text-decoration: underline;
  }
  /* Merge the two definitions for #farm-address-input-container:
     The first snippet forces margin-bottom: 0px !important; */
  #farm-address-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 0px !important;
	  width: 100%;
  }
  #farm-address-input-container input[type="text"] {
    flex: 1;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
  }
  #farm-address-input-container button {
    padding: 6px 12px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    font-size: 14px;
  }
  #farm-address-input-container button:hover {
    background: #429e46;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
	
#beehive-map-dropdown {
	margin-bottom: 0px;
}
#dropdown-edit-link {
	white-space: nowrap;
}

  /* Hide the "Add Hive" header for a cleaner look */
  .beehive-add-hive-section h4 {
    display: none;
  }
  
  /* Add Hive Section (sticky above the marker list) */
  .beehive-add-hive-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    position: sticky;
    top: 0;
    background: #fff;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    z-index: 2;
    text-align: center;
    align-items: center;
    padding: 10px 0px 15px 0px;
  }
  
  /* Place the label, input, and button on the same row */
  .beehive-add-hive-section .add-hive-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  /* Hide the notes text area by default. */
  #beehive-marker-description {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-size: 14px;
  }
  
  /* "Add notes" link styling */
  .beehive-add-hive-section .add-notes-link {
    display: inline-block;
    margin-top: -6px;
    font-size: 14px;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
  }
  
  #beehive-marker-count, #marker-edit-count-0 {
    width: 60px;
    padding: 0 0 0 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 0;
  }
  
  #beehive-add-marker-btn {
    padding: 6px 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    height: 51px;
    line-height: 18px;
  }
  #beehive-add-marker-btn:hover {
    background: #005f8d;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
  
  /* Marker list container */
  #beehive-marker-list-container {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px;
    overflow-y: auto;
    background: #fff;
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  
  /* Marker list styling */
  #beehive-marker-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  #beehive-marker-list li {
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    font-size: 14px;
  }
  #beehive-marker-list li:hover {
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  #beehive-marker-list li .marker-actions a {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
  }
  #beehive-marker-list li .marker-actions a:hover {
    text-decoration: underline;
  }
  
  /* Clear All button */
  #clear-all-link {
    margin-top: 5px;
    padding: 6px 12px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  #clear-all-link:hover {
    background: #b52d3b;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
  
  /* Map Drawing area display */
  #map-drawing-area-display {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    pointer-events: none;
  }
  
  /* Toast Messages */
  .beehive-message {
    position: fixed;
    bottom: 40px;
    right: 20px;
    padding: 10px 15px;
    color: #fff;
    z-index: 99999;
    border-radius: 5px;
    font-size: 14px;
    opacity: 0.95;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
  .beehive-message.success {
    background: #28a745;
  }
  .beehive-message.error {
    background: #dc3545;
  }
  
  /* Advanced Marker Styling */
  .beehive-advanced-marker {
    position: relative;
    display: inline-block;
    transform: translate(-50%, -100%);
    user-select: none;
  }
  .beehive-marker-icon {
    font-size: 24px;
    line-height: 24px;
    text-align: center;
    user-select: none;
  }
  .beehive-marker-label {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: 2px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  }
  
  /* Bounce Animation */
  @keyframes bounce {
    0% {
      transform: translate(-50%, -100%) scale(1);
    }
    50% {
      transform: translate(-50%, -130%) scale(1.2);
    }
    100% {
      transform: translate(-50%, -100%) scale(1);
    }
  }
  .beehive-bounce {
    animation: bounce 0.8s;
  }
  
  /* --- New CSS for Overlay (covering only the map and controls) --- */
  .beehive-map-content.overlay-active .farm-address-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: all;
  }
  .beehive-map-content.overlay-active .farm-address-overlay p {
    font-size: 16px;
    color: #333;
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  
  /* --- Marker Popup Styles (Edit/Save/Delete) --- */
  #marker-popup {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1px solid #ccc;
  
    /* Tweak the padding to reduce white space: */
    padding: 6px; /* down from 10px */
  
    border-radius: 4px;
  
    /* If it's too narrow, set a min-width */
    min-width: 180px;
  
    /* If you want an upper bound so it doesn't get too wide: */
    /* max-width: 250px; */
  
    /* Slight box-shadow remains. */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }
  #marker-popup label {
    font-weight: 600;
    font-size: 14px;
  }
  #marker-popup textarea {
    width: 100%;
    resize: vertical;
    font-size: 14px;
    margin-bottom: 8px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  #marker-popup input[type="number"] {
    width: 100%;
    margin-bottom: 8px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  #marker-popup button {
    padding: 6px 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  #marker-popup button:hover {
    background: #005f8d;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
  #marker-popup-delete {
    background: #dc3545;
  }
  #marker-popup-delete:hover {
    background: #b52d3b;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
  }
  
  /* --- Inline Marker Edit Form --- */
  .marker-edit-form {
    background: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #eee;
  }
  .marker-edit-form label {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
  }
  .marker-edit-form textarea {
    width: 100%;
    resize: vertical;
    margin-top: 4px;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
  }
  /* .marker-edit-form input[type="number"] {
    margin-top: 4px;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #ccc;
  } */
  .marker-edit-form button {
    margin-top: 6px;
    padding: 6px 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .marker-edit-form button:hover {
    background: #005f8d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

 
/* -----------------------------------------
   Share Button & Menu Styling
----------------------------------------- */
#beehive-share-btn-container {
  position: relative;
}

#beehive-share-btn {
  background: none;
  border: none;
  cursor: pointer;
}

#beehive-share-menu {
  display: none; /* menu is hidden by default */
  position: absolute;
  top: 30px;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  z-index: 100;
}

#beehive-share-menu a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s ease;
}

#beehive-share-menu a:hover {
  background: #f0f0f0;
}


/* Loader Styles for the map */
/* Ensure the map container is the relative parent */
.beehive-map-container {
  position: relative;
  border: 1px solid #eee;
  height: 600px;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Centered loading spinner inside the map container */
#map-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500; /* Ensure it's above the map */
}

/* Spinner image should spin */
#map-loading-spinner img {
  width: 100px; /* Adjust as needed */
  height: 100px;
  animation: spin 2s linear infinite;
}

/* Keyframes for spin animation */
@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Request Access */
#beehive-request-access-container {
  display: flex;
  gap: 15px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

#request-access-email {
  margin-bottom: 0px;
}

#request-access-btn {
  line-height: 18px;
  height: 51px;
  background: #006599;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

#request-access-btn:hover {
  background: #004e77;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);	
}

/* Add Others Button */
#beehive-invite-toggle-btn, #request-access-toggle-btn, #request-access-send-btn, #beehive-save-farm-btn, #save-shared-map-btn {
  line-height: 18px;
  height: 51px;
  background: #006599;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  padding: 0px 10px;
	flex: 0 0 auto;
}

#beehive-invite-toggle-btn:hover, #request-access-toggle-btn:hover, #request-access-send-btn:hover {
  background: #004e77;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);	
}

#beehive-invite-form {
	display: flex;
	gap: 8px;
	margin-top: 0px !important;
}

#request-access-form {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 0px !important;
}

@media screen and (max-width: 991px) {
	#request-access-email {
		width: 100% !important;
	}
	#beehive-request-access-container {
		width: 100%;
	}
	#request-access-form {
		width: 100%;
	}
}

/* Collaborators */
#beehive-collaborators-row {
	flex: 1 0 auto;
	justify-content: flex-end;
}

#beehive-collaborators-row > img {
	border-radius: 50%;
}

/* Hide arrows by default */
.collaborator-arrow {
  display: none;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
}

/* Carousel wrapper */
.collaborator-carousel-wrapper {
  display: flex;
  align-items: center;
}

/* Carousel container: 3 images (40px each) + 2 gaps (8px each) = 136px total width */
.collaborator-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  width: calc((40px * 3) + (8px * 2));
  cursor: grab;
}

/* Hide scrollbar in WebKit browsers */
.collaborator-carousel::-webkit-scrollbar {
  display: none;
}

/* Optional: change cursor when dragging */
.collaborator-carousel.active {
  cursor: grabbing;
}

@media screen and (max-width: 500px) {
	.collaborator-section {
		flex-direction: column;
		width: 100%;
	}
	.collaborator-carousel-wrapper {
		width: 100%;
	}
	#beehive-invite-container {
		width: 100%;
	}
}

/* Beehive dropdown edit */
#farm-address-dropdown-edit-container {
	display: flex;
	gap: 8px;
	width: 100%;
}
