/* Caregiver Map Block Styles */

.caregiver-map-block {
  margin: 2rem 0;
}

.caregiver-map-block h2 {
  margin-bottom: 1rem;
}

.caregiver-map-summary {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Map styling */
[id^="caregiver-map-"] {
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Table Controls */
.caregiver-table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.caregiver-search-wrapper {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.caregiver-search {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.caregiver-search:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.caregiver-results-info {
  color: #666;
  font-size: 0.9rem;
  white-space: nowrap;
}

.results-count {
  font-weight: 500;
}

/* Screen reader only text */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Table Wrapper */
.caregiver-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
}

/* Table Styling */
.caregiver-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: #fff;
}

.caregiver-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #e1e5e9;
}

.caregiver-table th {
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-right: 1px solid #e1e5e9;
  position: relative;
}

.caregiver-table th:last-child {
  border-right: none;
}

.caregiver-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.caregiver-table th.sortable:hover {
  background: #e9ecef;
}

.caregiver-table th.sortable .sort-icon {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #999;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.caregiver-table th.sortable:hover .sort-icon {
  opacity: 1;
}

.caregiver-table th.sortable.sort-asc .sort-icon {
  border-bottom: 5px solid #007cba;
  border-top: none;
  opacity: 1;
}

.caregiver-table th.sortable.sort-desc .sort-icon {
  border-top: 5px solid #007cba;
  border-bottom: none;
  opacity: 1;
}

.caregiver-table tbody tr {
  border-bottom: 1px solid #e1e5e9;
  transition: background-color 0.2s ease;
}

.caregiver-table tbody tr:hover {
  background: #f8f9fa;
}

.caregiver-table tbody tr.hidden {
  display: none;
}

.caregiver-table td {
  padding: 1rem 0.75rem;
  vertical-align: top;
  border-right: 1px solid #e1e5e9;
}

.caregiver-table td:last-child {
  border-right: none;
}

.caregiver-name strong {
  color: #333;
  font-weight: 600;
}

.caregiver-address {
  color: #555;
}

.telephone-link,
.email-link,
.website-link {
  color: #007cba;
  text-decoration: none;
  transition: color 0.2s ease;
}

.telephone-link:hover,
.email-link:hover,
.website-link:hover {
  color: #005a87;
  text-decoration: underline;
}

/* Pagination Styling */
.caregiver-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.caregiver-pagination .pagination {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.pagination_block {
  display: flex;
}

.pagination_element {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  margin: 0;
  border: 1px solid #e1e5e9;
  background: #fff;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
}

.pagination_element:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #007cba;
  color: #007cba;
}

.pagination_element.current {
  background: #007cba;
  border-color: #007cba;
  color: #fff;
}

.pagination_element:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
}

.pagination-info {
  color: #666;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .caregiver-table-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .caregiver-search-wrapper {
    min-width: auto;
  }
  
  .caregiver-results-info {
    text-align: center;
  }
  
  .caregiver-table th,
  .caregiver-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
  
  .caregiver-table th.sortable .sort-icon {
    right: 0.25rem;
  }
  
  .caregiver-pagination {
    flex-direction: column;
    text-align: center;
  }
  
  .pagination_element {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    min-width: 40px;
  }
}

@media (max-width: 480px) {
  /* Stack table for very small screens */
  .caregiver-table-wrapper {
    border: none;
  }
  
  .caregiver-table,
  .caregiver-table thead,
  .caregiver-table tbody,
  .caregiver-table th,
  .caregiver-table td,
  .caregiver-table tr {
    display: block;
  }
  
  .caregiver-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .caregiver-table tr {
    border: 1px solid #e1e5e9;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
  }
  
  .caregiver-table td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 30%;
    padding-right: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .caregiver-table td:last-child {
    border-bottom: none;
  }
  
  .caregiver-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 0.5rem;
    width: 25%;
    padding-right: 0.5rem;
    white-space: nowrap;
    font-weight: 600;
    color: #333;
  }
  
  /* Add data labels for mobile */
  .caregiver-name:before { content: "Name: "; }
  .caregiver-address:before { content: "Address: "; }
  .caregiver-telephone:before { content: "Phone: "; }
  .caregiver-email:before { content: "Email: "; }
  .caregiver-website:before { content: "Website: "; }
}

/* Loading state */
.caregiver-table-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-style: italic;
}

/* Empty state */
.caregiver-table-empty {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-style: italic;
}

.caregiver-table-empty:before {
  content: "🔍 ";
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}