/* CSS Reset and Isolation for Plugin - prevents affecting WordPress styles */
.wf-map-wrapper {
    /* CSS Containment - prevents layout and style leakage */
    contain: layout style !important;
    isolation: isolate !important;
    
    /* Full-width layout to break out of parent container */
    display: flex !important;
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    height: 80vh !important; /* Adjust height as needed */
    min-height: 600px !important;
    max-height: 1000px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    
    /* Typography - prevent WordPress theme interference */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    
    /* Reset potential WordPress/Elementor inherited styles */
    background: #fff !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Ensure all children inherit box-sizing and reset WordPress/Elementor styles */
.wf-map-wrapper *,
.wf-map-wrapper *::before,
.wf-map-wrapper *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

/* Comprehensive reset for buttons to prevent WordPress/Elementor theme interference */
.wf-map-wrapper button,
.wf-map-wrapper input[type="button"],
.wf-map-wrapper input[type="submit"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    display: inline-block !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    background-image: none !important;
    border: 1px solid transparent !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

/* Reset link styles within plugin - prevent WordPress theme color inheritance */
.wf-map-wrapper a {
    background-color: transparent !important;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* Reset input styles - prevent WordPress form styling */
.wf-map-wrapper input,
.wf-map-wrapper input[type="text"],
.wf-map-wrapper input[type="search"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Prevent Elementor widget styles from affecting plugin */
.wf-map-wrapper h1,
.wf-map-wrapper h2,
.wf-map-wrapper h3,
.wf-map-wrapper h4,
.wf-map-wrapper h5,
.wf-map-wrapper h6 {
    font-weight: inherit !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Reset paragraph and text elements */
.wf-map-wrapper p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Left Sidebar Panel */
.wf-map-wrapper .wf-panel {
    flex: 0 0 400px !important;
    width: 400px !important;
    height: 100% !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border-right: 1px solid #ececec !important;
    box-shadow: 1px 0 10px 0 rgba(0,0,0,0.03) !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif !important;
    font-size: 15.5px !important;
    letter-spacing: 0.01em !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Panel Header */
.wf-map-wrapper .wf-panel-header {
    padding: 12px 28px 8px 28px !important; /* less vertical padding */
    background: #fff !important;
    border-bottom: 1px solid #ededed !important;
    margin-bottom: 0 !important;
}

.wf-map-wrapper .wf-panel-title {
    font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif !important;
    font-size: 2em !important;
    font-weight: 700 !important;
    color: #12314a !important;
    letter-spacing: 0.01em !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.24 !important;
    text-shadow: 0 1px 2px #f1f5f6 !important;
}

/* Search Container */
.wf-map-wrapper .wf-search-container {
    padding: 12px 28px 6px 28px !important; /* less vertical */
    background: #fff !important;
    border-bottom: 1px solid #ededed !important;
}

.wf-map-wrapper .wf-search {
    display: flex !important;
    align-items: center !important;
    background: #f6f8fa !important;
    border: 1px solid #e0e2e8 !important;
    border-radius: 25px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0, 61, 92, 0.04) !important;
}

.wf-map-wrapper .wf-search-icon {
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
}
.wf-map-wrapper .wf-search-icon::before {
    content: '⚲'; /* Unicode search icon */
    font-size: 20px !important;
    color: #555 !important;
}

.wf-map-wrapper #wf-search-input {
    flex: 1 !important;
    padding: 12px 15px !important;
    border: none !important;
    font-size: 1em !important;
    outline: none !important;
    background: #fff !important;
    color: #333 !important;
}

.wf-map-wrapper #wf-search-input::placeholder {
    color: #888 !important;
    opacity: 1 !important;
}

.wf-map-wrapper #wf-search-btn {
    padding: 12px 28px !important;
    border: none !important;
    background: #003d5c !important; /* Dark blue */
    color: #fff !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 1em !important;
    transition: background 0.2s ease !important;
    border-radius: 0 30px 30px 0 !important; /* Rounded corners */
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.wf-map-wrapper #wf-search-btn:hover {
    background: #002a40 !important; /* Darker blue */
}

/* Info Row with List View */
.wf-map-wrapper .wf-info-row {
    padding: 15px 35px !important;
    display: flex !important;
    justify-content: space-between !important; /* Changed */
    align-items: center !important;
    background: #fdfdfd !important;
    border-bottom: 1px solid #dcdcdc !important;
}

.wf-map-wrapper .wf-view-toggle {
    text-align: left !important; /* Changed */
}

.wf-map-wrapper #wf-list-view {
    color: #b8906f !important; /* Gold color */
    text-decoration: underline !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
}

.wf-map-wrapper #wf-list-view:hover {
    color: #8c6d52 !important; /* Darker gold */
}

/* Summary Row */
.wf-map-wrapper .wf-summary-row {
    padding: 20px 35px !important;
    background: #fdfdfd !important;
    border-bottom: 1px solid #dcdcdc !important;
}

.wf-map-wrapper .wf-nearby-text {
    font-size: 1em !important;
    color: #555 !important;
    margin-bottom: 5px !important;
}

.wf-map-wrapper #wf-loc-count {
    color: #003d5c !important;
    font-weight: 700 !important;
    font-size: 1.1em !important;
}

/* Results Container */
.wf-map-wrapper #wf-results {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #fdfdfd !important;
    padding: 0 !important;
    scrollbar-width: thin !important;
    scrollbar-color: #b8906f #e9e9e9 !important;
}

.wf-map-wrapper #wf-results::-webkit-scrollbar {
    width: 8px !important;
}

.wf-map-wrapper #wf-results::-webkit-scrollbar-thumb {
    background: #b8906f !important;
    border-radius: 4px !important;
}

.wf-map-wrapper #wf-results::-webkit-scrollbar-track {
    background: #f3f3f3 !important;
}

/* Ensure link colors are scoped to plugin only */
.wf-map-wrapper .wf-location-address a {
    color: #0066cc !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
}

.wf-map-wrapper .wf-location-address a:hover {
    text-decoration: underline !important;
}

/* Custom InfoWindow Styles */
.wf-infowindow {
    padding: 12px 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    color: #333;
    max-width: 250px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wf-infowindow strong {
    font-size: 1.1em;
    font-weight: 700;
    color: #222;
    display: block;
    margin-bottom: 5px;
}

.wf-infowindow p {
    margin: 0 0 4px !important;
    line-height: 1.4 !important;
    font-size: 0.9em !important;
    color: #555;
}

.wf-infowindow a {
    color: #0073aa !important;
    font-weight: normal !important;
    text-decoration: underline !important;
}

.wf-infowindow a:hover {
    color: #005177 !important;
}

/* Style Google's default InfoWindow container */
.gm-style-iw-c {
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    padding: 0 !important;
    background-color: #fff !important;
}

/* This is the div that contains the content */
.gm-style-iw-d {
    overflow: hidden !important;
}

/* This is the close button */
.gm-ui-hover-effect {
    top: 8px !important;
    right: 8px !important;
}

/* Hide Google Maps native InfoWindow close button when using custom header close */
.wf-infowindow-card ~ .gm-ui-hover-effect, /* standard structure: card as content */
.gm-style-iw-c .gm-ui-hover-effect {
  display: none !important;
}

/* Location Items */
.wf-map-wrapper .wf-location-item {
    padding: 18px 28px 16px 28px !important; /* less vertical, clean card */
    border-bottom: 1px solid #f2f2f2 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px 0 rgba(0,0,0,0.02) !important;
    background: #fff !important;
    margin: 9px 9px 0 9px !important;
    transition: box-shadow 0.15s, background .15s;
}

.wf-map-wrapper .wf-location-item:hover {
    box-shadow: 0 6px 24px 0 rgba(0,61,92,0.085) !important;
    background: #fcfdfe !important;
}

.wf-map-wrapper .wf-location-item:last-child {
    border-bottom: none !important;
}

.wf-map-wrapper .wf-location-title {
    font-weight: 700 !important;
    color: #233a52 !important;
    font-size: 1.12em !important;
    font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif !important;
    margin-bottom: 7px !important;
}

.wf-map-wrapper .wf-location-distance {
    color: #555 !important;
    font-size: 0.9em !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
}

.wf-map-wrapper .wf-location-address {
    color: #59616a !important;
    font-size: 1em !important;
    margin-bottom: 9px !important;
}

.wf-map-wrapper .wf-location-contact {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.wf-map-wrapper .wf-location-telephone {
    color: #cb9758 !important;
    font-size: 0.99em !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}

.wf-map-wrapper .wf-location-website {
    padding: 8px 30px !important;
    border-radius: 22px !important;
    border: 1.2px solid #163f6f !important;
    font-weight: 700 !important;
    color: #12314a !important;
    background: #f3f7fa !important;
    font-size: 0.96em !important;
    text-align: center !important;
    box-shadow: 0 1px 3px rgba(22,63,111,0.07) !important;
    letter-spacing: .08px !important;
    transition: all 0.18s;
    margin-top: 6px !important;
}

.wf-map-wrapper .wf-location-website:hover {
    background: #163f6f !important;
    color: #fff !important;
    border-color: #12314a !important;
}

/* Map Container */
.wf-map-wrapper .wf-map-container {
    flex: 1 !important;
    position: relative !important;
    height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
}

.wf-map-wrapper #wf-map {
    width: 100% !important;
    min-height: 300px !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tips Button - Remove */
.wf-map-wrapper .wf-tips-btn {
    display: none !important;
}

/* Loading Spinner */
.wf-map-wrapper .wf-loading-spinner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 20px !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
}

.wf-map-wrapper .wf-spinner {
    border: 4px solid #e8e8e8 !important;
    border-top: 4px solid #003d5c !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    animation: wf-spin 0.8s linear infinite !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

@keyframes wf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .wf-map-wrapper .wf-panel {
        flex: 0 0 300px !important;
        width: 300px !important;
    }
}

@media (max-width: 800px) {
  .wf-map-wrapper {
    flex-direction: column !important;
    min-height: 100vh !important;
    height: auto !important;
  }
  .wf-map-wrapper .wf-panel {
    flex: 0 0 auto !important;
    width: 100% !important;
    border-radius: 0 0 18px 18px !important;
    min-width: unset !important;
    border-right: none !important;
    border-bottom: 1.2px solid #e6e9ed !important;
    box-shadow: 0 4px 15px 0 rgba(0,46,92,0.07) !important;
  }
  .wf-map-wrapper .wf-panel-header,
  .wf-map-wrapper .wf-search-container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  .wf-map-wrapper .wf-location-item {
    margin-left: 7px !important;
    margin-right: 7px !important;
    padding-left: 13px !important;
    padding-right: 13px !important;
    font-size: 1em !important;
  }
  .wf-map-wrapper .wf-location-title { font-size: 1em !important; }
  .wf-map-wrapper .wf-location-website {
    min-width: 80px !important;
    font-size: 0.92em !important;
    padding: 8px 16px !important;
  }
  .wf-map-wrapper #wf-map {
    min-height: 300px !important;
    max-height: 60vh !important;
    height: auto !important;
  }
}
@media (max-width: 480px) {
  .wf-map-wrapper .wf-panel-header, .wf-map-wrapper .wf-search-container { padding: 8px 5px !important; }
  .wf-map-wrapper .wf-location-item { margin-left: 2px !important; margin-right: 2px !important; padding: 8px 7px 9px 10px !important; font-size: 0.97em !important; }
  .wf-map-wrapper .wf-panel-title { font-size: 1.18em !important; padding-top: 1px !important; }
  .wf-map-wrapper #wf-map { min-height: 220px !important; max-height: 42vh !important; }
}
.wf-map-wrapper .wf-panel, .wf-map-wrapper .wf-panel * {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(80,80,80, 0.08) !important;
  box-sizing: border-box !important;
  font-size: inherit !important;
}

/* Additional professional InfoWindow (map popup) styles */
.wf-infowindow-card {
  background: linear-gradient(120deg, #f7fafc 60%, #e3e6eb 100%);
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 61, 92, 0.15);
  min-width: 240px;
  max-width: 320px;
  padding: 0 !important;
  border: 1px solid #dbeafe;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif !important;
  animation: fadeIn .18s cubic-bezier(.57,1.15,.5,1.02) forwards;
  margin: 0 !important;
}
.wf-infowindow-header {
  background: #003d5c linear-gradient(80deg, #003d5c 70%, #456cab 100%);
  color: #fff;
  font-size: 1.15em;
  font-weight: bold;
  border-radius: 12px 12px 0 0;
  padding: 14px 20px 10px 20px;
  letter-spacing: 0.2px;
}
.wf-infowindow-body {
  padding: 14px 20px 14px 20px;
}
.wf-pin-icon {
  font-size: 1.05em;
  margin-right: 7px;
  vertical-align: middle;
  color: #003d5c;
}
.wf-pin-address {
  color: #21334a;
  font-size: 0.98em;
  line-height: 1.5;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
}
.wf-pin-phone {
  color: #376d53;
  font-size: 0.97em;
  line-height: 1.44;
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
}
.wf-pin-website {
  display: inline-block;
  margin-top: 4px;
  padding: 7px 18px;
  background: #fff;
  border: 1px solid #003d5c;
  border-radius: 20px;
  color: #003d5c;
  font-weight: 700;
  font-size: 0.95em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,61,92,0.07);
  letter-spacing: .15px;
  transition: all 0.18s;
}
.wf-pin-website:hover {
  background: #003d5c;
  color: #fff;
  border-color: #00253e;
  box-shadow: 0 2px 10px rgba(0,41,62,0.12);
}
.wf-infowindow-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #003d5c linear-gradient(80deg, #003d5c 70%, #456cab 100%);
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 0;
  margin: 0;
}
.wf-infowindow-header-title {
  font-size: 1.15em;
  font-weight: bold;
  padding: 16px 15px 10px 20px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-infowindow-close-btn {
  width: 36px;
  height: 36px;
  margin: 5px 10px 5px 6px;
  color: #fff;
  background: none;
  border: none;
  border-radius: 50%;
  font-size: 1.8em;
  font-family: inherit;
  text-align: center;
  line-height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.17s;
}
.wf-infowindow-close-btn:hover,
.wf-infowindow-close-btn:focus {
  background: rgba(255,255,255,0.18);
  color: #e8e8e8;
  outline: 0;
}
