/* Store Map CSS Styles */

/* Map container styles */
#map {
  height: 80vh;
  min-height: 300px;
  max-height: 600px;
  width: 100%;
  transition: all 0.3s ease;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  #map {
    height: 40vh;
    min-height: 250px;
  }
}

/* Info box styles */
.info-box {
  background: white;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Popup content styles */
.leaflet-popup-content {
  margin: 13px;
  min-width: 250px;
  max-width: 300px;
  font-size: 14px;
  line-height: 1.5;
}

/* Responsive styles for popup content */
@media (max-width: 480px) {
  .leaflet-popup-content {
    min-width: 200px;
    max-width: 240px;
    margin: 10px;
    font-size: 13px;
  }

  .leaflet-popup-content h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
}

/* Circle marker styles */
.circle-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(66, 133, 244, 0.7);
  border: 2px solid white;
  color: white;
  font-weight: bold;
  text-align: center;
}

/* Store marker styles */
.store-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(219, 68, 55, 0.9);
  border: 2px solid white;
  color: white;
  font-weight: bold;
  text-align: center;
}

/* Search overlay styles */
.map-search-overlay {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 500px;
  z-index: 20;
}

/* Category button styles */
.category-btn {
  display: flex;
  padding: 12px 33px;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  background-color: #e7e6e6;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.category-btn.active {
  background-color: #198547;
  color: white !important;
}

/* Search results styles */
.search-results {
  max-height: 60vh;
  overflow-y: auto;
}

/* Scrollbar styles for category filter */
.category-filter-container {
  scrollbar-width: thin;
  -ms-overflow-style: none;
}

.category-filter-container::-webkit-scrollbar {
  height: 4px;
}

.category-filter-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Store Locations CRUD CSS */

.store-locations-crud .form-table th {
  width: 150px;
}

.store-locations-crud .form-table textarea {
  width: 100%;
  max-width: 500px;
}

.store-locations-crud .wp-list-table {
  margin-top: 20px;
}

.store-locations-crud .tablenav {
  padding: 15px 0;
}

/* Loading indicators */
.store-locations-crud .loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.store-locations-crud .loading:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5) url("../images/spinner.gif") no-repeat
    center center;
  z-index: 999;
}

/* Delete link styling */
.store-locations-crud .delete-location {
  color: #a00;
}

.store-locations-crud .delete-location:hover {
  color: #dc3232;
}

/* Map preview for admin */
#map-preview,
#province-map-preview {
  margin-top: 15px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Loading animation */
.loading {
  position: relative;
  pointer-events: none;
}

.loading:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.loading:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}

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

/* Add these styles to the existing CSS file */

/* Admin Form Layout */
.slm-admin-form-container {
  margin: 20px 0;
}

.slm-form-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.slm-form-left {
  flex: 1;
  min-width: 300px;
}

.slm-form-right {
  flex: 1;
  min-width: 300px;
}

/* Map Preview Containers */
#map-preview,
#province-map-preview {
  height: 400px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 10px;
}

/* Province Circle Markers */
.circle-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(66, 133, 244, 0.7);
  border: 2px solid white;
  color: white;
  font-weight: bold;
  text-align: center;
}

/* Store Markers */
.store-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(219, 68, 55, 0.9);
  border: 2px solid white;
  color: white;
  font-weight: bold;
  text-align: center;
}

/* Form Table Improvements */
.store-locations-crud .form-table th {
  width: 120px;
  vertical-align: top;
  padding-top: 15px;
}

.store-locations-crud input[type="text"],
.store-locations-crud select,
.store-locations-crud textarea {
  width: 100%;
  max-width: 400px;
  border-radius: 4px;
}

/* Improved List Table */
.store-locations-crud .wp-list-table {
  border-collapse: collapse;
  margin-top: 20px;
  width: 100%;
}

.store-locations-crud .wp-list-table th {
  background-color: #f9f9f9;
  padding: 10px;
}

.store-locations-crud .wp-list-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

/* Add to existing CSS */

/* Modal for map preview */
#map-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
}

.map-preview-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  height: 70vh;
  max-height: 600px;
  background: white;
  padding: 20px;
  border-radius: 5px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: #f44336;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  font-weight: bold;
  z-index: 10000;
}

/* Enhanced form layout */
.slm-admin-form-container {
  margin: 20px 0;
}

.slm-form-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.slm-form-left {
  flex: 1;
  min-width: 300px;
}

.slm-form-right {
  flex: 1;
  min-width: 300px;
}

/* Enhanced list table */
.store-locations-table {
  margin-top: 15px;
}

.column-name {
  width: 20%;
}

.column-address {
  width: 25%;
}

.column-province,
.column-city {
  width: 15%;
}

.column-phone {
  width: 15%;
}

.column-actions {
  width: 10%;
}

/* Store locations table styling */
.store-locations-table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 10px;
}

.store-locations-table th {
  text-align: left;
  padding: 10px;
}

.store-locations-table .column-name {
  width: 20%;
}

.store-locations-table .column-province {
  width: 15%;
}

.store-locations-table .column-city {
  width: 15%;
}

.store-locations-table .column-address {
  width: 25%;
}

.store-locations-table .column-phone {
  width: 10%;
}

.store-locations-table .column-url {
  width: 5%;
}

.store-locations-table .column-actions {
  width: 10%;
}

.store-locations-table td {
  padding: 10px;
  vertical-align: middle;
}

/* Add these styles at the end of the file */

/* Province sections */
.province-section h1 {
  font-family: "D-DIN", sans-serif;
  position: sticky;
  top: 0;
  background-color: #f3f4f6;
  z-index: 10;
  margin-bottom: 0.75rem;
}

/* Office cards grid */
.province-section .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

/* Office card styling */
.province-section a,
.province-section [role="button"] {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.province-section a:hover,
.province-section [role="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .province-section .grid {
    grid-template-columns: 1fr;
  }

  .province-section h1 {
    font-size: 1.25rem;
    padding: 0.75rem;
  }
}
