/* Applicator Directory v2.1.0 */
/* Green: #93d501 */

.appdir-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2421;
}

/* ===== Tabs ===== */
.appdir-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.appdir-tab {
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.appdir-tab:hover {
  color: #1f2421;
}

.appdir-tab.active {
  color: #7ab801;
  border-bottom-color: #93d501;
}

.appdir-tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 12px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 12px;
}

.appdir-tab.active .appdir-tab-count {
  background: #e8f5cc;
  color: #7ab801;
}

/* ===== Toolbar ===== */
.appdir-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

body #appdir-wrapper .appdir-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

body #appdir-wrapper .appdir-search-wrap .appdir-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

body .appdir-wrapper .appdir-search-wrap input[type="text"].appdir-search,
body #appdir-wrapper .appdir-search-wrap input[type="text"].appdir-search,
body .et-db #et-boc .et-l input[type="text"].appdir-search,
body .elementor input[type="text"].appdir-search,
body .elementor-widget-shortcode input[type="text"].appdir-search {
  padding: 12px 16px 12px 46px !important;
  font-size: 15px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  margin-bottom: 0 !important;
  margin: 0 !important;
  background: #fff !important;
  box-sizing: border-box !important;
  width: 100% !important;
  color: #1f2421 !important;
}

body .appdir-wrapper .appdir-search-wrap input[type="text"].appdir-search:focus,
body #appdir-wrapper .appdir-search-wrap input[type="text"].appdir-search:focus,
body .et-db #et-boc .et-l input[type="text"].appdir-search:focus,
body .elementor input[type="text"].appdir-search:focus,
body .elementor-widget-shortcode input[type="text"].appdir-search:focus {
  border-color: #93d501 !important;
  box-shadow: 0 0 0 3px rgba(147, 213, 1, 0.15) !important;
  outline: none !important;
}

.appdir-search:focus {
  outline: none;
  border-color: #93d501;
  box-shadow: 0 0 0 3px rgba(147, 213, 1, 0.15);
}

.appdir-results-count {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

/* ===== Layout ===== */
.appdir-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 20px;
  height: 660px;
}

.appdir-list-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.appdir-list-scroll {
  overflow-y: auto;
  flex: 1;
}

.appdir-map-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

/* ===== Cards (sprayers + hubs flat) ===== */
.appdir-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.appdir-card:last-child {
  border-bottom: none;
}

.appdir-card:hover {
  background: #f8fafc;
}

.appdir-card.active {
  background: #f6faec;
  border-left: 3px solid #93d501;
  padding-left: 13px;
}

.appdir-card-number {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
}

.appdir-card-number.hub {
  background: #2563eb;
}

.appdir-card-number.sprayer {
  background: #93d501;
  color: #1f2421;
}

.appdir-card-body {
  flex: 1;
  min-width: 0;
}

.appdir-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.appdir-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2421;
}

.appdir-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  white-space: nowrap;
}

.appdir-badge.hub {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.appdir-badge.sprayer {
  background: #e8f5cc;
  color: #7ab801;
  border: 1px solid #d4e8a8;
}

.appdir-badge.gmg {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.appdir-badge.count {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.appdir-card-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 3px 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.appdir-card-row .ico {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.appdir-card-row a {
  color: #2563eb;
  text-decoration: none;
}

.appdir-card-row a:hover {
  text-decoration: underline;
}

.appdir-card-cert {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
}

/* ===== Hub group (Spray Hubs tab) ===== */
.appdir-hub-group {
  border-bottom: 1px solid #f1f5f9;
}

.appdir-hub-group:last-child {
  border-bottom: none;
}

.appdir-hub-header {
  display: flex;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.appdir-hub-header:hover {
  background: #f8fafc;
}

.appdir-hub-header.active {
  background: #f6faec;
  border-left: 3px solid #93d501;
  padding-left: 13px;
}

.appdir-expand-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  font-size: 14px;
  transition: transform 0.2s;
  margin-top: 4px;
  transform-origin: center;
}

.appdir-expand-arrow.open {
  transform: rotate(90deg);
}

/* Expanded sprayer rows */
.appdir-hub-sprayers {
  background: #fafbfc;
  padding: 4px 0 8px 0;
  display: none;
}

.appdir-hub-sprayers.open {
  display: block;
}

.appdir-hub-sprayer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 50px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.appdir-hub-sprayer:hover {
  background: #f1f5f9;
}

.appdir-hub-sprayer.active {
  background: #f6faec;
  box-shadow: inset 3px 0 0 #93d501;
}

.appdir-hub-sprayer-letter {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #93d501;
  color: #1f2421;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.appdir-hub-sprayer-name {
  font-weight: 600;
  color: #1f2421;
}

.appdir-hub-sprayer-cert {
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, monospace;
  margin-left: auto;
}

/* ===== Empty state ===== */
.appdir-empty {
  padding: 48px 24px;
  text-align: center;
  color: #94a3b8;
  font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .appdir-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .appdir-list-panel {
    max-height: 480px;
  }

  .appdir-map-panel {
    height: 420px;
  }
}

@media (max-width: 560px) {
  .appdir-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .appdir-search-wrap {
    max-width: 100%;
  }

  .appdir-tab {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* ===== Google Maps Info Window ===== */
.gm-style-iw-c {
  padding: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.gm-style-iw-d {
  overflow: auto !important;
  padding: 0 !important;
}

/* Close button */
.gm-style-iw-c button.gm-ui-hover-effect {
  width: 28px !important;
  height: 28px !important;
  top: 6px !important;
  right: 6px !important;
  opacity: 0.6;
}

.gm-style-iw-c button.gm-ui-hover-effect:hover {
  opacity: 1;
}

.gm-style-iw-c button.gm-ui-hover-effect img {
  width: 14px !important;
  height: 14px !important;
  margin: 7px !important;
}

/* Popup content */
.appdir-popup {
  padding: 14px 16px;
  min-width: 200px;
  max-width: 280px;
}

.appdir-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2421;
  margin-bottom: 8px;
  padding-right: 20px;
  line-height: 1.3;
}

.appdir-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  margin: 4px 0;
  line-height: 1.4;
}

.appdir-popup-row .p-ico {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 12px;
}

/* ===== Google Maps Info Window ===== */
.gm-style-iw-c {
  padding: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  max-width: 300px !important;
}

.gm-style-iw-chr {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

.gm-style-iw-chr button.gm-ui-hover-effect {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0.5;
  z-index: 10;
}

.gm-style-iw-chr button.gm-ui-hover-effect:hover {
  opacity: 1;
}

/* The icon span inside the button - override inline styles */
.gm-style-iw-chr button.gm-ui-hover-effect span {
  width: 16px !important;
  height: 16px !important;
  margin: 6px !important;
}

/* Inner content area */
.gm-style-iw-d {
  overflow: auto !important;
  padding: 0 !important;
  max-height: none !important;
}

.gm-style-iw-d>div {
  padding: 0 !important;
  margin: 0 !important;
}

/* Popup content */
.appdir-popup {
  padding: 14px 32px 14px 16px;
  min-width: 200px;
  max-width: 280px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.appdir-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2421;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.appdir-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  margin: 4px 0;
  line-height: 1.4;
}

.appdir-popup-row .p-ico {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 12px;
}