/* Pro plugin styles */
.alplp-wrapper {
  max-width: 1100px;
  margin: 1rem auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Form Grid */
#alplp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.alplp-row label {
  display: block;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 6px;
}

.alplp-row input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

.alplp-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 6px;
}

.alplp-btn {
  background: #0073aa;
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

.alplp-btn-secondary {
  background: #6b7280;
}

/* Results Table */
.alplp-results {
  margin-top: 12px;
  overflow-x: auto;
}

#alplp-results {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  min-width: 600px;
}

#alplp-results td,
#alplp-results th {
  padding: 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  text-align: left;
}

#alplp-results th {
  background: #f8f9fa;
  font-weight: 600;
}

.wp-list-table.striped tbody tr:nth-child(odd) {
  background-color: #fff;
}
.wp-list-table.striped tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}
.wp-list-table tbody tr:hover {
  background-color: #f1f5f9 !important;
  cursor: pointer;
}

/* Map */
.alplp-map {
  height: 420px;
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* Suggestions */
.alplp-suggestions {
  position: relative;
}
.alplp-suggestions .alplp-suggestion {
  background: #fff;
  border: 1px solid #ddd;
  padding: 6px 8px;
  cursor: pointer;
}
.alplp-suggestions .alplp-suggestion:hover {
  background: #f6f6f6;
}

/* Leaflet Attribution (smaller) */
.leaflet-control-attribution {
  font-size: 11px !important;
  color: #555;
}

/* ----------- RESPONSIVE FIXES ----------- */
@media (max-width: 768px) {
  #alplp-form {
    grid-template-columns: 1fr;
  }
  .alplp-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .alplp-btn {
    width: 100%;
    text-align: center;
  }

  /* Card stacking for results table */
  #alplp-results,
  #alplp-results thead,
  #alplp-results tbody,
  #alplp-results th,
  #alplp-results td,
  #alplp-results tr {
    display: block;
    width: 100%;
  }

  #alplp-results thead {
    display: none; /* hide header on mobile */
  }

  #alplp-results tr {
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
  }

  #alplp-results td {
    border: none;
    padding: 6px 8px;
    position: relative;
    text-align: left;
    font-size: 0.9rem;
  }

  #alplp-results td::before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: #374151;
  }
}

@media (max-width: 480px) {
  #alplp-results td {
    font-size: 0.85rem;
    padding: 6px;
  }
  .leaflet-control-attribution {
    font-size: 10px !important;
  }
}
