/* Community Geo Locator - WordPress Compatible Styles */

/* Filter Bar */
.cgl-filter-container {
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  width: 100%;
}

.cgl-filter-container .form-control,
.cgl-filter-container .form-select {
  border: 1px solid #e1e1e1;
}

.cgl-filter-container .row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
}
.cgl-filter-container .row > [class^='col-'] {
  flex: 0 1 auto;
  margin-bottom: 0;
}
.cgl-filter-container .reset-btn-col {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  min-width: 48px;
  padding-left: 0.5rem;
}

/* List Container */
#cgl-list-container {
  height: 100%;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  padding: 15px;
  position: relative;
}

/* Map Container */
#cgl-map-container {
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}

/* Community Cards */
.cgl-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  margin-bottom: 16px;
  border: 1px solid #eee;
  cursor: pointer;
  display: flex;
  flex-direction: row;
}

.cgl-card:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cgl-card.active {
  border: 2px solid #0073aa;
}

.cgl-card-img {
  width: 120px;
  min-width: 120px;
  overflow: hidden;
  position: relative;
  background-color: #f0f0f0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 1;
  border-radius: 0 4px 4px 0;
}

.cgl-card-img::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.03);
  z-index: 1;
}

.cgl-card-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.cgl-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #333;
  line-height: 1.3;
}

.cgl-card-address {
  font-style: normal;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.4;
}

.cgl-card-phone {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
}

.cgl-card-phone a {
  color: #0073aa;
  text-decoration: none;
  font-weight: 600;
}

.cgl-card-phone a:hover {
  text-decoration: underline;
  color: #005a87;
}

.cgl-card-phone i {
  color: #0073aa;
  font-size: 1.1em;
}

.cgl-card-btn {
  display: inline-block;
  background-color: #0073aa;
  color: white !important;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 16px;
  text-align: center;
  margin-top: auto;
  min-width: 150px;
  text-transform: uppercase;
}

.cgl-card-btn:hover {
  background-color: #005a87;
  color: white !important;
  text-decoration: none !important;
}

/* Map Info Window */
.map-info-content {
  width: 280px;
  max-width: 100%;
}

.map-info-img {
  height: 120px;
  overflow: hidden;
  position: relative;
  background-color: #f0f0f0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.map-info-body {
  padding: 10px;
}

.map-info-body h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 5px 0;
  color: #333;
}

.map-info-body p {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 10px;
}

.map-info-btn {
  display: inline-block;
  background-color: #0073aa;
  color: white !important;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  min-width: 120px;
  text-transform: uppercase;
}

.map-info-btn:hover {
  background-color: #005a87;
  color: white !important;
  text-decoration: none !important;
}

.map-info-phone {
  font-size: 15px;
  font-weight: 500;
}

.map-info-phone a {
  color: #0073aa;
  text-decoration: none;
  font-weight: 600;
}

.map-info-phone a:hover {
  text-decoration: underline;
  color: #005a87;
}

.map-info-phone i {
  color: #0073aa;
  font-size: 1.1em;
}

/* Google Maps info window fixes */
.gm-style-iw {
  padding: 0 !important;
}

.gm-style-iw-d {
  overflow: hidden !important;
}

.gm-style-iw-chr {
  background: none !important;
  width: auto !important;
  height: auto !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 2;
  box-shadow: none !important;
  border-radius: 50% !important;
  padding: 0 !important;
}
.gm-style-iw-chr::after {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translate(-50%, -50%);
  z-index: -1;
}
.gm-style-iw-chr span {
  position: relative;
  z-index: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .cgl-filter-container .row {
    flex-direction: row;
    gap: 0.25rem;
  }
  .cgl-filter-container .reset-btn-col {
    min-width: 40px;
    padding-left: 0.25rem;
  }
  .cgl-card {
    flex-direction: column;
  }
  .cgl-card-img {
    width: 100%;
    height: 120px;
    order: -1;
    min-height: 100px !important;
  }
  .cgl-card-btn {
    width: 100%;
  }

  div#cgl-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .cgl-card {
    flex-direction: column;
    width: 50%;
  }
  h3.cgl-card-title {
    font-size: 18px!important;
  }
  .cgl-card-address {
    font-size: 16px;
  }
  .cgl-card-phone {
    font-size: 16px;
  }

  a.cgl-card-btn {
    font-size: 12px;
  }

  address.cgl-card-address {
    font-size: 12px;
 }

 .cgl-content-area {
  min-height: auto!important;
  }

  #cgl-list-container, #cgl-map-container {
    max-height: 500px!important;
    min-height: 500px!important;
}

div#cgl-container {
  height: auto!important;
}
}

.cgl-list-item {
  transition: box-shadow 0.2s, border-color 0.2s;
}
.cgl-list-item:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  border-color: #0d6efd22;
}
.cgl-list-item__image {
  border-radius: 0.5rem;
  background: #f8f9fa;
  object-fit: cover;
  width: 72px;
  height: 72px;
}
.cgl-list-item__title {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}
.cgl-list-item__phone i {
  vertical-align: middle;
  font-size: 1.1em;
}
.cgl-list-item__button {
  font-weight: 500;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s;
}
.cgl-list-item__button:hover {
  background: #0b5ed7;
  color: #fff;
}
.cgl-map-popup {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-width: 260px;
  max-width: 340px;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  overflow: hidden;
  padding: 0;
}
.cgl-map-popup-img {
  width: 40%;
  min-width: 90px;
  background-size: cover;
  background-position: center center;
  background-color: #f8f9fa;
}
.cgl-map-popup-content {
  width: 60%;
  padding: 1rem 1rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cgl-map-popup .cgl-list-item__image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #f8f9fa;
}
.cgl-map-popup .flex-grow-1 {
  min-width: 0;
}
.cgl-list-item__title {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 4px;
}

.cgl-list-item__phone {
  font-size: 14px;
  margin-bottom: 4px;
}

.cgl-list-item__phone a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.cgl-list-item__phone a:hover {
  text-decoration: underline;
  color: #2980b9;
}

.cgl-list-item__address {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
}

/* Ensure the main container is at least 100vh minus 80px tall */
#cgl-container {
  display: flex;
  flex-direction: column;
  height: 90vh;
  min-height: 0;
  background: #f8f9fa;
}

#cgl-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.85);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #0073aa;
  transition: opacity 0.2s;
  pointer-events: all;
}
#cgl-loader-overlay .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 1rem;
}

.cgl-content-area {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  gap: 1.5rem;
}

#cgl-list-container,
#cgl-map-container {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  padding: 15px;
  position: relative;
}

#cgl-list-container {
  flex: 0 0 32%;
  max-width: 32%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
}
#cgl-map-container {
  flex: 1 1 68%;
  min-width: 0;
  min-height: 0;
}

@media (max-width: 768px) {
  .cgl-content-area {
    flex-direction: column;
    gap: 0.75rem;
  }
  #cgl-list-container,
  #cgl-map-container {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    height: 70vh;
  }
}

.cgl-filter-row {
  display: flex;
  flex-direction: row;
  align-items: end;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: nowrap;
}
.cgl-filter-row input,
.cgl-filter-row select {
  min-width: 100px;
  margin-bottom: 0;
}
.cgl-filter-row .reset-btn-col {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  justify-content: flex-end;
  min-width: 48px;
  padding-left: 0.5rem;
}

@media (max-width: 1024px) {
  .cgl-filter-row {
    flex-wrap: wrap;
  }
  #cgl-search {
    flex-basis: 100%;
    order: 1;
    margin-bottom: 0.5rem;
  }
  #cgl-city-filter, #cgl-state-filter {
    flex-basis: 48%;
    order: 2;
    margin-bottom: 0.5rem;
  }
  #cgl-zip-filter, .cgl-filter-row .reset-btn-col {
    flex-basis: 48%;
    order: 3;
    margin-bottom: 0;
  }
  .cgl-filter-row .reset-btn-col {
    justify-content: flex-end;
    min-width: 40px;
    padding-left: 0.25rem;
  }
}
@media (max-width: 768px) {
  .cgl-filter-row {
    gap: 0.5rem;
  }
  #cgl-search {
    flex-basis: 100%;
    order: 1;
  }
  #cgl-city-filter, #cgl-state-filter {
    flex-basis: 48%;
    order: 2;
  }
  #cgl-zip-filter, .cgl-filter-row .reset-btn-col {
    flex-basis: 48%;
    order: 3;
  }
} 